/**
  * Override localization file
  *
  * This method merges the content of the override file with the default file
  *
  * @param string $fileReference
  * @param string $languageKey
  * @param string $charset
  * @param int $errorMode
  * @param array $LOCAL_LANG
  * @return void
  */
 protected function localizationOverride($fileReference, $languageKey, $charset, $errorMode, array &$LOCAL_LANG)
 {
     $overrides = array();
     $fileReferenceWithoutExtension = $this->store->getFileReferenceWithoutExtension($fileReference);
     $locallangXMLOverride = $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'];
     foreach ($this->store->getSupportedExtensions() as $extension) {
         if (isset($locallangXMLOverride[$languageKey][$fileReferenceWithoutExtension . '.' . $extension]) && is_array($locallangXMLOverride[$languageKey][$fileReferenceWithoutExtension . '.' . $extension])) {
             $overrides = array_merge($overrides, $locallangXMLOverride[$languageKey][$fileReferenceWithoutExtension . '.' . $extension]);
         } elseif (isset($locallangXMLOverride[$fileReferenceWithoutExtension . '.' . $extension]) && is_array($locallangXMLOverride[$fileReferenceWithoutExtension . '.' . $extension])) {
             $overrides = array_merge($overrides, $locallangXMLOverride[$fileReferenceWithoutExtension . '.' . $extension]);
         }
     }
     if (!empty($overrides)) {
         foreach ($overrides as $overrideFile) {
             $languageOverrideFileName = GeneralUtility::getFileAbsFileName($overrideFile);
             ArrayUtility::mergeRecursiveWithOverrule($LOCAL_LANG, $this->getParsedData($languageOverrideFileName, $languageKey, $charset, $errorMode, TRUE));
         }
     }
 }