forked from uservoice/uservoice-ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_strings.sh
executable file
·27 lines (20 loc) · 949 Bytes
/
update_strings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Make sure all translations are pushed out to the strings files
for file in Resources/*.lproj/UserVoice.strings; do
twine generate-string-file strings.txt $file
done
# Regenerate English strings from the source code
genstrings Resources/en.lproj/UserVoice.strings
# Clear strings.txt
> strings.txt
# Repopulate strings.txt from the English strings file
twine consume-string-file strings.txt Resources/en.lproj/UserVoice.strings --lang en --consume-all 2> /dev/null
# Pull only the still-used translations back into strings.txt
for file in Resources/*.lproj/UserVoice.strings; do
twine consume-string-file strings.txt $file 2> /dev/null
done
# Push used translations back out to strings files
for file in Resources/*.lproj/UserVoice.strings; do
twine generate-string-file strings.txt $file
done
LANGS=`ls Resources/*.lproj/UserVoice.strings | sed 's/.*Resources\/\([^.]*\).*$/\1/' | tr '\n' ' '`
echo "Strings updated. Locales: $LANGS"