From: Antoine Musso Date: Tue, 16 Aug 2005 21:26:42 +0000 (+0000) Subject: * pot generation in a function X-Git-Tag: 1.6.0~1932 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=ab9601e4b53b5e2d7e3987ea11fa34273864cc99;p=lhc%2Fweb%2Fwiklou.git * pot generation in a function * source file path relative to $IP --- 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";