From 2b8d695b49d9202c250d4a34844a1a6ceb2d48d0 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 00:12:28 -0400 Subject: tools/i18n_*: introduction of translation tools for tinyboard; supporting javascript i18n --- tools/i18n_extract.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tools/i18n_extract.php (limited to 'tools/i18n_extract.php') diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php new file mode 100755 index 00000000..1e729c3b --- /dev/null +++ b/tools/i18n_extract.php @@ -0,0 +1,47 @@ +#!/usr/bin/php + Date: Wed, 3 Jul 2013 01:24:09 -0400 Subject: i18n tools: small fixes --- tools/i18n_compile.php | 8 ++++---- tools/i18n_extract.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/i18n_extract.php') diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php index ce00051c..ba193767 100755 --- a/tools/i18n_compile.php +++ b/tools/i18n_compile.php @@ -34,11 +34,11 @@ foreach ($locales as $loc) { // Generate tinyboard.po if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; - `cd $locdir/LC_MESSAGES; - msgfmt tinyboard.po -o tinyboard.mo`; + passthru("cd $locdir/LC_MESSAGES; + msgfmt tinyboard.po -o tinyboard.mo"); // Generate javascript.po - `cd tools/inc/lib/jsgettext/; + passthru("cd tools/inc/lib/jsgettext/; php po2json.php -i ../../../../$locdir/LC_MESSAGES/javascript.po \ - -o ../../../../$locdir/LC_MESSAGES/javascript.js`; + -o ../../../../$locdir/LC_MESSAGES/javascript.js"); } diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php index 1e729c3b..b43e16a0 100755 --- a/tools/i18n_extract.php +++ b/tools/i18n_extract.php @@ -38,10 +38,10 @@ foreach ($locales as $loc) { // Generate tinyboard.po if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; - `cd $locdir/LC_MESSAGES; - xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)`; + passthru("cd $locdir/LC_MESSAGES; + xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)"); // Generate javascript.po - `cd tools/inc/lib/jsgettext/; - php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)`; + passthru("cd tools/inc/lib/jsgettext/; + php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)"); } -- cgit v1.3 From 0a6a982ae9f3418d905b1869a8f284f3c08b3382 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:37:48 -0400 Subject: i18n_extract tool: replace the bundled lib with gettext forced to assume python, since it extracts more strings --- tools/i18n_extract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/i18n_extract.php') diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php index b43e16a0..33650b50 100755 --- a/tools/i18n_extract.php +++ b/tools/i18n_extract.php @@ -42,6 +42,6 @@ foreach ($locales as $loc) { xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)"); // Generate javascript.po - passthru("cd tools/inc/lib/jsgettext/; - php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)"); + passthru("cd $locdir/LC_MESSAGES; + xgettext -d javascript -L Python --force-po --from-code utf-8 $join -c $(find ../../../../js/ -name \*.js)"); } -- cgit v1.3