]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - locale/translate.sh
second int. patch from Jan (slightly modified)
[SourceForge/phpwiki.git] / locale / translate.sh
1 #!/bin/bash
2 # translate.sh
3 #
4 # Usage:
5 #
6 #   ./locale/translate.sh
7 #
8 # This script should be run by
9 #
10 #    * PphWiki maintainers, before making a distribution
11 #    * Translators, after making a translation update
12 #
13
14 ALL_LINGUAS=nl
15
16 xgettext -L C++ -o locale/po/phpwiki.pot lib/*php
17 podir=locale/po
18 for i in $ALL_LINGUAS; do
19         po=$podir/$i.po
20         pot=$podir/phpwiki.pot
21         locale=locale/$i/LC_MESSAGES
22
23         msgmerge -o $po $po $pot
24         mkdir -p locale/$i/LC_MESSAGES
25         msgfmt -o $locale/phpwiki.mo $po
26
27         awk -- '
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
33 done