Skip to content

Commit

Permalink
Change to polish as backup instead of english. (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankejc committed Mar 2, 2024
1 parent 7802b0d commit 406dc88
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package pg.eti.project.polishbanknotes.accessibility

import android.content.Context
import android.speech.tts.TextToSpeech
import android.util.Log
import android.view.accessibility.AccessibilityManager
import androidx.preference.PreferenceManager
import pg.eti.project.polishbanknotes.settings_management.DEFAULT_PREFERENCES_FLAG
import java.util.*

class TalkBackSpeaker(context: Context) {
Expand All @@ -19,12 +16,11 @@ class TalkBackSpeaker(context: Context) {
val result = textToSpeech.setLanguage(Locale.getDefault())
if (result == TextToSpeech.LANG_MISSING_DATA
|| result == TextToSpeech.LANG_NOT_SUPPORTED
) {
// Set English language as a backup language
val englishLocale = Locale.ENGLISH
val englishResult = textToSpeech.setLanguage(englishLocale)
if (englishResult == TextToSpeech.LANG_MISSING_DATA
|| englishResult == TextToSpeech.LANG_NOT_SUPPORTED
) { // Set polish language as a backup language
val polishLocale = Locale("pl", "PL")
val polishResult = textToSpeech.setLanguage(polishLocale)
if (polishResult == TextToSpeech.LANG_MISSING_DATA
|| polishResult == TextToSpeech.LANG_NOT_SUPPORTED
) {
// Log.e("TTS", "Language not supported")
} else {
Expand Down

0 comments on commit 406dc88

Please sign in to comment.