Last active
March 31, 2017 04:54
-
-
Save ty0x2333/1863d7d45655fc1bd837238186a289d2 to your computer and use it in GitHub Desktop.
iOS update i18n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
required_ver="1.1.2" | |
if [ ! $(command -v tystrings) ]; then | |
echo "❗️ tystrings command not found" | |
echo "sudo pip install tystrings" | |
exit 1 | |
elif [ ! `python -c "import tystrings; from pkg_resources import parse_version; print 1 if parse_version(tystrings.__version__) >= parse_version(\"${required_ver}\") else 0;"` ] | |
then | |
echo "❗️ require tystrings version $required_ver" | |
echo "sudo pip install tystrings --upgrade" | |
exit 1 | |
fi | |
project_name="your_project_name" | |
current_dir=$(dirname $0) | |
tystrings generate $(find $current_dir/../$project_name -name \*.m -o -name \*.swift) -o $current_dir/../$project_name/en.lproj $current_dir/../$project_name/zh-Hans.lproj $current_dir/../$project_name/zh-Hant.lproj | |
read -n 1 -s -p "Press any key to continue\n" | |
tystrings translate $current_dir/../$project_name/zh-Hans.lproj/Localizable.strings $current_dir/../$project_name/zh-Hant.lproj/Localizable.strings --src-lang zh --dst-lang cht |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Require
OS X 10.9+
Python 2.7
TyStrings 1.1.2