From 15cad4a9c07736394768a983dff500da20d8b1c9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Feb 2021 12:58:33 +0300 Subject: rebase translations, fixing a few JS strings not mached; remove obsolete scripts --- utils/extract-i18n-js.pl | 15 --------------- utils/localized_schema.txt | 17 ----------------- utils/rebase-translations.sh | 27 +++++++++++++++++++++++++++ utils/update-translations.sh | 27 --------------------------- 4 files changed, 27 insertions(+), 59 deletions(-) delete mode 100755 utils/extract-i18n-js.pl delete mode 100644 utils/localized_schema.txt create mode 100755 utils/rebase-translations.sh delete mode 100755 utils/update-translations.sh (limited to 'utils') 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 () { - 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/rebase-translations.sh b/utils/rebase-translations.sh new file mode 100755 index 000000000..51869986b --- /dev/null +++ b/utils/rebase-translations.sh @@ -0,0 +1,27 @@ +#!/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 --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 -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'` + +update_lang() { + if [ -f $1.po ]; then + msgmerge --no-wrap --width 1 -U $1.po $TEMPLATE + msgfmt --statistics $1.po -o $1.mo + else + echo "Usage: $0 [-p|]" + fi +} + +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 +done + +#./utils/update-js-translations.sh diff --git a/utils/update-translations.sh b/utils/update-translations.sh deleted file mode 100755 index 51869986b..000000000 --- a/utils/update-translations.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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 --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 -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'` - -update_lang() { - if [ -f $1.po ]; then - msgmerge --no-wrap --width 1 -U $1.po $TEMPLATE - msgfmt --statistics $1.po -o $1.mo - else - echo "Usage: $0 [-p|]" - fi -} - -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 -done - -#./utils/update-js-translations.sh -- cgit v1.2.3