Skip to content

reaktor/strings-xml-to-csv-and-back

Repository files navigation

strings.xml to csv

Scripts for creating csv files from Android strings.xml files. Just that, with plain Python 3, no external dependencies.

Why?

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

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

Samples

See expected.csv for a sample output of strings.xml files in tests/xml-to-csv/in.

Tests

Run ./run_tests.sh.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published