Voice: use the ISO3 language and country codes

The Android 5.0 Text-to-speech output settings dialog checks that
the languages from CheckVoiceData use the ISO3 language and
country codes. This change matches that expectation.
This commit is contained in:
Reece H. Dunn
2014-10-30 14:16:43 +00:00
parent 736986d609
commit f4adda18b4
2 changed files with 93 additions and 84 deletions
+10 -1
View File
@@ -68,6 +68,15 @@ public class Voice {
@Override
public String toString() {
return locale.toString().replace('_', '-');
String ret = locale.getISO3Language();
if (locale.getISO3Country() != null && !locale.getISO3Country().isEmpty()) {
ret += '-';
ret += locale.getISO3Country();
}
if (locale.getVariant() != null && !locale.getVariant().isEmpty()) {
ret += '-';
ret += locale.getVariant();
}
return ret;
}
}