Localization Interface

The interface defining the localization requirements of IModelApp.

Implemented by

Methods

Name Description
changeLanguage(language: string): Promise<void> Change the language for translations.  
getEnglishString(namespace: string, key: string | string[], options?: TranslationOptions): string get the English string for a key.  
getLanguageList(): undefined Get the list of available languages for translations  
getLocalizedKeys(inputString: string): string Replace all instances of %{key} within a string with the translations of those keys.  
getLocalizedString(key: string | string[], options?: TranslationOptions): string Return the translated value of a key.  
getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TranslationOptions): string Similar to getLocalizedString but the namespace is a separate param and the key does not include the namespace. Deprecated  
initialize(namespaces: string[]): Promise<void> This method must be called and awaited before using an instance of Localization.  
registerNamespace(namespace: string): Promise<void> Register a new Namespace and return a Promise that is fulfilled when the content is loaded.  
unregisterNamespace(namespace: string): void Unregister a namespace.  

Defined in

Last Updated: 18 April, 2024