Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-12-20 18:26:09 +01:00
commit 8a595efff0

View file

@ -170,7 +170,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
// #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("\\_");
final String[] languageFields = language.split("[\\_\\-]");
newLocale0 = new Locale.Builder().setLanguage(languageFields[0]).setScript("").setRegion(languageFields[1]).build();
} catch (RuntimeException e) {
// Falls back to "new Locale(language)"