I18N.DotNet v1.3.1
Loading...
Searching...
No Matches
Static Public Member Functions | Properties | List of all members
GlobalLocalizer Class Reference

Utility class for convenient access to localization functions. More...

Static Public Member Functions

static string Localize (PlainString text)
 Localizes a string using the global localizer. More...
 
static string Localize (FormattableString frmtText)
 Localizes an interpolated string using the global localizer. More...
 
static IEnumerable< string > Localize (IEnumerable< string > texts)
 Localizes multiple strings using the global localizer. More...
 
static string LocalizeFormat (string format, params object[] args)
 Localizes and then formats a string using the global localizer. More...
 
static ILocalizer Context (string contextId)
 Gets a context in the global localizer. More...
 
static ILocalizer Context (IEnumerable< string > splitContextIds)
 Gets a context in the global localizer. More...
 

Properties

static AutoLoadLocalizer Localizer = new AutoLoadLocalizer() [get]
 Global localizer. More...
 

Detailed Description

Utility class for convenient access to localization functions.

Member Function Documentation

◆ Context() [1/2]

static ILocalizer Context ( IEnumerable< string >  splitContextIds)
static

Gets a context in the global localizer.

See also
ILocalizer.Context(IEnumerable<string>)
Parameters
splitContextIdsChain of context identifiers in split form.
Returns
Localizer for the given context.

◆ Context() [2/2]

static ILocalizer Context ( string  contextId)
static

Gets a context in the global localizer.

See also
ILocalizer.Context(string)
Parameters
contextIdIdentifier of the context.
Returns
Localizer for the given context.

◆ Localize() [1/3]

static string Localize ( FormattableString  frmtText)
static

Localizes an interpolated string using the global localizer.

See also
ILocalizer.Localize(FormattableString)
Parameters
frmtTextBase-language formattable string.
Returns
Formatted string generated from the language-specific localized format string if found, or generated from frmtText otherwise.

◆ Localize() [2/3]

static IEnumerable< string > Localize ( IEnumerable< string >  texts)
static

Localizes multiple strings using the global localizer.

See also
ILocalizer.Localize(IEnumerable<string>)
Parameters
textsBase-language strings.
Returns
Language-specific localized strings if found, or the base-language string otherwise.

◆ Localize() [3/3]

static string Localize ( PlainString  text)
static

Localizes a string using the global localizer.

See also
ILocalizer.Localize(PlainString)
Parameters
textBase-language string.
Returns
Language-specific localized string if found, or text otherwise.

◆ LocalizeFormat()

static string LocalizeFormat ( string  format,
params object[]  args 
)
static

Localizes and then formats a string using the global localizer.

See also
ILocalizer.LocalizeFormat(string, object[])
Parameters
formatBase-language format string.
argsArguments for the format string.
Returns
Formatted string generated from the language-specific localized format string if found, or generated from format otherwise.

Property Documentation

◆ Localizer

Global localizer.