1
by budgester at budgester
Initial import of IRM codebase |
1 |
#!/bin/sh
|
2 |
||
3 |
POT="po/irm.pot" |
|
4 |
||
5 |
# Extract the strings from all source files
|
|
6 |
xgettext -L PHP -k_ -k__ -o - $( find .. -name \*.php -or -name \*.inc ) | sed 's/charset=CHARSET/charset=iso-8859-1/' > $POT.extracted |
|
7 |
||
8 |
# Merge changed strings into a new version of irm.pot
|
|
9 |
test -f $POT || touch $POT |
|
10 |
mv $POT $POT~ |
|
11 |
msgmerge -o $POT $POT~ $POT.extracted && rm -f $POT.extracted $POT~ |
|
12 |
||
13 |
for file in po/*.po; do |
|
14 |
test -f $file || continue |
|
15 |
# Merge system messages into the per-language po file
|
|
16 |
msgmerge -o $file.new $file $POT && mv $file.new $file |
|
17 |
||
18 |
# Compile the translations to an optimised form
|
|
19 |
mo_dir="$( echo $file | sed 's%^po/\(.*\)\.po$%\1%')/LC_MESSAGES" |
|
20 |
mkdir -p $mo_dir
|
|
21 |
msgfmt -o $mo_dir/irm.mo $file |
|
22 |
done
|