Skip to content

Python scripts to convert Android translations to Excel and back (also supports plurals)

License

Notifications You must be signed in to change notification settings

PhilKes/AndroidExcelConverter

Repository files navigation

AndroidExcelConverter

Inspired By: android-strings-export

Python scripts to automate importing and exporting Android translations (strings.xml files) to Excel and back.

Export

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

Generated Excel

example

  • 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

Import

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 corresponding values-{language} folder
  • All strings.xml contents are sorted alphabetically by their key names

Libraries

About

Python scripts to convert Android translations to Excel and back (also supports plurals)

Topics

Resources

License

Stars

Watchers

Forks

Languages