error out if language is not available
authorAlan Knowles <alan@roojs.com>
Mon, 11 Jan 2021 06:15:13 +0000 (14:15 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 11 Jan 2021 06:15:13 +0000 (14:15 +0800)
DataObjects/Core_template.php

index 684d90a..fcc2ddd 100644 (file)
@@ -415,7 +415,13 @@ WHERE (
         }
         
         putenv("LANGUAGE=$lang");
-        setlocale(LC_ALL, $lang);
+        if (!setlocale(LC_ALL, $lang)) {
+            if (!setlocale(LC_ALL, $lang.'UTF8')) {
+                $ff->page->jerr("Language is not available {$lang}");
+            }
+        }
+        
+        
         $d = DB_DataObject::factory($this->tableName());
         $d->whereAdd("
             LOWER(