Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import/export Android string resource to Excel for localization?

I use Android Studio in app development. I want to translate strings by exporting/importing the Android language resources (strings.xml) to Excel file (xlsx). What is the best way to do it?

like image 542
Empath Avatar asked Jun 06 '15 15:06

Empath


4 Answers

If anyone else needed the answer,

from res -> strings -> right click-> Open Translations Editor. Select data/variable you need then copy and paste data from Translations Editor to excel . done.

image from android studio v2.2

like image 119
Saad Mahmud Avatar answered Oct 06 '22 19:10

Saad Mahmud


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://www.skydevelopers.net/blog/2-best-ways-to-translate-the-android-strings-file/

here is a blog in detail

like image 37
Raj Avatar answered Oct 06 '22 20:10

Raj


As many others pointed out, pressing Ctrl+A in the Translations Editor doesn't work since Android Studio 3.2

I work for a company that outsources translations constantly, so we need to convert android strings to and from xls files. The only solution that worked for us reliably is this fork of the older android-lang-tool. Just build with maven and run the jar.

It exports strings, string-arrays, plurals and their key-values to an xls file. It even exports the comments.

like image 5
Kozaris Yiannis Avatar answered Oct 06 '22 20:10

Kozaris Yiannis


  1. Export Strings resource file to csv
  2. Get its content translated(probably from google translate)
  3. convert back the Translated file to Strings.xml(android string resource file)

I used http://convertcsv.com/csv-to-xml.htm this website for converting csv file to strings resource file

need to mention Custom output template to convert it to strings resource file

<string name="{f1}">{f2}</string>

put this in template section provided

website also displays the desired converted output file

like image 5
sandeep chorge Avatar answered Oct 06 '22 19:10

sandeep chorge