Inspired By: android-strings-export
Python scripts to automate importing and exporting Android translations (strings.xml
files) to Excel and back.
To export all Translations to an Excel file:
python -m pip install -r ./requirements.txt
python ./export.py <Android Project Path>/app/src/main/res/ ./translations.xlsx
- Column headers with the respective language ISO-Codes/Android-Resource folder names
- Missing translations are marked in red
- Key and default language columns are pinned
- Non-Translatable strings are hidden and marked in gray
- For plural strings there are separate rows for each possible
quantity
(few
,many
,one
,other
,two
,zero
), if the default language does not need/have a translations for a specific quantity, the row is highlighted in yellow
Example generated Excel file: translations.xlsx
To import strings.xml
for all languages from Excel file:
python ./import.py ./translations.xlsx <Android Project Path>/app/src/main/res/
- Creates a
strings.xml
per Excel Sheet column (= language) in the correspondingvalues-{language}
folder - All
strings.xml
contents are sorted alphabetically by their key names