Broadcast language change to ElectroPlatform
This commit is contained in:
parent
65d55bd0d9
commit
8f1ea84eb6
2 changed files with 8 additions and 2 deletions
|
@ -258,7 +258,9 @@ export default abstract class BasePlatform {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
setLanguage(preferredLangs: string[]) {}
|
async setLanguage(language: string) {
|
||||||
|
throw new Error("Unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
setSpellCheckLanguages(preferredLangs: string[]) {}
|
setSpellCheckLanguages(preferredLangs: string[]) {}
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,11 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage);
|
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage);
|
||||||
this.setState({language: newLanguage});
|
this.setState({language: newLanguage});
|
||||||
PlatformPeg.get().reload();
|
const platform = PlatformPeg.get();
|
||||||
|
if (platform) {
|
||||||
|
platform.reload();
|
||||||
|
platform.setLanguage(newLanguage);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_onSpellCheckLanguagesChange = (languages) => {
|
_onSpellCheckLanguagesChange = (languages) => {
|
||||||
|
|
Loading…
Reference in a new issue