]> git.mxchange.org Git - friendica.git/blobdiff - include/pgettext.php
Merge pull request #3976 from rabuzarus/20171126_-_acl_forum
[friendica.git] / include / pgettext.php
index 756905a43a1bfb760e4f7d5e29aaab3bbafcb701..2e902a6ab0c2bbfd39bd2b8068474120a1c8a654 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * @brief translation support
  *
- * Get the language setting directly from system variables, bypassing get_config()
+ * Get the language setting directly from system variables, bypassing Config::get()
  * as database may not yet be configured.
  *
  * If possible, we use the value from the browser.
@@ -91,7 +91,6 @@ function pop_lang() {
        $lang = $a->langsave;
 }
 
-
 // l
 
 if (! function_exists('load_translation_table')) {
@@ -107,13 +106,11 @@ function load_translation_table($lang) {
 
        $a->strings = array();
        // load enabled plugins strings
-       $plugins = q("SELECT name FROM addon WHERE installed=1;");
-       if ($plugins!==false) {
-               foreach ($plugins as $p) {
-                       $name = $p['name'];
-                       if (file_exists("addon/$name/lang/$lang/strings.php")) {
-                               include("addon/$name/lang/$lang/strings.php");
-                       }
+       $plugins = dba::select('addon', array('name'), array('installed' => true));
+       while ($p = dba::fetch($plugins)) {
+               $name = $p['name'];
+               if (file_exists("addon/$name/lang/$lang/strings.php")) {
+                       include("addon/$name/lang/$lang/strings.php");
                }
        }