I18N.DotNet v1.3.1
|
Converter of strings from a base-language value to its corresponding language-specific localization. More...
Public Member Functions | |
string | Localize (PlainString text) |
Localizes a string. More... | |
string | Localize (FormattableString frmtText) |
Localizes an interpolated string. More... | |
string | LocalizeFormat (string format, params object[] args) |
Localizes and then formats a string. More... | |
IEnumerable< string > | Localize (IEnumerable< string > texts) |
Localizes multiple strings. More... | |
ILocalizer | Context (string contextId) |
Gets the localizer for a context in the current localizer. More... | |
ILocalizer | Context (IEnumerable< string > splitContextIds) |
Gets the localizer for a context in the current localizer. More... | |
Properties | |
string | TargetLanguage [get] |
Target language of the localizer. More... | |
CultureInfo | TargetCulture [get] |
Target culture of the localizer. More... | |
Converter of strings from a base-language value to its corresponding language-specific localization.
ILocalizer Context | ( | IEnumerable< string > | splitContextIds | ) |
Gets the localizer for a context in the current localizer.
Contexts are used to disambiguate the conversion of the same base-language string to different language-specific strings depending on the context where the conversion is performed.
splitContextIds | Chain of context identifiers in split form. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.
ILocalizer Context | ( | string | contextId | ) |
Gets the localizer for a context in the current localizer.
Contexts are used to disambiguate the conversion of the same base-language string to different language-specific strings depending on the context where the conversion is performed.
Contexts can be nested. The context identifier can identify a chain of nested contexts by separating their identifiers with the '.' character (left = outermost / right = innermost).
contextId | Identifier of the context. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.
string Localize | ( | FormattableString | frmtText | ) |
Localizes an interpolated string.
Converts the composite format string of the base-language formattable string frmtText (e.g. an interpolated string) to its corresponding language-specific localized composite format value, and then generates the result by formatting the localized composite format value along with the frmtText arguments by using the formatting conventions of the localizer culture.
frmtText | Base-language formattable string. |
FormatException | Thrown when the localized format value of frmtText is invalid. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.
IEnumerable< string > Localize | ( | IEnumerable< string > | texts | ) |
Localizes multiple strings.
Converts the base-language strings in texts to their corresponding language-specific localized values.
texts | Base-language strings. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.
string Localize | ( | PlainString | text | ) |
Localizes a string.
Converts the base-language string text to its corresponding language-specific localized value.
text | Base-language string. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.
string LocalizeFormat | ( | string | format, |
params object[] | args | ||
) |
Localizes and then formats a string.
Converts the base-language format string format to its corresponding language-specific localized format value, and then generates the result by formatting the localized format value along with the args arguments by using the formatting conventions of the localizer culture.
format | Base-language format string. |
args | Arguments for the format string. |
FormatException | Thrown when format or its localized format value is invalid. |
Implemented in AutoLoadLocalizer.
|
get |
Target culture of the localizer.
Implemented in AutoLoadLocalizer, and ContextLocalizer.
|
get |
Target language of the localizer.
Implemented in AutoLoadLocalizer, and ContextLocalizer.