mirror of https://github.com/vector-im/riot-web
Notify electron of language changes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
2bd32050fc
commit
9bcea0aeca
|
@ -162,4 +162,6 @@ export default class BasePlatform {
|
|||
getEventIndexingManager(): BaseEventIndexManager | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
async setLanguage(preferredLangs: string[]): Promise<void> {}
|
||||
}
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue