• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class LocalizationProvider

Inheritance
System.Object
ComponentBase<ILocalizationProvider, LocalizationProvider>
LocalizationProvider
Implements
ILocalizationProvider
Inherited Members
ComponentBase<ILocalizationProvider, LocalizationProvider>.Instance
ComponentBase<ILocalizationProvider, LocalizationProvider>.RegisterInstance(ILocalizationProvider)
Namespace: DotNetNuke.Services.Localization
Assembly: DotNetNuke.dll
Syntax
public class LocalizationProvider : ComponentBase<ILocalizationProvider, LocalizationProvider>, ILocalizationProvider

Methods

| Improve this Doc View Source

GetCompiledResourceFile(PortalSettings, String, String)

Gets a compiled resource file for a specific language and portal. This takes the original resource file and overwrites it with any keys found in localized and overridden resource files according to .net and DNN rules.

Declaration
public Dictionary<string, string> GetCompiledResourceFile(PortalSettings portalSettings, string resourceFile, string locale)
Parameters
Type Name Description
PortalSettings portalSettings

The portal settings for the requesting portal. Only used to retrieve PortalId and DefaultLanguage.

System.String resourceFile

The resource file to be retrieved. Relative path from DNN's root starting with /.

System.String locale

The requested locale. You should use the thread locale by default.

Returns
Type Description
Dictionary<System.String, System.String>

Dictionary of key value pairs where the keys are the localization keys and the values the localized texts.

| Improve this Doc View Source

GetString(String, String, String, PortalSettings, Boolean)

Declaration
public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys)
Parameters
Type Name Description
System.String key
System.String resourceFileRoot
System.String language
PortalSettings portalSettings
System.Boolean disableShowMissingKeys
Returns
Type Description
System.String
| Improve this Doc View Source

GetString(String, String, String, PortalSettings)

Declaration
public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings)
Parameters
Type Name Description
System.String key
System.String resourceFileRoot
System.String language
PortalSettings portalSettings
Returns
Type Description
System.String
| Improve this Doc View Source

GetString(String, String, String)

Declaration
public string GetString(string key, string resourceFileRoot, string language)
Parameters
Type Name Description
System.String key
System.String resourceFileRoot
System.String language
Returns
Type Description
System.String
| Improve this Doc View Source

GetString(String, String)

Declaration
public string GetString(string key, string resourceFileRoot)
Parameters
Type Name Description
System.String key
System.String resourceFileRoot
Returns
Type Description
System.String
| Improve this Doc View Source

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

Saves a string to a resource file.

Declaration
public bool SaveString(string key, string value, string resourceFileRoot, string language, PortalSettings portalSettings, LocalizationProvider.CustomizedLocale resourceType, bool createFile, bool createKey)
Parameters
Type Name Description
System.String key

The key to save (e.g. "MyWidget.Text").

System.String value

The text value for the key.

System.String resourceFileRoot

Relative path for the resource file root (e.g. "DesktopModules/Admin/Lists/App_LocalResources/ListEditor.ascx.resx").

System.String language

The locale code in lang-region format (e.g. "fr-FR").

PortalSettings portalSettings

The current portal settings.

LocalizationProvider.CustomizedLocale resourceType

Specifies whether to save as portal, host or system resource file.

System.Boolean createFile

if set to true a new file will be created if it is not found.

System.Boolean createKey

if set to true a new key will be created if not found.

Returns
Type Description
System.Boolean

If the value could be saved then true will be returned, otherwise false.

Implements

ILocalizationProvider

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS