I'm using Google translate to translate strings.xml files to other languages from English. But translating more than 1000 lines one by one takes too much time. Is there an easy way or code to do this?
How do you translate your apps to other languages?
Check out my Python scripts at Github. It works here behind a web page. You feed
strings.xml
plus IN and OUT language codes, Google Translate does the rest. Works best if you use simple unambiguous English. Kudos to Khayam Gondal, on whose work I build.
I use translation editor, its not automatic but still very convenient way and it is built into Android Studio. Also take a look on this answer, that guy created a tool that making the translation automatically.
Since CTRL+A not working now in the android studio. There is one way to convert the android strings file to CSV and then translate it with the help of google translator and then again convert back to XML.
https://skydevelopers.net/blog/2-best-ways-to-translate-the-android-strings-file/
here is a blog in detail
Use this Python script. You can also translate into multiple languages at once.
EDIT: The above library has a limit. Since it uses unofficial googletrans library it doesn't work sometimes.
I have created another library here which uses quota of your GCP. It is faster and reliable. You can bulk translate, and has option to translate to all available language at once. https://github.com/bikcrum/Android-String-Translator-GCP
I recently published an app for this purpose. It translates a strings.xml file into other languages quickly and easily, and after translation it is possible to edit and view all translatable strings. Translations are provided by Google Translate and in case of errors or bad formatting, which usually happens when translating strings with HTML markup, you can easily correct based on the original string.
Check out the app in the Play Store for more details.
来源:https://stackoverflow.com/questions/44477221/easiest-way-to-translate-android-strings-xml-file