Localizer that can provide translations and can store nested contexts.
More...
|
string | Localize (PlainString text) |
| Localizes a string. Converts the base-language string text to its corresponding language-specific localized value. More...
|
|
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. More...
|
|
string | LocalizeFormat (string format, params object?[] args) |
|
IEnumerable< string > | Localize (IEnumerable< string > texts) |
| Localizes multiple strings. Converts the base-language strings in texts to their corresponding language-specific localized values. More...
|
|
ContextLocalizer | 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. More...
|
|
ContextLocalizer | 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. More...
|
|
string | LocalizeFormat (string format, params object[] args) |
| Localizes and then formats a string. More...
|
|
Localizer that can provide translations and can store nested contexts.
◆ ContextLocalizer()
◆ Clear()
◆ Context() [1/2]
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.
Implements ILocalizer.
◆ Context() [2/2]
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.
Implements ILocalizer.
◆ Load()
void Load |
( |
XElement |
element | ) |
|
|
protected |
◆ Localize() [1/3]
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.
Implements ILocalizer.
◆ Localize() [2/3]
IEnumerable< string > Localize |
( |
IEnumerable< string > |
texts | ) |
|
Localizes multiple strings. Converts the base-language strings in texts to their corresponding language-specific localized values.
Implements ILocalizer.
◆ Localize() [3/3]
Localizes a string. Converts the base-language string text to its corresponding language-specific localized value.
Implements ILocalizer.
◆ LocalizeFormat() [1/2]
string LocalizeFormat |
( |
string |
format, |
|
|
params object?[] |
args |
|
) |
| |
◆ LocalizeFormat() [2/2]
string LocalizeFormat |
( |
string |
format, |
|
|
params object[] |
args |
|
) |
| |
|
inherited |
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.
- Parameters
-
format | Base-language format string. |
args | Arguments for the format string. |
- Returns
- Formatted string generated from the language-specific localized format string if found, or generated from format otherwise.
- Exceptions
-
FormatException | Thrown when format or its localized format value is invalid. |
Implemented in AutoLoadLocalizer.
◆ Language
◆ TargetCulture
CultureInfo TargetCulture |
|
get |
Target culture of the localizer.
Implements ILocalizer.
◆ TargetLanguage
Target language of the localizer.
Implements ILocalizer.