Internal
_fallbackFallback translations if the target keys are not found
The package authorized to provide default language configurations
The target language for localization
The translation dictionary for the target language
Localize a string including variable formatting for input arguments. Provide a string ID which defines the localized template. Variables can be included in the template enclosed in braces and will be substituted using those named keys.
The string ID to translate
Provided input data
The translated and formatted string
Retrieve list formatter configured to the world's language setting.
Optional
options: { style?: ListFormatStyle; type?: ListFormatType } = {}Optional
style?: ListFormatStyleThe list formatter style, either "long", "short", or "narrow".
Optional
type?: ListFormatTypeThe list formatter type, either "conjunction", "disjunction", or "unit".
Return whether a certain string has a known translation defined.
The string key being translated
Optional
fallback: boolean = trueAllow fallback translations to count?
Initialize the Localization module Discover available language translations and apply the current language setting
A Promise which resolves once languages are initialized
Localize a string by drawing a translation from the available translations dictionary, if available If a translation is not available, the original string is returned
The string ID to translate
The translated string
Set a language as the active translation source for the session
A language string in CONFIG.supportedLanguages
A Promise which resolves once the translations for the requested language are ready
Sort an array of objects by a given key in a localization-aware manner.
The objects to sort, this array will be mutated.
The key to sort the objects by. This can be provided in dot-notation.
Static
localizePerform one-time localization of the fields in a DataModel schema, translating their label and hint properties.
The DataModel class to localize
Options which configure how localization is performed
Optional
prefixes?: string[]An array of localization key prefixes to use. If not specified, prefixes are learned from the DataModel.LOCALIZATION_PREFIXES static property.
Optional
prefixPath?: stringA localization path prefix used to prefix all field names within this model. This is generally not required.
DataModel.LOCALIZATION_PREFIXES for an example of the class definition and localization file structure.
Static
localizeLocalize the "label" and "hint" properties for all fields in a data schema.
Optional
options: { prefixPath?: string; seenFields?: Set<DataField> } = {}
A helper class which assists with localization and string translation
Param: serverLanguage
The default language configuration setting for the server