| 1048 |
urbaneks |
1 |
#!/bin/sh
|
|
|
2 |
#
|
|
|
3 |
# Created 2005/02/08 by Simon Urbanek
|
|
|
4 |
|
|
|
5 |
# list of localizations we want to generate from English
|
|
|
6 |
LANGUAGES=`cat LANGUAGES`
|
|
|
7 |
|
|
|
8 |
# this is an exception - we actually merge into the english master, too
|
|
|
9 |
LANGUAGES="$LANGUAGES English"
|
|
|
10 |
|
|
|
11 |
# remove existing strings (if present)
|
|
|
12 |
rm -f Localizable.strings
|
|
|
13 |
|
|
|
14 |
# find all sources and run filterNLS on that list
|
|
|
15 |
find -X . -name \*.m 2> /dev/null | awk '{print substr($1,3)}' | xargs ./filterNLS
|
|
|
16 |
|
|
|
17 |
# now we have new Localized.strings in the current directory
|
|
|
18 |
if [ ! -e Localizable.strings ]; then
|
|
|
19 |
echo "*** ERROR: Localizable.strings were NOT generated"
|
|
|
20 |
exit 1
|
|
|
21 |
fi
|
|
|
22 |
|
|
|
23 |
# we need to merge that with the available languages
|
| 5732 |
urbaneks |
24 |
for lang in $LANGUAGES; do
|
|
|
25 |
if [ -e "$lang.lproj" ]; then
|
|
|
26 |
if [ -e "$lang.lproj/Localizable.strings" ]; then
|
|
|
27 |
echo "Updating $lang ..."
|
|
|
28 |
./mergeLS Localizable.strings "$lang.lproj/Localizable.strings"
|
| 1048 |
urbaneks |
29 |
else
|
| 5732 |
urbaneks |
30 |
echo "-- $lang has no localizable strings, creating them"
|
|
|
31 |
cp Localizable.strings "$lang.lproj/Localizable.strings"
|
| 1048 |
urbaneks |
32 |
fi
|
|
|
33 |
else
|
| 5732 |
urbaneks |
34 |
echo "** $lang is in the language list, but there is no lproj dorectory for it!"
|
| 1048 |
urbaneks |
35 |
fi
|
|
|
36 |
done
|
|
|
37 |
|
|
|
38 |
rm Localizable.strings
|
|
|
39 |
echo " Done."
|