-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·42 lines (29 loc) · 1004 Bytes
/
update.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#############################################
# Update the translation files #
#############################################
#-- 1. Extract the English texts and update the translation.js file
echo "Extract the English texts: icm update"
echo "y" > input.txt
echo "y" >> input.txt
icm update < input.txt
#-- 2. Update the .po file of all the locale folders
cd locale
#-- d is the locale directory
for d in */ ; do
#-- Get the folder name without the trading slash
LOCALE=${d%/}
echo LOCALE FOLDER: $LOCALE
#-- Extract the english text to the messages.po file
xgettext translation.js -d $LOCALE/messages
#-- Convert the .po file into a .pot file
mv $LOCALE/messages.po $LOCALE/messages.pot
#-- Update all the .po files
msgmerge $LOCALE/$LOCALE.po $LOCALE/messages.pot -o $LOCALE/$LOCALE.po
#-- .pot files are temporary
rm $LOCALE/messages.pot
done
cd ..
#-- 3. Update the readme file
icm update < input.txt
rm input.txt