Skip to content

Instantly share code, notes, and snippets.

@Sega-Zero
Created January 6, 2016 20:43
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/a686ea793998931222b6 to your computer and use it in GitHub Desktop.
Save Sega-Zero/a686ea793998931222b6 to your computer and use it in GitHub Desktop.
An alternative for run_genstrings script. Uses xliff export and import. Replace {YourProjectNameHere} with your project file name. Script expects to be located in the project's root directory.
cd "`dirname "$0"`"
#this will export ru.xliff file into LocalizedFiles subfolder
xcodebuild -exportLocalizations -project ./{YourProjectNameHere}.xcodeproj -localizationPath LocalizedFiles -exportLanguage ru
#I prefer to edit xml files in TextWrangler, replace it with TextEdit, or any other text editor you like
echo `open -a 'TextWrangler' ./LocalizedFiles/ru.xliff`
cd "`dirname "$0"`"
xcodebuild -importLocalizations -project ./{YourProjectNameHere}.xcodeproj -localizationPath LocalizedFiles/ru.xliff
#comment this line if you want to store xliff files in your repo
rm -rf LocalizedFiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment