Scripts for creating csv files from Android strings.xml files. Just that, with plain Python 3, no external dependencies.
Because copy pasting from Android Studio Translations editor is no longer supported, StackOverflow does not help, the existing tools found online were abandoned, or too complicated to run, or did too many things, or imposed structure that did not suit our project. The translation editors would work, but adopting them is not easy.
usage: strings_to_csv.py [-h] out_file res_path
Convert strings.xml -files to csv
positional arguments:
out_file output file
res_path path to res directory, for example "~/AndroidStudioProjects/MyApp/app/src/main/res"
optional arguments:
-h, --help show this help message and exit
usage: csv_to_strings.py [-h] csv_path res_path
Convert a previously exported csv file back to strings.xml files
positional arguments:
csv_path input csv file
res_path path to target res -directory, For example "~/AndroidStudioProjects/MyApp/app/src/main/res"
optional arguments:
-h, --help show this help message and exit
See expected.csv for a sample output of strings.xml
files in tests/xml-to-csv/in.
Run ./run_tests.sh.