No description or website provided.
Pull request Compare This branch is even with corneltek:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Wrap command line scripts/compile_twig_template_i18n.php to PHP Class:

$cmd = " xgettext -j -o messages.po --from-code=UTF-8 -n --omit-header -L PHP -D $(find $cacheDir -type f -iname '*.php')";

echo "Combining messages..\n";
system('find locale -type f -iname "*.po" | while read pofile ; do msgcat messages.po $pofile >| $ ; mv -v $ $pofile ; done' );
echo "\n";

echo "Generating binary format file..\n";
msgfmt -v locale/zh_TW/LC_MESSAGES/phifty.po
system('find locale -type f -iname "*.po" | while read pofile ; do echo "Processing " $pofile ; msgfmt $pofile ; done' );

File Structure

  • src/ - class source code
  • tests/ - unit testing code
  • doc/ - documentation

API Synopsis

Parser locale strings into mo files

use GettextUtil\GettextParser;
$gettext = new GettextParser;
$success = $gettext->parse();  # get system return value.

To convert po files to mo files:

use GettextUtil\GettextFormatter;
$formatter = new GettextFormatter;

Merge Po files:

use GettextUtil\GettextPoFile;
$pofile = new GettextPoFile('messages.po');
$target_po = $pofile->mergeTo('path/to/target.po');
$target_po->formatMo();   // generate path/to/