-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathupdate_pot.sh
More file actions
31 lines (25 loc) · 1.26 KB
/
update_pot.sh
File metadata and controls
31 lines (25 loc) · 1.26 KB
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
28
29
30
#!/bin/bash
xgettext --from-code utf-8 -k_ -kN_ -o locale/animation-tweaks.pot animation-tweaks@Selenium-H/*.js -o locale/animation-tweaks.pot schemas/*.xml
grep animation-tweaks@Selenium-H/defaultEffectsList.js -e "'|','"| cut -c7-35 | tr \' \" | tr \, " " |sort|uniq >> effect-names.pot
sed -e 's/^/msgid /' -i effect-names.pot
sed -e 's/$/\nmsgstr \"\"\n\n#: Generated by update_pot.sh/' -i effect-names.pot
sed -e 1's/.*/\n#: Generated by update_pot.sh\n&/' -i effect-names.pot
cat effect-names.pot >> locale/animation-tweaks.pot
rm effect-names.pot
grep animation-tweaks@Selenium-H/metadata.json -e "\"description\":" >> desc.pot
sed -i 's/\"description\":/msgid/' desc.pot
sed -i 's/\",/"/' desc.pot
sed -e 's/$/\nmsgstr \"\"/' -i desc.pot
cat desc.pot >> locale/animation-tweaks.pot
rm desc.pot
grep animation-tweaks@Selenium-H/metadata.json -e "\"comment\":" >> comment.pot
sed -i 's/\"comment\":/msgid/' comment.pot
sed -i 's/\",/"/' comment.pot
sed -e 's/$/\nmsgstr \"\"/' -i comment.pot
sed -e 1's/.*/\n#: Generated by update_pot.sh\n&/' -i comment.pot
cat comment.pot >> locale/animation-tweaks.pot
rm comment.pot
for pofile in $(find locale -mindepth 2 | egrep .po); do
msgmerge -o $pofile.new $pofile locale/animation-tweaks.pot
mv $pofile.new $pofile
done