Class Localizer
Facilitates tasks working with objects of appropriate culture per user
Inheritance
System.Object
Localizer
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.Sky.WebManager.dll
Syntax
public sealed class Localizer : ApplicationComponent, IDisposable, IApplicationComponent
Constructors
Localizer(IApplication)
Declaration
public Localizer(IApplication app)
Parameters
Fields
CONFIG_LOCALIZATION_SECTION
Declaration
public const string CONFIG_LOCALIZATION_SECTION = "localization"
Field Value
Type |
Description |
System.String |
|
CONFIG_MSG_FILE_ATTR
Declaration
public const string CONFIG_MSG_FILE_ATTR = "msg-file"
Field Value
Type |
Description |
System.String |
|
ISO_LANG_ENGLISH
Declaration
public const string ISO_LANG_ENGLISH = "eng"
Field Value
Type |
Description |
System.String |
|
ISO_LANG_FRENCH
Declaration
public const string ISO_LANG_FRENCH = "fre"
Field Value
Type |
Description |
System.String |
|
ISO_LANG_GERMAN
Declaration
public const string ISO_LANG_GERMAN = "deu"
Field Value
Type |
Description |
System.String |
|
ISO_LANG_RUSSIAN
Declaration
public const string ISO_LANG_RUSSIAN = "rus"
Field Value
Type |
Description |
System.String |
|
LOC_ANY_FIELD_KEY
Declaration
public const string LOC_ANY_FIELD_KEY = "--ANY-FIELD--"
Field Value
Type |
Description |
System.String |
|
LOC_ANY_SCHEMA_KEY
Declaration
public const string LOC_ANY_SCHEMA_KEY = "--ANY-SCHEMA--"
Field Value
Type |
Description |
System.String |
|
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Methods
Content(String, WorkContext)
Declaration
public string Content(string key, WorkContext work = null)
Parameters
Type |
Name |
Description |
System.String |
key |
|
WorkContext |
work |
|
Returns
Type |
Description |
System.String |
|
CountryISOCodeToLanguageISOCode(String)
Converts country code into language code
Declaration
public string CountryISOCodeToLanguageISOCode(string countryISOCode)
Parameters
Type |
Name |
Description |
System.String |
countryISOCode |
|
Returns
Type |
Description |
System.String |
|
Declaration
public string DateTime(DateTime dt, Localizer.DateTimeFormat format = Localizer.DateTimeFormat.LongDateTime, WebManagerSession session = null)
Parameters
Returns
Type |
Description |
System.String |
|
GetLanguage(WorkContext)
Tries to determine work context lang and returns it or ENG
Declaration
public string GetLanguage(WorkContext work = null)
Parameters
Returns
Type |
Description |
System.String |
|
MakePage<TPage>(Object[])
Makes localized page instance per session
Declaration
public WebManagerPage MakePage<TPage>(params object[] ctorArgs)
where TPage : WebManagerPage
Parameters
Type |
Name |
Description |
System.Object[] |
ctorArgs |
|
Returns
Type Parameters
MakePage<TPage>(Type, WorkContext, Object[])
Makes localized page instance per session
Declaration
public WebManagerPage MakePage<TPage>(Type type, WorkContext work, object[] ctorArgs)
where TPage : WebManagerPage
Parameters
Type |
Name |
Description |
System.Type |
type |
|
WorkContext |
work |
|
System.Object[] |
ctorArgs |
|
Returns
Type Parameters
Declaration
public string Money(decimal amount, Localizer.MoneyFormat format = Localizer.MoneyFormat.WithCurrencySymbol, WebManagerSession session = null)
Parameters
Returns
Type |
Description |
System.String |
|
Of(IApplication)
Declaration
public static Localizer Of(IApplication app)
Parameters
Returns
Implements
System.IDisposable
Extension Methods