diff --git a/framework/core/js/src/common/Translator.tsx b/framework/core/js/src/common/Translator.tsx index 3f211bf63..3ac1896de 100644 --- a/framework/core/js/src/common/Translator.tsx +++ b/framework/core/js/src/common/Translator.tsx @@ -18,10 +18,20 @@ export default class Translator { */ protected formatter = new RichMessageFormatter(null, this.formatterTypeHandlers(), mithrilRichHandler); + /** + * Sets the formatter's locale to the provided value. + */ setLocale(locale: string) { this.formatter.locale = locale; } + /** + * Returns the formatter's current locale. + */ + getLocale() { + return this.formatter.locale; + } + addTranslations(translations: Translations) { Object.assign(this.translations, translations); }