Skip to content

Instantly share code, notes, and snippets.

@ty0x2333
Last active March 31, 2017 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ty0x2333/1863d7d45655fc1bd837238186a289d2 to your computer and use it in GitHub Desktop.
Save ty0x2333/1863d7d45655fc1bd837238186a289d2 to your computer and use it in GitHub Desktop.
iOS update i18n
#!/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
@ty0x2333
Copy link
Author

Require

OS X 10.9+
Python 2.7
TyStrings 1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment