6 # ./locale/translate.sh
8 # This script should be run by
10 # * PphWiki maintainers, before making a distribution
11 # * Translators, after making a translation update
16 xgettext -L C++ -o locale/po/phpwiki.pot lib/*php
18 for i in $ALL_LINGUAS; do
20 pot=$podir/phpwiki.pot
21 locale=locale/$i/LC_MESSAGES
23 msgmerge -o $po $po $pot
24 mkdir -p locale/$i/LC_MESSAGES
25 msgfmt -o $locale/phpwiki.mo $po
28 BEGIN { print ("<?php") }
29 /^msgid ""/ { getline; next }
30 /^msgid "/ { msgid = substr ($0, 7); print ("$locale[" msgid "] ="); next }
31 /^msgstr "/ { msgstr = substr ($0, 8); print (" " msgstr ";"); next }
32 END { print ("?>") }' $po > $locale/phpwiki.php