Improve the log message for skipping asia/fa-en-us.

This commit is contained in:
Reece H. Dunn
2015-10-11 13:11:34 +01:00
parent e308cec7c5
commit 865ebf61a7
@@ -135,18 +135,17 @@ public class SpeechSynthesis {
final int gender = Integer.parseInt(results[i + 2]);
final int age = Integer.parseInt(results[i + 3]);
final Locale locale;
if (identifier.equals("asia/fa-en-us")) {
locale = null;
} else {
locale = getLocaleFromLanguageName(name);
}
if (locale == null) {
Log.d(TAG, "getAvailableResources: skipping " + name + " => locale not supported");
continue;
}
try {
final Locale locale;
if (identifier.equals("asia/fa-en-us")) {
throw new IllegalArgumentException("Voice '" + identifier + "' is a duplicate voice.");
} else {
locale = getLocaleFromLanguageName(name);
if (locale == null) {
throw new IllegalArgumentException("Locale not supported.");
}
}
String language = locale.getISO3Language();
if (language.equals("")) {
throw new IllegalArgumentException("Language '" + locale.getLanguage() + "' not supported.");