Broadcast language change to ElectroPlatform

pull/21833/head
Germain Souquet 2021-04-23 17:11:45 +01:00
parent 65d55bd0d9
commit 8f1ea84eb6
2 changed files with 8 additions and 2 deletions

View File

@ -258,7 +258,9 @@ export default abstract class BasePlatform {
return null;
}
setLanguage(preferredLangs: string[]) {}
async setLanguage(language: string) {
throw new Error("Unimplemented");
}
setSpellCheckLanguages(preferredLangs: string[]) {}

View File

@ -192,7 +192,11 @@ export default class GeneralUserSettingsTab extends React.Component {
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage);
this.setState({language: newLanguage});
PlatformPeg.get().reload();
const platform = PlatformPeg.get();
if (platform) {
platform.reload();
platform.setLanguage(newLanguage);
}
};
_onSpellCheckLanguagesChange = (languages) => {