From c1f957436f4e9fc8f6dd0add1a401ca834c9807a Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 20 Dec 2016 18:25:35 +0100 Subject: [PATCH] match also dash for backward compatibility --- OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java index dad212f4cb..0a4b508a99 100644 --- a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java @@ -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)"