|
Revision 1688, 0.6 kB
(checked in by mbonetti, 22 months ago)
|
|
updated l10n script
|
| Line | |
|---|
| 1 | #!/bin/zsh |
|---|
| 2 | if [ ! -f dist/l10n.sh ]; then |
|---|
| 3 | echo "Run this script from within the gregarius directory!" >&2 |
|---|
| 4 | exit 1 |
|---|
| 5 | fi |
|---|
| 6 | |
|---|
| 7 | POS=`find intl -name LC_MESSAGES -type d` |
|---|
| 8 | POT=intl/messages.pot |
|---|
| 9 | touch $POT |
|---|
| 10 | echo "Updating template: $POT" |
|---|
| 11 | find . -name \*.php | xargs xgettext -o $POT --no-wrap -j -lPHP -k__ |
|---|
| 12 | |
|---|
| 13 | POFILE=messages.po |
|---|
| 14 | MOFILE=messages.mo |
|---|
| 15 | POXFILE=messages.pox |
|---|
| 16 | |
|---|
| 17 | for PO in $POS; do |
|---|
| 18 | echo "Updating $PO/$POFILE" |
|---|
| 19 | touch $PO/$POFILE |
|---|
| 20 | msgmerge -v -F --no-wrap --update --no-fuzzy-matching $PO/$POFILE $POT |
|---|
| 21 | echo "Building $PO/$MOFILE" |
|---|
| 22 | msgfmt -o $PO/$MOFILE $PO/$POFILE |
|---|
| 23 | echo |
|---|
| 24 | done |
|---|