| final int gender = Integer.parseInt(results[i + 2]); | final int gender = Integer.parseInt(results[i + 2]); | ||||
| final int age = Integer.parseInt(results[i + 3]); | 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 { | 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(); | String language = locale.getISO3Language(); | ||||
| if (language.equals("")) { | if (language.equals("")) { | ||||
| throw new IllegalArgumentException("Language '" + locale.getLanguage() + "' not supported."); | throw new IllegalArgumentException("Language '" + locale.getLanguage() + "' not supported."); |