diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/extract-i18n-js.pl | 15 | ||||
-rw-r--r-- | utils/localized_schema.txt | 17 | ||||
-rwxr-xr-x | utils/rebase-translations.sh (renamed from utils/update-translations.sh) | 20 |
3 files changed, 14 insertions, 38 deletions
diff --git a/utils/extract-i18n-js.pl b/utils/extract-i18n-js.pl deleted file mode 100755 index b51e7ce5a..000000000 --- a/utils/extract-i18n-js.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -w -# -use strict; - -while (<STDIN>) { - chomp; - - if (/(__|Notify.progress|Notify.msg|Notify.info|Notify.error)\(['"](.*?)['"]\)/) { - my $msg = $2; - - $msg =~ s/\"/\\\"/g; - - print "print T_js_decl(\"$msg\");\n"; - } -} diff --git a/utils/localized_schema.txt b/utils/localized_schema.txt deleted file mode 100644 index 417b690c4..000000000 --- a/utils/localized_schema.txt +++ /dev/null @@ -1,17 +0,0 @@ -__("Title"); -__("Title or Content"); -__("Link"); -__("Content"); -__("Article Date"); - -__("Delete article"); -__("Mark as read"); -__("Set starred"); -__("Publish article"); -__("Assign tags"); -__("Assign label"); -__("Modify score"); - -__("General"); -__("Interface"); -__("Advanced"); diff --git a/utils/update-translations.sh b/utils/rebase-translations.sh index 51869986b..2bc42c7eb 100755 --- a/utils/update-translations.sh +++ b/utils/rebase-translations.sh @@ -1,11 +1,17 @@ #!/bin/sh TEMPLATE=messages.pot -xgettext -kT_js_decl -kT_sprintf -kT_nsprintf:1,2 -k_ngettext:1,2 -kT_ngettext:1,2 -k__ -L PHP -o $TEMPLATE *.php include/*.php `find classes -iname '*.php'` `find plugins -iname '*.php'` +xgettext -kT_sprintf -kT_nsprintf:1,2 -k_ngettext:1,2 -kT_ngettext:1,2 -k__ \ + -L PHP -o $TEMPLATE *.php `find classes plugins include -iname '*.php'` -xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Perl -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'` +xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress \ + -kngettext:1,2 -L Java -j -o $TEMPLATE `find js plugins -iname '*.js'` -xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'` +xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress \ + -kngettext:1,2 -L JavaScript -j -o $TEMPLATE `find js plugins -iname '*.js'` + +# leave weblate to deal with .po/.mo files +exit 0 update_lang() { if [ -f $1.po ]; then @@ -16,12 +22,14 @@ update_lang() { fi } +compile_po() { + msgfmt --statistics $1.po -o $1.mo +} + LANGS=`find locale -name 'messages.po'` for lang in $LANGS; do echo Updating $lang... PO_BASENAME=`echo $lang | sed s/.po//` - update_lang $PO_BASENAME + compile_po $PO_BASENAME done - -#./utils/update-js-translations.sh |