diff --git a/src/BasePlatform.js b/src/BasePlatform.js index 14e34a1f40..295f99f6b4 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -162,4 +162,6 @@ export default class BasePlatform { getEventIndexingManager(): BaseEventIndexManager | null { return null; } + + async setLanguage(preferredLangs: string[]): Promise {} } diff --git a/src/languageHandler.js b/src/languageHandler.js index ddb7e2718c..79a172015a 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -21,6 +21,7 @@ import request from 'browser-request'; import counterpart from 'counterpart'; import React from 'react'; import SettingsStore, {SettingLevel} from "./settings/SettingsStore"; +import PlatformPeg from "./PlatformPeg"; // $webapp is a webpack resolve alias pointing to the output directory, see webpack config import webpackLangJsonUrl from "$webapp/i18n/languages.json"; @@ -285,6 +286,11 @@ export function setLanguage(preferredLangs) { preferredLangs = [preferredLangs]; } + const plaf = PlatformPeg.get(); + if (plaf) { + plaf.setLanguage(preferredLangs); + } + let langToUse; let availLangs; return getLangsJson().then((result) => {