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

Interface ILocalization

Namespace: DotNetNuke.Services.Localization.Internal
Assembly: DotNetNuke.dll
Syntax
public interface ILocalization

Methods

| Improve this Doc View Source

BestCultureCodeBasedOnBrowserLanguages(IEnumerable<String>, String)

Inspect the browser supplied language headers and find the best match from the supplied list.

Declaration
string BestCultureCodeBasedOnBrowserLanguages(IEnumerable<string> cultureCodes, string fallback)
Parameters
Type Name Description
IEnumerable<System.String> cultureCodes

The codes to search for a match.

System.String fallback

The code to return if no good match is found.

Returns
Type Description
System.String

Best matching culture code, or fallback if no good match found.

| Improve this Doc View Source

BestCultureCodeBasedOnBrowserLanguages(IEnumerable<String>)

Inspect the browser supplied language headers and find the best match from the supplied list.

Declaration
string BestCultureCodeBasedOnBrowserLanguages(IEnumerable<string> cultureCodes)
Parameters
Type Name Description
IEnumerable<System.String> cultureCodes

The codes to search for a match.

Returns
Type Description
System.String

Best matching culture code, or SystemLocale if no good match found.

| Improve this Doc View Source

GetPageLocale(PortalSettings)

Detects the current language for the request. The order in which the language is being detect is: 1. QueryString 2. Cookie 3. User profile (if request is authenticated) 4. Browser preference (if portal has this option enabled) 5. Portal default 6. System default (en-US) At any point, if a valid language is detected nothing else should be done.

Declaration
CultureInfo GetPageLocale(PortalSettings portalSettings)
Parameters
Type Name Description
PortalSettings portalSettings

Current PortalSettings.

Returns
Type Description
CultureInfo

A valid CultureInfo.

| Improve this Doc View Source

SetThreadCultures(CultureInfo, PortalSettings)

Sets the culture codes on the current Thread.

Declaration
void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings)
Parameters
Type Name Description
CultureInfo cultureInfo

Culture Info for the current page.

PortalSettings portalSettings

The current portalSettings.

Remarks

This method will configure the Thread culture codes. Any page which does not derive from PageBase should be sure to call this method in OnInit to ensure localiztion works correctly. See the TelerikDialogHandler for an example.

Extension Methods

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