Class Localization
Localization class support localization in system.
Inheritance
Namespace: DotNetNuke.Services.Localization
Assembly: DotNetNuke.dll
Syntax
public class Localization : object
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
Properties
| Improve this Doc View SourceApplicationResourceDirectory
Gets "~/App_GlobalResources".
Declaration
public static string ApplicationResourceDirectory { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
CurrentCulture
Gets the current Culture being used.
Declaration
public string CurrentCulture { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
CurrentUICulture
Gets the CurrentUICulture for the Thread.
Declaration
public string CurrentUICulture { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
ExceptionsResourceFile
Gets "~/App_GlobalResources/Exceptions.resx".
Declaration
public static string ExceptionsResourceFile { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GlobalResourceFile
Gets "~/App_GlobalResources/GlobalResources.resx".
Declaration
public static string GlobalResourceFile { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
KeyName
Gets or sets the KeyName property returns and caches the name of the key attribute used to lookup resources.
This can be configured by setting ResourceManagerKey property in the web.config file. The default value for this property
is "resourcekey".
Declaration
public static string KeyName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LocalResourceDirectory
Localization class support localization in system.
Declaration
public static string LocalResourceDirectory { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
LocalSharedResourceFile
Localization class support localization in system.
Declaration
public static string LocalSharedResourceFile { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SharedResourceFile
Localization class support localization in system.
Declaration
public static string SharedResourceFile { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
ShowMissingKeys
Gets a value indicating whether to render a visual indicator that a key is missing (i.e. whether the web.config setting ShowMissingKeys is set).
Declaration
public static bool ShowMissingKeys { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
SupportedLocalesFile
Localization class support localization in system.
Declaration
public static string SupportedLocalesFile { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SystemLocale
Localization class support localization in system.
Declaration
public static string SystemLocale { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SystemTimeZone
Localization class support localization in system.
Declaration
public static string SystemTimeZone { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
Methods
| Improve this Doc View SourceActiveLanguagesByPortalID(Int32)
Localization class support localization in system.
Declaration
public static int ActiveLanguagesByPortalID(int portalID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
AddLanguagesToPortal(Int32)
Localization class support localization in system.
Declaration
public static void AddLanguagesToPortal(int portalID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
AddLanguageToPortal(Int32, Int32, Boolean)
Localization class support localization in system.
Declaration
public static void AddLanguageToPortal(int portalID, int languageID, bool clearCache)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID | |
| System.Int32 | languageID | |
| System.Boolean | clearCache |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
AddLanguageToPortals(Int32)
Localization class support localization in system.
Declaration
public static void AddLanguageToPortals(int languageID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | languageID |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
AddTranslatorRole(Int32, Locale)
Localization class support localization in system.
Declaration
public static void AddTranslatorRole(int portalID, Locale language)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID | |
| Locale | language |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
BestCultureCodeBasedOnBrowserLanguages(IEnumerable<String>, String)
Localization class support localization in system.
Declaration
public static string BestCultureCodeBasedOnBrowserLanguages(IEnumerable<string> cultureCodes, string fallback)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | cultureCodes | |
| System.String | fallback |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
BestCultureCodeBasedOnBrowserLanguages(IEnumerable<String>)
Localization class support localization in system.
Declaration
public static string BestCultureCodeBasedOnBrowserLanguages(IEnumerable<string> cultureCodes)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | cultureCodes |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
ConvertLegacyTimeZoneOffsetToTimeZoneInfo(Int32)
Converts old TimeZoneOffset to new
Declaration
public static TimeZoneInfo ConvertLegacyTimeZoneOffsetToTimeZoneInfo(int timeZoneOffsetInMinutes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | timeZoneOffsetInMinutes | An offset in minutes, e.g. -480 (-8 times 60) for Pacific Time Zone. |
Returns
| Type | Description |
|---|---|
| TimeZoneInfo | TimeZoneInfo is returned if timeZoneOffsetInMinutes is valid, otherwise TimeZoneInfo.Local is returned. |
Remarks
Initial mapping is based on hard-coded rules. These rules are hard-coded from old standard TimeZones.xml data. When offset is not found hard-coded mapping, a lookup is performed in timezones defined in the system. The first found entry is returned. When mapping is not found, a default TimeZoneInfo.Local us returned.
DeleteLanguage(Locale, Boolean)
Localization class support localization in system.
Declaration
public static void DeleteLanguage(Locale language, bool isInstalling)
Parameters
| Type | Name | Description |
|---|---|---|
| Locale | language | |
| System.Boolean | isInstalling |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
DeleteLanguage(Locale)
Localization class support localization in system.
Declaration
public static void DeleteLanguage(Locale language)
Parameters
| Type | Name | Description |
|---|---|---|
| Locale | language |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetBrowserCulture(Int32)
Tries to get a valid language from the browser preferences.
Declaration
public static CultureInfo GetBrowserCulture(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Id of the current portal. |
Returns
| Type | Description |
|---|---|
| CultureInfo | A valid CultureInfo if any is found. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetCultureLanguageID(String)
Maps the culture code string into the corresponding language ID in the database. In case there is no language defined in the system with the passed code, -1 (NullInteger) is returned.
Declaration
public static int GetCultureLanguageID(string cultureCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | cultureCode | The culture to get the language ID for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Language ID integer. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetExceptionMessage(String, String, Object[])
Localization class support localization in system.
Declaration
public static string GetExceptionMessage(string key, string defaultValue, params object[] params)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | |
| System.String | defaultValue | |
| System.Object[] | params |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetExceptionMessage(String, String)
Localization class support localization in system.
Declaration
public static string GetExceptionMessage(string key, string defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | |
| System.String | defaultValue |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetFixedCurrency(Decimal, String, Int32)
Localization class support localization in system.
Declaration
public string GetFixedCurrency(decimal expression, string culture, int numDigitsAfterDecimal)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Decimal | expression | |
| System.String | culture | |
| System.Int32 | numDigitsAfterDecimal |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetFixedDate(DateTime, String)
Localization class support localization in system.
Declaration
public string GetFixedDate(DateTime expression, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | expression | |
| System.String | culture |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetLanguageDisplayMode(Int32)
Localization class support localization in system.
Declaration
public static string GetLanguageDisplayMode(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetLocaleName(String, CultureDropDownTypes)
Localization class support localization in system.
Declaration
public static string GetLocaleName(string code, CultureDropDownTypes displayType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | code | |
| CultureDropDownTypes | displayType |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetPageLocale(IPortalSettings)
Detects the current language for the request. The order in which the language is being detect is:
- QueryString
- Cookie
- User profile (if request is authenticated)
- Browser preference (if portal has this option enabled)
- Portal default
- System default (en-US)
Declaration
public static CultureInfo GetPageLocale(IPortalSettings portalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IPortalSettings | portalSettings | Current PortalSettings. |
Returns
| Type | Description |
|---|---|
| CultureInfo | A valid CultureInfo. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetPageLocale(PortalSettings)
Detects the current language for the request. The order in which the language is being detect is:
- QueryString
- Cookie
- User profile (if request is authenticated)
- Browser preference (if portal has this option enabled)
- Portal default
- System default (en-US)
Declaration
public static CultureInfo GetPageLocale(PortalSettings portalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | Current PortalSettings. |
Returns
| Type | Description |
|---|---|
| CultureInfo | A valid CultureInfo. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetResourceFile(Control, String)
Localization class support localization in system.
Declaration
public static string GetResourceFile(Control control, string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| Control | control | |
| System.String | fileName |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetResourceFileName(String, String, String, Int32)
Localization class support localization in system.
Declaration
public static string GetResourceFileName(string resourceFileName, string language, string mode, int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | resourceFileName | |
| System.String | language | |
| System.String | mode | |
| System.Int32 | portalId |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetSafeJSString(String, String)
this function will escape reserved character fields to their "safe" javascript equivalents.
Declaration
public static string GetSafeJSString(string key, string resourceFileRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | localization key. |
| System.String | resourceFileRoot | file for localization key. |
Returns
| Type | Description |
|---|---|
| System.String | the string that is safe to use in a javascript function. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetSafeJSString(String)
this function will escape reserved character fields to their "safe" javascript equivalents.
Declaration
public static string GetSafeJSString(string unsafeString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | unsafeString | The string to be parsed for unsafe characters. |
Returns
| Type | Description |
|---|---|
| System.String | the string that is safe to use in a javascript function. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, Control)
Localization class support localization in system.
Declaration
public static string GetString(string key, Control ctrl)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | |
| Control | ctrl |
Returns
| Type | Description |
|---|---|
| System.String |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
GetString(String, PortalSettings)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, PortalSettings portalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| PortalSettings | portalSettings | The current portals Portal Settings. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, String, PortalSettings, String, Boolean)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, string resourceFileRoot, PortalSettings portalSettings, string language, bool disableShowMissingKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Local Resource root. |
| PortalSettings | portalSettings | The current portals Portal Settings. |
| System.String | language | A specific language to lookup the string. |
| System.Boolean | disableShowMissingKeys | Disables the show missing keys flag. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, String, PortalSettings, String)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, string resourceFileRoot, PortalSettings portalSettings, string language)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Local Resource root. |
| PortalSettings | portalSettings | The current portals Portal Settings. |
| System.String | language | A specific language to lookup the string. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, String, Boolean)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, string resourceFileRoot, bool disableShowMissingKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Local Resource root. |
| System.Boolean | disableShowMissingKeys | Disable to show missing key. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, String, String)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, string resourceFileRoot, string language)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Local Resource root. |
| System.String | language | A specific language to lookup the string. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String, String)
GetString gets the localized string corresponding to the key.
Declaration
public static string GetString(string key, string resourceFileRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Resource File Name. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetString(String)
GetString gets the localized string corresponding to the resource key.
Declaration
public static string GetString(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
GetStringUrl(String, String)
GetStringUrl gets the localized string corresponding to the key.
Declaration
public static string GetStringUrl(string key, string resourceFileRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The resource key to find. |
| System.String | resourceFileRoot | The Local Resource root. |
Returns
| Type | Description |
|---|---|
| System.String | The localized Text. |
Remarks
This function should be used to retrieve strings to be used on URLs. It is the same as GetString(name,ResourceFileRoot) method but it disables the ShowMissingKey flag, so even in testing scenarios, the correct string is returned.
GetSystemMessage(PortalSettings, String, UserInfo, String, ArrayList)
Gets a SystemMessage passing extra custom parameters to personalize.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName, UserInfo userInfo, string resourceFile, ArrayList custom)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
| ArrayList | custom | An ArrayList with replacements for custom tags. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Custom tags are of the form [Custom:n], where n is the zero based index which
will be used to find the replacement value in Custom parameter.
GetSystemMessage(PortalSettings, String, UserInfo, String)
Gets a SystemMessage.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName, UserInfo userInfo, string resourceFile)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Supported tags:
- All fields from HostSettings table in the form of:
[Host:field] - All properties defined in PortalInfo in the form of:
[Portal:property] [Portal:URL]: The base URL for the portal- All properties defined in UserInfo in the form of:
[User:property] - All values stored in the user profile in the form of:
[Profile:key] [User:VerificationCode]: User verification code for verified registrations[Date:Current]: Current date
GetSystemMessage(PortalSettings, String, UserInfo)
Gets a SystemMessage.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName, UserInfo userInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Supported tags:
- All fields from HostSettings table in the form of:
[Host:field] - All properties defined in PortalInfo in the form of:
[Portal:property] [Portal:URL]: The base URL for the portal- All properties defined in UserInfo in the form of:
[User:property] - All values stored in the user profile in the form of:
[Profile:key] [User:VerificationCode]: User verification code for verified registrations[Date:Current]: Current date
GetSystemMessage(PortalSettings, String, String, ArrayList)
Gets a SystemMessage passing extra custom parameters to personalize.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName, string resourceFile, ArrayList custom)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
| ArrayList | custom | An ArrayList with replacements for custom tags. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Custom tags are of the form [Custom:n], where n is the zero based index which
will be used to find the replacement value in Custom parameter.
GetSystemMessage(PortalSettings, String, String)
Gets a SystemMessage.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName, string resourceFile)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Supported tags:
- All fields from HostSettings table in the form of:
[Host:field] - All properties defined in PortalInfo in the form of:
[Portal:property] [Portal:URL]: The base URL for the portal- All properties defined in UserInfo in the form of:
[User:property] - All values stored in the user profile in the form of:
[Profile:key] [User:VerificationCode]: User verification code for verified registrations[Date:Current]: Current date
GetSystemMessage(PortalSettings, String)
Gets a SystemMessage.
Declaration
public static string GetSystemMessage(PortalSettings portalSettings, string messageName)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Supported tags:
- All fields from HostSettings table in the form of:
[Host:field] - All properties defined in PortalInfo in the form of:
[Portal:property] [Portal:URL]: The base URL for the portal- All properties defined in UserInfo in the form of:
[User:property] - All values stored in the user profile in the form of:
[Profile:key] [User:VerificationCode]: User verification code for verified registrations[Date:Current]: Current date
GetSystemMessage(String, PortalSettings, String, UserInfo, String, ArrayList, IDictionary, String, Int32)
Gets a SystemMessage passing extra custom parameters to personalize.
Declaration
public static string GetSystemMessage(string strLanguage, PortalSettings portalSettings, string messageName, UserInfo userInfo, string resourceFile, ArrayList customArray, IDictionary customDictionary, string customCaption, int accessingUserID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strLanguage | A specific language to get the SystemMessage for. |
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
| ArrayList | customArray | An ArrayList with replacements for custom tags. |
| IDictionary | customDictionary | An IDictionary with replacements for custom tags. |
| System.String | customCaption | prefix for custom tags. |
| System.Int32 | accessingUserID | UserID of the user accessing the system message. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Custom tags are of the form [Custom:n], where n is the zero based index which
will be used to find the replacement value in Custom parameter.
GetSystemMessage(String, PortalSettings, String, UserInfo, String, ArrayList, String, Int32)
Gets a SystemMessage passing extra custom parameters to personalize.
Declaration
public static string GetSystemMessage(string strLanguage, PortalSettings portalSettings, string messageName, UserInfo userInfo, string resourceFile, ArrayList custom, string customCaption, int accessingUserID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strLanguage | A specific language to get the SystemMessage for. |
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
| ArrayList | custom | An ArrayList with replacements for custom tags. |
| System.String | customCaption | prefix for custom tags. |
| System.Int32 | accessingUserID | UserID of the user accessing the system message. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Custom tags are of the form [Custom:n], where n is the zero based index which
will be used to find the replacement value in Custom parameter.
GetSystemMessage(String, PortalSettings, String, UserInfo, String, ArrayList)
Gets a SystemMessage passing extra custom parameters to personalize.
Declaration
public static string GetSystemMessage(string strLanguage, PortalSettings portalSettings, string messageName, UserInfo userInfo, string resourceFile, ArrayList custom)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strLanguage | A specific language to get the SystemMessage for. |
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
| ArrayList | custom | An ArrayList with replacements for custom tags. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Custom tags are of the form [Custom:n], where n is the zero based index which
will be used to find the replacement value in Custom parameter.
GetSystemMessage(String, PortalSettings, String, UserInfo)
Gets a SystemMessage.
Declaration
public static string GetSystemMessage(string strLanguage, PortalSettings portalSettings, string messageName, UserInfo userInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strLanguage | A specific language to get the SystemMessage for. |
| PortalSettings | portalSettings | The portal settings for the portal to which the message will affect. |
| System.String | messageName | The message tag which identifies the SystemMessage. |
| UserInfo | userInfo | Reference to the user used to personalize the message. |
Returns
| Type | Description |
|---|---|
| System.String | The message body with all tags replaced. |
Remarks
Supported tags:
- All fields from HostSettings table in the form of:
[Host:field] - All properties defined in PortalInfo in the form of:
[Portal:property] [Portal:URL]: The base URL for the portal- All properties defined in UserInfo in the form of:
[User:property] - All values stored in the user profile in the form of:
[Profile:key] [User:VerificationCode]: User verification code for verified registrations[Date:Current]: Current date
LoadCultureDropDownList(DropDownList, CultureDropDownTypes, String, Boolean)
LoadCultureDropDownList loads a DropDownList with the list of supported cultures based on the languages defined in the supported locales file.
This overload allows us to display all installed languages. To do so, pass the value True to the loadHost parameter.
Declaration
public static void LoadCultureDropDownList(DropDownList list, CultureDropDownTypes displayType, string selectedValue, bool loadHost)
Parameters
| Type | Name | Description |
|---|---|---|
| DropDownList | list | DropDownList to load. |
| CultureDropDownTypes | displayType | Format of the culture to display. Must be one the CultureDropDownTypes values. CultureDropDownTypes for list of allowable values. |
| System.String | selectedValue | Name of the default culture to select. |
| System.Boolean | loadHost | Boolean that defines whether or not to load host (i.e. all available) locales. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LoadCultureDropDownList(DropDownList, CultureDropDownTypes, String, String, Boolean)
LoadCultureDropDownList loads a DropDownList with the list of supported cultures based on the languages defined in the supported locales file.
This overload allows us to filter a language from the dropdown. To do so pass a language code to the Filter parameter.
This overload allows us to display all installed languages. To do so, pass the value True to the Host parameter.
Declaration
public static void LoadCultureDropDownList(DropDownList list, CultureDropDownTypes displayType, string selectedValue, string filter, bool host)
Parameters
| Type | Name | Description |
|---|---|---|
| DropDownList | list | DropDownList to load. |
| CultureDropDownTypes | displayType | Format of the culture to display. Must be one the CultureDropDownTypes values. CultureDropDownTypes for list of allowable values. |
| System.String | selectedValue | Name of the default culture to select. |
| System.String | filter | String value that allows for filtering out a specific language. |
| System.Boolean | host | Boolean that defines whether or not to load host (ie. all available) locales. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LoadCultureDropDownList(DropDownList, CultureDropDownTypes, String)
LoadCultureDropDownList loads a DropDownList with the list of supported cultures based on the languages defined in the supported locales file, for the current portal.
Declaration
public static void LoadCultureDropDownList(DropDownList list, CultureDropDownTypes displayType, string selectedValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DropDownList | list | DropDownList to load. |
| CultureDropDownTypes | displayType | Format of the culture to display. Must be one the CultureDropDownTypes values. CultureDropDownTypes for list of allowable values. |
| System.String | selectedValue | Name of the default culture to select. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LoadCultureInListItems(CultureDropDownTypes, String, String, Boolean)
LoadCultureDropDownList loads a DropDownList with the list of supported cultures based on the languages defined in the supported locales file.
This overload allows us to filter a language from the dropdown. To do so pass a language code to the Filter parameter.
This overload allows us to display all installed languages. To do so, pass the value True to the Host parameter.
Declaration
public static IEnumerable<ListItem> LoadCultureInListItems(CultureDropDownTypes displayType, string selectedValue, string filter, bool host)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureDropDownTypes | displayType | |
| System.String | selectedValue | |
| System.String | filter | |
| System.Boolean | host |
Returns
| Type | Description |
|---|---|
| IEnumerable<ListItem> | A sequence of new |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LocalizeControlTitle(IModuleControl)
Localizes ModuleControl Titles.
Declaration
public static string LocalizeControlTitle(IModuleControl moduleControl)
Parameters
| Type | Name | Description |
|---|---|---|
| IModuleControl | moduleControl | ModuleControl. |
Returns
| Type | Description |
|---|---|
| System.String | Localized control title if found. |
Remarks
Resource keys are: ControlTitle_[key].Text
Key MUST be lowercase in the resource file
Key can also be "blank" for admin/edit controls. These will only be used in admin pages.
LocalizeDataGrid(ref DataGrid, String)
LocalizeDataGrid creates localized Headers for a DataGrid.
Declaration
public static void LocalizeDataGrid(ref DataGrid grid, string resourceFile)
Parameters
| Type | Name | Description |
|---|---|---|
| DataGrid | grid | Grid to localize. |
| System.String | resourceFile | The root name of the Resource File where the localized text can be found. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LocalizeDetailsView(ref DetailsView, String)
Localizes headers and fields on a DetailsView control.
Declaration
public static void LocalizeDetailsView(ref DetailsView detailsView, string resourceFile)
Parameters
| Type | Name | Description |
|---|---|---|
| DetailsView | detailsView | |
| System.String | resourceFile | The root name of the resource file where the localized texts can be found. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LocalizeGridView(ref GridView, String)
Localizes headers and fields on a GridView control.
Declaration
public static void LocalizeGridView(ref GridView gridView, string resourceFile)
Parameters
| Type | Name | Description |
|---|---|---|
| GridView | gridView | Grid to localize. |
| System.String | resourceFile | The root name of the resource file where the localized texts can be found. |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
LocalizeRole(String)
Localizes the "Built In" Roles.
Declaration
public static string LocalizeRole(string role)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | role |
Returns
| Type | Description |
|---|---|
| System.String | The role name, potentially localized. |
Remarks
Localizes: -DesktopTabs -BreadCrumbs.
RemoveLanguageFromPortal(Int32, Int32, Boolean)
Localization class support localization in system.
Declaration
public static void RemoveLanguageFromPortal(int portalID, int languageID, bool isInstalling)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID | |
| System.Int32 | languageID | |
| System.Boolean | isInstalling |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
RemoveLanguageFromPortal(Int32, Int32)
Localization class support localization in system.
Declaration
public static void RemoveLanguageFromPortal(int portalID, int languageID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalID | |
| System.Int32 | languageID |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
RemoveLanguageFromPortals(Int32, Boolean)
Localization class support localization in system.
Declaration
public static void RemoveLanguageFromPortals(int languageId, bool isInstalling)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | languageId | |
| System.Boolean | isInstalling |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
RemoveLanguageFromPortals(Int32)
Localization class support localization in system.
Declaration
public static void RemoveLanguageFromPortals(int languageId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | languageId |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
RemoveLanguagesFromPortal(Int32)
Localization class support localization in system.
Declaration
public static void RemoveLanguagesFromPortal(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SaveLanguage(Locale, Boolean)
Localization class support localization in system.
Declaration
public static void SaveLanguage(Locale locale, bool clearCache)
Parameters
| Type | Name | Description |
|---|---|---|
| Locale | locale | |
| System.Boolean | clearCache |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SaveLanguage(Locale)
Localization class support localization in system.
Declaration
public static void SaveLanguage(Locale locale)
Parameters
| Type | Name | Description |
|---|---|---|
| Locale | locale |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SetLanguage(String)
Localization class support localization in system.
Declaration
public static void SetLanguage(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
Remarks
As DNN is used in more and more countries it is very important to provide modules with good support for international users. Otherwise we are limiting our potential user base to that using English as their base language.
You can store the multi language content in resource files and use the api below to get localization content.
Resources files named as: Control(Page)Name + Extension (.aspx/.ascx ) + Language + ".resx"
e.g: Installwizard.aspx.de-DE.resx.
Examples
pageCreationProgressArea.Localization.Total = Localization.GetString("TotalLanguages", LocalResourceFile);
pageCreationProgressArea.Localization.TotalFiles = Localization.GetString("TotalPages", LocalResourceFile);
pageCreationProgressArea.Localization.Uploaded = Localization.GetString("TotalProgress", LocalResourceFile);
pageCreationProgressArea.Localization.UploadedFiles = Localization.GetString("Progress", LocalResourceFile);
pageCreationProgressArea.Localization.CurrentFileName = Localization.GetString("Processing", LocalResourceFile);
|
Improve this Doc
View Source
SetThreadCultures(CultureInfo, IPortalSettings)
Sets the culture codes on the current Thread.
Declaration
public static void SetThreadCultures(CultureInfo cultureInfo, IPortalSettings portalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | cultureInfo | Culture Info for the current page. |
| IPortalSettings | portalSettings | The current portal settings. |
Remarks
This method will configure the Thread culture codes. Any page which does not derive from
SetThreadCultures(CultureInfo, PortalSettings)
Sets the culture codes on the current Thread.
Declaration
public static void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | cultureInfo | Culture Info for the current page. |
| PortalSettings | portalSettings | The current portal settings. |
Remarks
This method will configure the Thread culture codes. Any page which does not derive from