Rev 1041 | Rev 1390 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/bin/sh## Created 2005/02/01 by Simon Urbanek# list of localizations we want to generate from EnglishLANGUAGES=`cat LANGUAGES`# Get all (non-backup) NIBs in English.lproj assuming that this is where we do active developmentNIBS=`ls -d English.lproj/*.nib | grep -v \~ | awk -F / '{print substr($2,1,length($2)-4)}'`if [ "$1" == "-h" ]; thenecho " Usage $0 [-t]"echo " "echo " When -t is used, translation files are not generated, but assumed to exist already."echo " Otherwise files in Translation.strings are overwritten."echo " "exit 0fimkdir Translated.strings 2> /dev/null# for each languange ...for LANG in $LANGUAGES; doecho "Updating $LANG ..."# and each NIB ...for NIB in $NIBS; doif [ -e "$LANG.lproj/$NIB.nib" ]; then# create a strings file with all translationsif [ "$1" != "-t" ]; thennibtool -8 -I "$LANG.lproj/$NIB.nib" -L "English.lproj/$NIB.nib" > "Translated.strings/$NIB.$LANG.strings"fiif [ ! -e "Translated.strings/$NIB.$LANG.strings" ]; thenecho " $NIB .. ERROR: Can't find translation strings"elserm -rf "$LANG.lproj/temp.nib" "$LANG.lproj/temp~.nib"# merge the changes taking modifications into accountnibtool -8 -I "$LANG.lproj/$NIB.nib" -W "$LANG.lproj/temp.nib" -d "Translated.strings/$NIB.$LANG.strings" "English.lproj/$NIB.nib"if [ -e "$LANG.lproj/temp.nib/classes.nib" ]; thencp "$LANG.lproj/temp.nib/"* "$LANG.lproj/$NIB.nib/"rm -rf "$LANG.lproj/temp.nib" "$LANG.lproj/temp~.nib"echo " $NIB .. OK"elseecho "ERROR for language \"$LANG\" and NIB \"$NIB\": Localized nib was not created. Check for nibtool errors."fifielseecho " $NIB .. not localized yet."fidonedone