mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Notify electron of language changes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
2bd32050fc
commit
9bcea0aeca
2 changed files with 8 additions and 0 deletions
|
@ -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 a new issue