Different language in text form on Android

how can I write another language (Bangla) on textview or edittext in Android and for that. What version of the API do I need

+6
source share
2 answers

If you use strings.xml to add an indirectness level for string values, you can easily localize your strings like this:

android:text="@string/main_text_view_hello" 

So, I have strings.xml in folders:

 res/values res/values-en-rCa res/values-en-rGB 

Anytime I want to change a value for Canada or the United Kingdom, I just add it to the appropriate folder. All other values ​​are retrieved by default from res / values.

+2
source

You can set the text using TextView.setText (String-ID). Line identifiers are managed in the strings.xml files under the res / values ​​folder. If you need another language, for example, German, you need another strings.xml file with the same string identifiers in res / values-de. In Android layout files, you can reference such line identifiers with @ string / stringid.

+1
source

Source: https://habr.com/ru/post/888119/


All Articles