summaryrefslogtreecommitdiffstats
path: root/src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java')
-rw-r--r--src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java b/src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java
index b50d748..f6f440c 100644
--- a/src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java
+++ b/src/plugins/tts/android/jar/src/org/qtproject/qt5/android/speech/QtTextToSpeech.java
@@ -253,7 +253,16 @@ public class QtTextToSpeech
public Locale getLocale()
{
//Log.d("QtTextToSpeech", "getLocale: " + mLocale);
- return mTts.getLanguage();
+ final Locale language = mTts.getLanguage();
+ String languageCode = language.getLanguage();
+ String countryCode = language.getCountry();
+
+ if (languageCode.equals(language.getISO3Language()))
+ languageCode = convertLanguageCodeThreeDigitToTwoDigit(languageCode);
+ if (countryCode.equals(language.getISO3Country()))
+ countryCode = convertCountryCodeThreeDigitToTwoDigit(countryCode);
+
+ return new Locale(languageCode, countryCode);
}
public Object getVoice()