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

index 871b7cd..874509b 100644 (file)
@@ -417,8 +417,47 @@ WHERE (
         if (! $d->find(true) ){
             return;
         }
-        var_dump($d);exit;
         
+        $gt = File_Gettext::factory('MO', $filename);
+        $git->fromArray(
+            
+               array(
+            'meta' => array(
+                'Content-Type'      => 'text/plain; charset=utf8',
+                //'Last-Translator'   => 'Michael Wallner <mike@iworks.at>',
+                'PO-Revision-Date'  => date('Y-m-d H:iO'),
+                //'Language-Team'     => 'German <mail@example.com>',
+            ),
+            'strings' => array(
+                'All rights reserved'   => 'Alle Rechte vorbehalten',
+                'Welcome'               => 'Willkommen',
+                // ...
+            )
+            
+        )
+        $gt->write();
+        
+        var_dump($d);exit;
+        /**
+     * fromArray
+     * 
+     * Assigns meta info and strings from an array of a structure like that:
+     * <code>
+     *   array(
+     *       'meta' => array(
+     *           'Content-Type'      => 'text/plain; charset=iso-8859-1',
+     *           'Last-Translator'   => 'Michael Wallner <mike@iworks.at>',
+     *           'PO-Revision-Date'  => date('Y-m-d H:iO'),
+     *           'Language-Team'     => 'German <mail@example.com>',
+     *       ),
+     *       'strings' => array(
+     *           'All rights reserved'   => 'Alle Rechte vorbehalten',
+     *           'Welcome'               => 'Willkommen',
+     *           // ...
+     *       )
+     *   )
+     * </code>
+     */
         
         
     }