Extract translated strings in Android project

Daniel Kao
1 min readApr 3, 2019

--

Hakone.Japan

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:

  1. Configure input and output folder (usually it would be looked like …/project_name/app/src/main/res/ )
  2. 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~

--

--

Daniel Kao
Daniel Kao

Written by Daniel Kao

2023 年新書出版! Android 開源專案「真」實戰啟航:瀏覽器 App EinkBro 開發者帶你逐步從 UI 設計、UX 提升到多功能實現秘技全解析

No responses yet