DataObjects/Core_template.php
authorAlan Knowles <alan@roojs.com>
Fri, 4 Dec 2020 04:18:34 +0000 (12:18 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 4 Dec 2020 04:18:34 +0000 (12:18 +0800)
DataObjects/Core_template.php

index 6da17f7..4e8fef4 100644 (file)
@@ -398,7 +398,7 @@ WHERE (
 */
 
     
-    function genGetText($clsname, $lang)
+    function genGetText($clsname, $lang=false)
     {
         // only supports pman ?
         $clsname = strtolower($clsname);
@@ -427,12 +427,15 @@ WHERE (
         if ($this->version) {
             $compileDir .= '.' . $ff->version;
         }
+        $lang = $lang ? $lang : $ff->locale;
+        $fn = "{$compileDir}/{$lang}/LC_MESSAGES";
+        $fd = "{$fn}/{$clsname}.po";
         
-        /fr_FR/LC_MESSAGES
+        setlocale(LC_MESSAGES, $lang); 
+        bindtextdomain($clsname, $fd);
+        textdomain($clsname);
         
-        
-        
-        $gt = File_Gettext::factory('MO', $filename);
+        $gt = File_Gettext::factory('MO', $fd);
         $git->fromArray(
             
             array(