Search code examples
androidlocalizationaccessibilitytalkback

Android accessibility for TextView with different locales


In my app, I have android:text="@string/myText" set for a TextView. This myText is picked from strings.xml based on the localization(English/German).
For English: SETTINGS
For German: EINSTELLUNGEN

With TalkBack on, Android announces SETTINGS (locale is English) but it does not announce EINSTELLUNGEN (locale is German).
What would be the reason ?
Does CAPITAL LETTERS of the text have anything to do with this ?

Below is my TextView in the xml:

<TextView
android:id="@+id/settings_text"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:gravity="center_vertical"
android:text="@string/settings"
android:textColor="@color/st_white"
android:textStyle="bold"
android:textSize="15sp"/>


The "settings" string is present in two different strings.xml files for English(default) and German version.
English: values/strings.xml
<string name="settings">SETTINGS</string>

German: values-de/strings.xml
<string name="settings">EINSTELLUNGEN</string>

I can see the display if "Display speech output" setting is turned on(TalkBack Settings -> Developer Settings) but could not hear the same.


Solution

  • The issue has been resolved by updating Google Talkback and Google Text-to-Speech from the Playstore.
    After updating both, I have to turn Talkback OFF (if already ON), change the device locale (in my case to Deutsch for German) and then turn ON Talkback. This will automatically download updates for the locale text-to-speech.