From: Alan Knowles Date: Fri, 4 Dec 2020 04:53:42 +0000 (+0800) Subject: DataObjects/Core_template.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=5c63d777c83968af7c6ba3ff028531a1bf6c9085 DataObjects/Core_template.php --- diff --git a/DataObjects/Core_template.php b/DataObjects/Core_template.php index 3f50a252..c9772e27 100644 --- a/DataObjects/Core_template.php +++ b/DataObjects/Core_template.php @@ -437,7 +437,7 @@ WHERE ( } $lang = $lang ? $lang : $ff->locale; $fdir = "{$compileDir}/{$lang}/LC_MESSAGES"; - $fname = "{$fdir}/{$clsname}.po"; + $fname = "{$fdir}/{$clsname}.mo"; var_dump( " setlocale(LC_MESSAGES, $lang); @@ -480,7 +480,7 @@ WHERE ( } require_once 'File/Gettext.php'; - $gt = File_Gettext::factory('PO', $fname); + $gt = File_Gettext::factory('PO', preg_replace('/\.mo$/', '.po', $fname)); $gt->fromArray( array( @@ -495,7 +495,22 @@ WHERE ( ); $gt->save(); - + require_once 'File/Gettext.php'; + $gt = File_Gettext::factory('MO', $fname); + $gt->fromArray( + + array( + 'meta' => array( + 'Content-Type' => 'text/plain; charset=UTF-8\n', + //'Last-Translator' => 'Michael Wallner ', + 'PO-Revision-Date' => date('Y-m-d H:iO'), + //'Language-Team' => 'German ', + ), + 'strings' => $words + ) + + ); + $gt->save(); } } \ No newline at end of file