I wrote a translation tool that translates .txt file , .string files and .xml files into multiple languages.
Install: $pip install mkTranslation
Usage:
$translate -p ./ios.strings -d 'en' # translation file
$translate -p ./android.xml -d 'ja' # translation file
$translate 'mkTranslate supports multilingual translations' -d 'pt' # translation text
demo:
from
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- tab -->
<string name="network_error">网络不可用,点击屏幕重试</string>
<string name="scan_qr_code_warn">将二维码放入框内,即可自动扫描</string>
<string name="album_text">相册</string>
</resources>
to
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- tab -->
<string name="network_error">Network is not available, click screen to try again</string>
<string name="scan_qr_code_warn">Put the QR code into the box and you can scan it automatically.</string>
<string name="album_text">Album</string>
</resources>
The default translation is google translation, you can specify other translation channels
Code:https://github.com/mythkiven/mkTranslate