An overview of the

If we want to support multiple languages in a real project, we need to organize all the strings in the project and translate them into the appropriate languages and put them in the appropriate folders, like this

Android-strings-xml-csv-converter
That is to convert XML files into Excel documents, and then convert the translated Excel documents into XML for each language

We have written two scripts in Python and packaged them as exe files (XLS to xml.exe and XML to XLS.

Using the step

1 turn XLS XML

So the first thing we’re going to do is we’re going to have a string.xml file which is actually text in Chinese which looks like this

<resources> <string name="app_name"> Multilanguage translation test </string> <string name="confirm"> Confirm </string> <string Name ="cancel"> Cancel </string> <string name="submit"> Submit </string> <string name="edit"> Edit </string> <string Name ="join"> Join </string> <string name="create"> Create </string> <string name="tips"> </string>... . </resources>Copy the code

Of course your project is more than that and then put this XML file in the same directory as XML to xls.exe

Double-click to execute XML to xls.exe

2 turn XML XLS

Now let’s say we’ve got the translated document, like this

Note: The document name strings.xls cannot be changed

English

Mission accomplished!

Since we are directly converting XML files, this works regardless of whether you are AndroidStudio or Eclipse.

Below is the Github address for the tools and Python source code. Welcome fork and Star!

Github.com/shiweibsw/T…

(Windows users can directly use the EXE file. MAC users need to install python and use the corresponding Python script.)