简体   繁体   中英

android studio java translate language

(btw sorry for my english) I need help how to translate to another language text from java in android studio.

    p = new Model();
    p.setTitle("want translate title");
    p.setDescription("");
    models.add(p);

    p = new Model();
    p.setTitle("want translate title");
    p.setDescription("and want transtlate this too");
    models.add(p);`

text is from .java no from xml so i don't know how add string or do something to translate this text or add the choice of language and the whole apk will be translated . need help or tutorial

Thanks :)

Based on what i could make out, you are looking to make the app that supports two languages for the GUI. You need to make use of string.xml with the strings in the various languages. You should be able to get more about it here: https://developer.android.com/training/basics/supporting-devices/languages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM