aboutsummaryrefslogtreecommitdiff
path: root/includes/php-gettext/bin/gettexts.sh
blob: 267f670dbf367a748a01df3818ed88d24f13b5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
xgettext -kT_ngettext:1,2 -kT_ -L PHP -o ../../../locales/messages.po ../../../*.php ../../../services/*.php ../../../templates/*.php

if [ -f "../../../locales/$1/LC_MESSAGES/messages.po" ]
then
msgmerge -o ../../../locales/$1/LC_MESSAGES/messages.po ../../../locales/$1/LC_MESSAGES/messages.po ../../../locales/messages.po

msgfmt --statistics "../../../locales/$1/LC_MESSAGES/messages.po" -o "../../../locales/$1/LC_MESSAGES/messages.mo"
else 
echo "gettexts.sh LANGUAGE_CODE"
echo "example: 'gettexts fr_FR' to get text for French"
fi