Extract translated strings in Android project
1 min readApr 3, 2019
It’s common that an android developer is working on several projects. Sometimes, you just need some existing string translations from another Android project. Usually, the translated strings are scattered in strings.xml file in tens of folders named values-xx. There’s no easy way to copy these string definitions from multiple folders into new project.
Therefore, I wrote a simple python script to do the job. All you have to do is:
- Configure input and output folder (usually it would be looked like …/project_name/app/src/main/res/ )
- run commands for each string key you wanna copy.
new_string_key is optional if you expect using the same string key in new project.
Here’s the link to Github repository. Happy Coding~