includeLLFile() now merges new read lables with former read automatically.
authorRené Fritz <r.fritz@colorcube.de>
Fri, 14 Nov 2003 14:33:34 +0000 (14:33 +0000)
committerRené Fritz <r.fritz@colorcube.de>
Fri, 14 Nov 2003 14:33:34 +0000 (14:33 +0000)
This is handy if your module use labels from the system modules with some own additions.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@59 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/lang/lang.php

index f27c18e..bea52f5 100755 (executable)
@@ -401,6 +401,7 @@ class language {
 
        /**
         * Includes locallang file (and possibly additional localized version if configured for)
+        * Read language labels will be merged with $LOCAL_LANG (if $setGlobal=1).
         * 
         * @param       string          $fileRef is a file-reference (see t3lib_div::getFileAbsFileName)
         * @param       boolean         Setting in global variable $LOCAL_LANG (or returning the variable)
@@ -414,19 +415,17 @@ class language {
                }
 
                        // Get default file:
-               $file = t3lib_div::getFileAbsFileName($fileRef);
-               if (@is_file($file))    {
-                               // Include main locallang file:
-                       include($file);
+               $llang = $this->readLLfile($fileRef);
+               
+               if (count($llang))      {
 
+                       $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG,$llang);
+                       
                                // Localized addition?
                        $lFileRef = $this->localizedFileRef($fileRef);
                        if ($lFileRef && (string)$LOCAL_LANG[$this->lang]=='EXT')       {
-                               $lfile = t3lib_div::getFileAbsFileName($lFileRef);
-                               if (@is_file($lfile))   {
-                                               // Include subfile:
-                                       include($lfile);
-                               }
+                               $llang = $this->readLLfile($fileRef);
+                               $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG,$llang);
                        }
                        
                                // Overriding file?