I18n.php
authorAlan Knowles <alan@roojs.com>
Wed, 14 Dec 2011 09:00:55 +0000 (17:00 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 14 Dec 2011 09:00:55 +0000 (17:00 +0800)
I18n.php

index 1d5bd68..e55f027 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -89,10 +89,15 @@ class Pman_Core_I18N extends Pman
         $i = DB_DataObject::Factory('I18n');
         $i->ltype = 'l';                           // string(1)  not_null multiple_key
         $i->lkey = $lang;                            // string(8)  not_null
-        if (!$i->count()) {
-            
-            
-            $this->jerr('invalid lang configured: ' . $lang);
+        if (!$i->count()) {    
+            $i = DB_DataObject::Factory('I18n');
+            $i->buildDb();
+            $i = DB_DataObject::Factory('I18n');
+            $i->ltype = 'l';                           // string(1)  not_null multiple_key
+            $i->lkey = $lang;  
+            if (!$i->count()) { 
+                $this->jerr('invalid lang configured: ' . $lang);
+            }
         }