Skip to content

Instantly share code, notes, and snippets.

@Sega-Zero
Last active January 6, 2016 18:44
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 Sega-Zero/92e6d58f85f71d60d976 to your computer and use it in GitHub Desktop.
Save Sega-Zero/92e6d58f85f71d60d976 to your computer and use it in GitHub Desktop.
A useful bash script to gather all localizable strings of your Objective-C project into Localizable.strings file with UTF8 encoding. The script should be placed to the root of your project. Replace {ProjectFolderName} with your project's folder path and you're done!
cd "`dirname "$0"`/{ProjectFolderName}"
find . -name "*.m" -print0 | xargs -0 genstrings -o Base.lproj
cd ./Base.lproj
#this is to encode Localizable.strings in UTF8 encoding
iconv -f UTF-16 -t UTF-8 Localizable.strings > Localizable.strings1
rm -f Localizable.strings
mv Localizable.strings1 Localizable.strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment