{"issue":{"created_at":"2011-11-29T17:20:37Z","state":"open","updated_at":"2011-11-29T17:20:39Z","user":{"gravatar_id":"7ca7554b516e2f5476d823cc2eca706a","id":734684,"url":"https://api.github.com/users/LeoUnglaub","avatar_url":"https://secure.gravatar.com/avatar/7ca7554b516e2f5476d823cc2eca706a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"LeoUnglaub"},"comments":2,"body":"Hallo Leo,\nich entwickle gerade ein Modul mit dem man Sprachfiles über das BE überschreiben kann. Quasi eine grafische Version der langconf.php. \n\nIch möchte aber trotzdem, dass die langconf.php noch nach meinen Änderungen eingelesen wird um das TYPOlight Prinzip beizubehalten. Um das zu bewerkstelligen bräuchte ich einen HOOK in der Methode loadLanguageFile(). Ich bräuchte den Hook an der durch einen Kommentar gekenzeichneten Stelle.\n\n```\nprotected function loadLanguageFile($strName, $strLanguage=false)\n{\n\tif (!$strLanguage)\n\t{\n\t\t$strLanguage = $GLOBALS['TL_LANGUAGE'];\n\t}\n\n\tforeach ($this->Config->getActiveModules() as $strModule)\n\t{\n\t\t$strFallback = sprintf('%s/system/modules/%s/languages/en/%s.php', TL_ROOT, $strModule, $strName);\n\n\t\tif (file_exists($strFallback))\n\t\t{\n\t\t\tinclude($strFallback);\n\t\t}\n\n\t\tif ($strLanguage == 'en')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t$strFile = sprintf('%s/system/modules/%s/languages/%s/%s.php', TL_ROOT, $strModule, $strLanguage, $strName);\n\n\t\tif (file_exists($strFile))\n\t\t{\n\t\t\tinclude($strFile);\n\t\t}\n\t}\n    \n    // der HOOK preLoadLanguageFile\n\n\tinclude(TL_ROOT . '/system/config/langconfig.php');\n}\n```\n\nIch hoffe das lässt sich in TL 2.7.6 integrieren, denn der HOOK wäre wichtig für mich. Das wäre sehr nett von dir.\nVielen Dank und viele Grüße\nLeo\n\n--- _Originally created on October 11th, 2009, at 02:04am (ID 1083)_","assignee":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"leofeyer"},"id":2388156,"number":1083,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"Feature","color":"4183c4","url":"https://api.github.com/repos/contao/import/labels/Feature"},{"name":"framework","color":"e6e6e6","url":"https://api.github.com/repos/contao/import/labels/framework"}],"title":"HOOK: preLoadLanguageFile","closed_at":null,"html_url":"https://github.com/contao/import/issues/1083","url":"https://api.github.com/repos/contao/import/issues/1083","milestone":{"created_at":"2011-11-29T15:29:32Z","state":"open","closed_issues":106,"due_on":null,"creator":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"leofeyer"},"number":9,"description":"TYPOlight 2.8.0 (minor release)","title":"2.8.0","url":"https://api.github.com/repos/contao/import/milestones/9","open_issues":1}},"action":"created","comment":{"created_at":"2011-11-29T17:20:39Z","updated_at":"2011-11-29T17:20:39Z","user":{"gravatar_id":"256406243346b9253f8610fb1d1e05f6","id":1215373,"url":"https://api.github.com/users/importer","avatar_url":"https://secure.gravatar.com/avatar/256406243346b9253f8610fb1d1e05f6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"importer"},"body":"ich vermute dass dies nicht funktionieren wird, da ja der call loadLanguageFile() irgendwo passieren kann.\n\nBeispielszenario:\n1. Modul Initialisierung mit der von dir Vorgeschlagenen Herangehensweise via include langconfig.\n2. Modul XY arbeitet irgendwas (z.B. weil dynamischer content das benoetigt) via \n\n```\n// $foo == eine Kategorie oder aehnliches.\n$this->loadLanguageFile('mylangdefs_' . $foo);\n```\n\nDieser Aufruf macht nun die Eintraege von leo dank der langconfig.php wieder \"platt\".\n\n(unschoene) Alternative waere nun, einen \"include(TL_ROOT . 'system/modules/leomodule/startup.php')\" call ganz unten in langconfig.php abzulegen.\nDadurch koennte man den HOOK umgehen, aber das Problem ist nicht befriedigend geloest.\n\nIch vermute der Hook sollte in etwa wie folgt aussehen:\nsystem/libraries/System.php (@321):\n\n```\n+foreach ($GLOBALS['TL_HOOKS']['loadLanguageFile'] as $callback)\n+{\n+    $this->import($callback[0]);\n+    $strOutput .= $this->$callback[0]->$callback[1]($strName, $strLanguage);\n+}\n```\n\n--- _Originally created by xtra on October 13th, 2009, at 06:32am_","id":2936756,"url":"https://api.github.com/repos/contao/import/issues/comments/2936756"}}