From ab9601e4b53b5e2d7e3987ea11fa34273864cc99 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 16 Aug 2005 21:26:42 +0000 Subject: [PATCH] * pot generation in a function * source file path relative to $IP --- maintenance/lang2po.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/maintenance/lang2po.php b/maintenance/lang2po.php index 2976a7e5e9..dd9b014d33 100644 --- a/maintenance/lang2po.php +++ b/maintenance/lang2po.php @@ -15,7 +15,8 @@ define('ALL_LANGUAGES', true); define('XGETTEXT_BIN', 'xgettext'); define('MSGMERGE_BIN', 'msgmerge'); -define('XGETTEXT_OPTIONS', '-n --keyword=wfMsg '); +// used to generate the .pot +define('XGETTEXT_OPTIONS', '-n --keyword=wfMsg --keyword=wfMsgForContent '); define('LOCALE_OUTPUT_DIR', $IP.'/locale'); @@ -99,6 +100,18 @@ function generatePo($langcode, &$messages) { } } +function generatePot() { + global $IP; + $curdir = getcwd(); + chdir($IP); + exec( XGETTEXT_BIN + .' '.XGETTEXT_OPTIONS + .' -o '.LOCALE_OUTPUT_DIR.'/wfMsg.pot' + .' includes/*php' + ); + chdir($curdir); +} + function applyPot($langcode) { $langdir = LOCALE_OUTPUT_DIR.'/'.$langcode; @@ -114,11 +127,7 @@ function applyPot($langcode) { // Generate a template .pot based on source tree echo "Getting 'gettext' default messages from sources:"; -exec( XGETTEXT_BIN - .' '.XGETTEXT_OPTIONS - .' -o '.$IP.'/locale/wfMsg.pot' - .' '.$IP.'/includes/*php' - ); +generatePot(); echo "done.\n"; -- 2.20.1