X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2FDictionaryActivity.java;h=67c1d834003bef2a626e24e840d45069f822f149;hb=b3b110191068008c8b5180ff2d6d3af6373def9f;hp=78c18231c935c7162a1a5461c5c1a482c6b10b72;hpb=c9012e8abcdbd2d68f348eefe72f7faae979d5d5;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 78c1823..67c1d83 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -668,11 +668,15 @@ public class DictionaryActivity extends ActionBarActivity { } final Locale locale = new Locale(dictionary.indices.get(i).sortLanguage.getIsoCode()); Log.d(LOG, "Setting TTS locale to: " + locale); + try { final int ttsResult = textToSpeech.setLanguage(locale); if (ttsResult != TextToSpeech.LANG_AVAILABLE && ttsResult != TextToSpeech.LANG_COUNTRY_AVAILABLE) { Log.e(LOG, "TTS not available in this language: ttsResult=" + ttsResult); } + } catch (Exception e) { + Toast.makeText(this, getString(R.string.TTSbroken), Toast.LENGTH_LONG).show(); + } } void onLanguageButtonClick() {