Skip to content

Instantly share code, notes, and snippets.

@mr-fixit
Created April 28, 2015 19:28
Show Gist options
  • Save mr-fixit/edf6dd517a57d17d250d to your computer and use it in GitHub Desktop.
Save mr-fixit/edf6dd517a57d17d250d to your computer and use it in GitHub Desktop.
#!/bin/bash
# given a spreadsheet, create a Localizable.strings file for a given language
cat localized.csv |
while IFS=',' read devConst devValue englishValue spanishValue; do
if [[ $devValue ]]; then
devConst=`echo "$devConst" | tr -d '/* '`
# key=`echo $devValue | cut -d " = " -f 1 | tr -d '"'`
key=`echo $devValue | cut -d "=" -f 1 | sed -e 's/\"//g' | sed -e 's/ $//'`
echo "/* $devConst */"
echo \"$key\" = \"$spanishValue\"\;
echo
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment