Normalize TTS default locale before #toDisplayString

TTS is... special in regard of Locale instances it uses.
Recently ISO-3166 alpha 3 country codes went out of spec, so
"English (GBR)".

Bug: 15741357
Change-Id: I022105acad9d319d5e09231be340405d797c84c4
This commit is contained in:
Przemyslaw Szczepaniak
2014-06-19 16:01:39 +01:00
parent ee18fdbec8
commit 6ac8ddb898

View File

@@ -268,7 +268,9 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
return; return;
} }
mCurrentDefaultLocale = defaultLocale; // ISO-3166 alpha 3 country codes are out of spec. If we won't normalize,
// we may end up with English (USA)and German (DEU).
mCurrentDefaultLocale = mEnginesHelper.parseLocaleString(defaultLocale.toString());
int defaultAvailable = mTts.setLanguage(defaultLocale); int defaultAvailable = mTts.setLanguage(defaultLocale);
if (evaluateDefaultLocale()) { if (evaluateDefaultLocale()) {