Created
May 10, 2013 21:27
-
-
Save teslacoil/5557571 to your computer and use it in GitHub Desktop.
Populates res/values-XX directories from crowdin translations. Tries to do the appropriate escapes and greps/warns about messed up %1$s style formatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rm -rf iw | |
cp -R he iw | |
mv pt-BR pt-rBR | |
mv pt-PT pt-rPT | |
mv zh-CN zh-rCN | |
mv zh-TW zh-rTW | |
mv no nb | |
mv es-ES es | |
mv sv-SE sv | |
declare -a Lang=( | |
ar # Arabic | |
bg # Bulgarian | |
ca # Catalan | |
zh-rCN # Chinese CN | |
zh-rTW # Chinese CN | |
hr # Croatian | |
cs # Czech | |
da # Danish | |
nl # Dutch | |
fi # Finnish | |
fr # French | |
de # German | |
el # Greek | |
iw # Hebrew AOSP | |
hu # Hungarian | |
it # Italian | |
ja # Japanese | |
ko # Korean | |
nb # Norwegian | |
pl # Polish | |
pt-rPT # Portuguese | |
pt-rBR # Brazillian Portuguese | |
ro # Romanian | |
ru # Russian | |
sk # Slovak | |
es # Spanish | |
sv # Swedish | |
tr # Turkish | |
# he # Hebrew ? | |
) | |
for i in ${Lang[@]}; do | |
cp $i/{arrays.xml,strings.xml,aosp_strings.xml} ../res/values-$i/ | |
perl -e "s/\<b\>/<b>/g; s/\<\/b\>/<\/b>/g; | |
s/\<u\>/<u>/g; s/\<\/u\>/<\/u>/g; | |
s/\<i\>/<i>/g; s/\<\/i\>/<\/i>/g; | |
s/([^\\\\])'/\$1\\\\'/g; | |
s/\& /\& /g" \ | |
-pi ../res/values-$i/* | |
done | |
grep -r '% ' * | |
grep -r '%1\$ ' * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment