소스 검색

Don't load the other language if it's already loaded

Julio Montoya 13 년 전
부모
커밋
eba2c1c6c9
1개의 변경된 파일14개의 추가작업 그리고 11개의 파일을 삭제
  1. 14 11
      main/inc/lib/plugin.lib.php

+ 14 - 11
main/inc/lib/plugin.lib.php

@@ -148,23 +148,26 @@ class AppPlugin {
 
         //1. Loading english if exists 
         $english_path = $root.$plugin_name."/lang/english.php";  
-
+        
         if (is_readable($english_path)) {                        
-            include $english_path;
-            foreach ($strings as $key => $string) {                            
+            include $english_path;            
+            foreach ($strings as $key => $string) {                                            
                 //$$key = $string;
-                $GLOBALS[$key] = $string;                     
+                $GLOBALS[$key] = $string;                
             }                        
         }
 
         //2. Loading the system language
-        $path = $root.$plugin_name."/lang/$language_interface.php";                    
-        if (is_readable($path)) {
-            include $path;
-            if (!empty($strings)) {                
-                foreach ($strings as $key => $string) {
-                    //$$key = $string;
-                    $GLOBALS[$key] = $string;                                           
+        if ($language_interface != 'english') {
+            $path = $root.$plugin_name."/lang/$language_interface.php";
+            
+            if (is_readable($path)) {
+                include $path;
+                if (!empty($strings)) {                
+                    foreach ($strings as $key => $string) {
+                        //$$key = $string;
+                        $GLOBALS[$key] = $string;                                           
+                    }
                 }
             }
         }