@itwin/core-common
Version:
iTwin.js components common to frontend and backend
33 lines • 1.43 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Localization
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmptyLocalization = void 0;
/** An empty [[Localization]] used if one is not provided to [IModelApp]($frontend). Does not perform localizations (merely returns the key.)
* @public
*/
class EmptyLocalization {
async initialize() { }
getLocalizedString(key) {
if (typeof (key) !== "string") {
key = key[0];
}
// Simulate correct and simple usage of i18next's translation function
// Namely, remove the leading namespace substring if there is one
return key.split(":", 2).pop();
}
getEnglishString(_namespace, key) { return this.getLocalizedString(key); }
getLocalizedKeys(inputString) { return inputString; }
async registerNamespace() { }
unregisterNamespace() { }
getNamespacePromise() { return undefined; }
getLanguageList() { return []; }
async changeLanguage() { }
}
exports.EmptyLocalization = EmptyLocalization;
//# sourceMappingURL=Localization.js.map