使用某开放的在线翻译API接口实现的一个小工具,方便快速生成Android中的国际化strings.xml文件。
目录结构
./
├── README.md
├── const.py
├── excel_helper.py
├── res
│ └── structure.png
├── strings
│ ├── openpyxl_test.py
│ ├── record.xlsx
│ ├── values
│ │ └── strings.xml
│ └── values-zh-rCN
│ └── strings.xml
├── strings_comparator.py
├── test.py
├── translator.properties
└── translators.py
功能结构
说明
- 到 这里 创建一个应用,并绑定一个翻译实例,将应用对应的
应用ID
和应用密钥
设置到translators.py
中。 - 目前是读取
values
和values-zh-rCN
目录下的strings.xml
。具体的路径可以自己配置到配置文件translator.properties
中,稍微修改下代码即可。 - 仅提供了一种在线翻译,后期有时间再加上其他的在线翻译。
- 后期还打算提供将正式的翻译资料,自动更新到国际化strings.xml文件中的脚本,实现全程自动化。