|
void | LoadXML (string filepath, CultureInfo? culture=null) |
| Loads translations for the given culture from a localization configuration file in XML format. More...
|
|
void | LoadXML (string filepath, string language) |
| Loads translations for the given language from a localization configuration file in XML format. More...
|
|
void | LoadXML (string filepath, bool merge) |
| Loads translations for the current localizer language from a localization configuration file in XML format. More...
|
|
void | LoadXML (Stream stream, CultureInfo? culture=null) |
| Loads translations for the given culture from a localization configuration file in XML format obtained from a stream. More...
|
|
void | LoadXML (Stream stream, string language) |
| Loads translations for the given language from a localization configuration file obtained in XML format from a stream. More...
|
|
void | LoadXML (Stream stream, bool merge) |
| Loads translations for the current localizer language from a localization configuration file in XML format obtained from a stream. More...
|
|
void | LoadXML (XDocument doc, CultureInfo? culture=null) |
| Loads translations for the given culture from a localization configuration in an XML document. More...
|
|
void | LoadXML (XDocument doc, string language) |
| Loads translations for the given language from a localization configuration in an XML document. More...
|
|
void | LoadXML (XDocument doc, bool merge) |
| Loads translations for the current localizer language from a localization configuration in an XML document. More...
|
|
void | LoadXML (Assembly assembly, string resourceName, CultureInfo? culture=null) |
| Loads translations for the given culture from a localization configuration file in XML format obtained from an embedded resource in the given assembly. More...
|
|
void | LoadXML (Assembly assembly, string resourceName, string language) |
| Loads translations for the given language from a localization configuration file in XML format obtained from an embedded resource in the given assembly. More...
|
|
void | LoadXML (Assembly assembly, string resourceName, bool merge) |
| Loads translations for the current localizer language from a localization configuration file in XML format obtained from an embedded resource in the given assembly. More...
|
|
string | Localize (PlainString text) |
| Localizes a string. More...
|
|
string | Localize (FormattableString frmtText) |
| Localizes an interpolated string. More...
|
|
IEnumerable< string > | Localize (IEnumerable< string > texts) |
| Localizes multiple strings. More...
|
|
string | LocalizeFormat (string format, params object[] args) |
| Localizes and then formats a string. 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...
|
|
Localizer which translations can be loaded from different sources.
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).
- Parameters
-
contextId | Identifier of the context. |
- Returns
- Localizer for the given context.
Implemented in AutoLoadLocalizer, and ContextLocalizer.
void LoadXML |
( |
Assembly |
assembly, |
|
|
string |
resourceName, |
|
|
string |
language |
|
) |
| |
Loads translations for the given language from a localization configuration file in XML format obtained from an embedded resource in the given assembly.
All the translations loaded previously in the localizer are discarded and replaced with the new ones.
If the system does not support a culture for language , then CultureInfo.InvariantCulture will be used as the culture for formatting operations.
- Parameters
-
assembly | Assembly that contains the embedded XML file. |
resourceName | Name of the embedded resource for the XML file. |
language | Name, code or identifier for the target language of translations. |
- Exceptions
-
ParseException | Thrown when the embedded resource contents cannot be parsed properly. |
InvalidOperationException | Thrown when the embedded resource could not be found in the given assembly. |
Implemented in AutoLoadLocalizer, and Localizer.
void LoadXML |
( |
Stream |
stream, |
|
|
string |
language |
|
) |
| |
Loads translations for the given language from a localization configuration file obtained in XML format from a stream.
All the translations loaded previously in the localizer are discarded and replaced with the new ones.
If the system does not support a culture for language , then CultureInfo.InvariantCulture will be used as the culture for formatting operations.
- Parameters
-
stream | Stream with the localization configuration. |
language | Name, code or identifier for the target language of translations. |
- Exceptions
-
ParseException | Thrown when the stream contents cannot be parsed properly. |
Implemented in AutoLoadLocalizer, and Localizer.
void LoadXML |
( |
string |
filepath, |
|
|
string |
language |
|
) |
| |
Loads translations for the given language from a localization configuration file in XML format.
All the translations loaded previously in the localizer are discarded and replaced with the new ones.
If the system does not support a culture for language , then CultureInfo.InvariantCulture will be used as the culture for formatting operations.
- Parameters
-
filepath | Path to the localization configuration file. |
language | Name, code or identifier for the target language of translations. |
- Exceptions
-
Implemented in AutoLoadLocalizer, and Localizer.
void LoadXML |
( |
XDocument |
doc, |
|
|
string |
language |
|
) |
| |
Loads translations for the given language from a localization configuration in an XML document.
All the translations loaded previously in the localizer are discarded and replaced with the new ones.
If the system does not support a culture for language , then CultureInfo.InvariantCulture will be used as the culture for formatting operations.
- Parameters
-
doc | XML document with the localization configuration. |
language | Name, code or identifier for the target language of translations. |
- Exceptions
-
ParseException | Thrown when the input document cannot be parsed properly. |
Implemented in AutoLoadLocalizer, and Localizer.
string Localize |
( |
FormattableString |
frmtText | ) |
|
|
inherited |
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.
- Parameters
-
frmtText | Base-language formattable string. |
- Returns
- Formatted string generated from the language-specific localized format string if found, or generated from frmtText otherwise.
- Exceptions
-
FormatException | Thrown when the localized format value of frmtText is invalid. |
Implemented in AutoLoadLocalizer, and ContextLocalizer.