Saves a string to a resource file.
Namespace: DotNetNuke.Services.LocalizationAssembly: DotNetNuke (in DotNetNuke.dll)
Syntax
C# |
---|
bool SaveString( string key, string value, string resourceFileRoot, string language, PortalSettings portalSettings, LocalizationProvider..::..CustomizedLocale resourceType, bool addFile, bool addKey ) |
Visual Basic |
---|
Function SaveString ( key As String, value As String, resourceFileRoot As String, language As String, portalSettings As PortalSettings, resourceType As LocalizationProvider..::..CustomizedLocale, addFile As Boolean, addKey As Boolean ) As Boolean |
Parameters
- key
- Type: System..::..String
The key to save (e.g. "MyWidget.Text").
- value
- Type: System..::..String
The text value for the key.
- resourceFileRoot
- Type: System..::..String
Relative path for the resource file root (e.g. "DesktopModules/Admin/Lists/App_LocalResources/ListEditor.ascx.resx").
- language
- Type: System..::..String
The locale code in lang-region format (e.g. "fr-FR").
- portalSettings
- Type: DotNetNuke.Entities.Portals..::..PortalSettings
The current portal settings.
- resourceType
- Type: DotNetNuke.Services.Localization..::..LocalizationProvider..::..CustomizedLocale
Specifies whether to save as portal, host or system resource file.
- addFile
- Type: System..::..Boolean
if set to true a new file will be created if it is not found.
- addKey
- Type: System..::..Boolean
if set to true a new key will be created if not found.
Return Value
If the value could be saved then true will be returned, otherwise false.
Exceptions
Exception | Condition |
---|---|
System..::..Exception | Any file io error or similar will lead to exceptions |