Saves a string to a resource file.

Namespace: DotNetNuke.Services.Localization
Assembly: DotNetNuke (in DotNetNuke.dll)

Syntax

C#
public bool SaveString(
	string key,
	string value,
	string resourceFileRoot,
	string language,
	PortalSettings portalSettings,
	LocalizationProvider..::..CustomizedLocale resourceType,
	bool createFile,
	bool createKey
)
Visual Basic
Public Function SaveString ( 
	key As String,
	value As String,
	resourceFileRoot As String,
	language As String,
	portalSettings As PortalSettings,
	resourceType As LocalizationProvider..::..CustomizedLocale,
	createFile As Boolean,
	createKey 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.
createFile
Type: System..::..Boolean
if set to true a new file will be created if it is not found.
createKey
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.

Implements

ILocalizationProvider..::..SaveString(String, String, String, String, PortalSettings, LocalizationProvider..::..CustomizedLocale, Boolean, Boolean)

Exceptions

ExceptionCondition
System..::..ExceptionAny file io error or similar will lead to exceptions

See Also