fix build
This commit is contained in:
parent
6243b075ee
commit
ec6a5c38dc
1 changed files with 2 additions and 2 deletions
|
@ -166,13 +166,13 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
ttsRequests = 0;
|
||||
final float speechRate = cSpeechRate;
|
||||
|
||||
Locale newLocale = new Locale(language);
|
||||
private Locale newLocale = new Locale(language);
|
||||
// #3344: Try Locale builder instead of constructor (only available from API 21)
|
||||
if (android.os.Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
final String[] languageFields = language.split("\\_");
|
||||
newLocale = new Locale.Builder().setLanguage(languageFields[0]).setScript("").setRegion(languageFields[1]).build();
|
||||
} catch (IllformedLocaleException e) {
|
||||
} catch (RuntimeException e) {
|
||||
// Falls back to "new Locale(language)"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue