Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fixes voice language issue when reset. Also force save the display one (
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and MortimerGoro committed Jan 21, 2020
1 parent eb9a1ec commit 2868a7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ protected boolean reset() {
String currentLocale = LocaleUtils.getCurrentLocale();
if (currentLocale.equalsIgnoreCase(systemLocale)) {
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), false);
SettingsStore.getInstance(getContext()).setDisplayLocale(currentLocale);
return false;

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ private void initialize(Context aContext) {
@Override
protected boolean reset() {
String systemLocale = LocaleUtils.getClosestSupportedLocale(getContext(), LocaleUtils.getDeviceLanguage().getId());
String currentLocale = LocaleUtils.getCurrentLocale();
String currentLocale = LocaleUtils.getVoiceSearchLanguage(getContext()).getId();
if (currentLocale.equalsIgnoreCase(systemLocale)) {
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), false);
return false;

} else {
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), true);
SettingsStore.getInstance(getContext()).setVoiceSearchLocale(null);
return true;
}

return false;
}

private RadioGroupSetting.OnCheckedChangeListener mLanguageListener = (radioGroup, checkedId, doApply) -> {
Expand Down

0 comments on commit 2868a7e

Please sign in to comment.