{"action":"opened","issue":{"url":"https://api.github.com/repos/lochmueller/autoloader/issues/19","labels_url":"https://api.github.com/repos/lochmueller/autoloader/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lochmueller/autoloader/issues/19/comments","events_url":"https://api.github.com/repos/lochmueller/autoloader/issues/19/events","html_url":"https://github.com/lochmueller/autoloader/issues/19","id":115268198,"number":19,"title":"Add locallang/language override loader","user":{"login":"mbrodala","id":5037116,"avatar_url":"https://avatars.githubusercontent.com/u/5037116?v=3","gravatar_id":"","url":"https://api.github.com/users/mbrodala","html_url":"https://github.com/mbrodala","followers_url":"https://api.github.com/users/mbrodala/followers","following_url":"https://api.github.com/users/mbrodala/following{/other_user}","gists_url":"https://api.github.com/users/mbrodala/gists{/gist_id}","starred_url":"https://api.github.com/users/mbrodala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbrodala/subscriptions","organizations_url":"https://api.github.com/users/mbrodala/orgs","repos_url":"https://api.github.com/users/mbrodala/repos","events_url":"https://api.github.com/users/mbrodala/events{/privacy}","received_events_url":"https://api.github.com/users/mbrodala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-05T11:50:31Z","updated_at":"2015-11-05T11:50:31Z","closed_at":null,"body":"It would be nice to have a autoloader for locallang/language overrides.\r\n\r\nNormally one must add something like this in the `ext_localconf.php`:\r\n\r\n```php\r\n$TYPO3_CONF_VARS['SYS']['locallangXMLOverride']['default']['EXT:foo/Resources/Private/Language/locallang.xlf'][] = 'EXT:bar/Resources/Private/Language/Path/To/Foo/locallang.xlf';\r\n\r\n$TYPO3_CONF_VARS['SYS']['locallangXMLOverride']['de']['EXT:foo/Resources/Private/Language/locallang.xlf'][] = 'EXT:bar/Resources/Private/Language/Path/To/Foo/de.locallang.xlf';\r\n```\r\n\r\nI'd suggest that language overrides must be placed in `Resources/Private/Language/Overrides/ExtensionName/original/path/to/locallang.xlf`.\r\n\r\nWith this, the loader could deduce the extension name via `GeneralUtility::camelCaseToLowerCaseUnderscored()` and use the path after `Resources/Private/Language/Overrides/ExtensionName/` for the original file path. The language key could be taken from the file prefix of XLIFF files. Examples:\r\n\r\n* `Resources/Private/Language/Overrides/FooBar/mod1/locallang_mod.xlf` yields \r\n  `$TYPO3_CONF_VARS['SYS']['locallangXMLOverride']['default']['EXT:foo_bar/Resources/Private/Language/Overrides/FooBar/mod1/locallang_mod.xlf'][] = 'EXT:my_extension/mod1/locallang_mod.xlf';`\r\n* `Resources/Private/Language/Overrides/FooBar/mod1/de.locallang_mod.xlf` yields \r\n  `$TYPO3_CONF_VARS['SYS']['locallangXMLOverride']['de']['EXT:foo_bar/mod1/locallang_mod.xlf'][] = 'EXT:my_extension/Resources/Private/Language/Overrides/FooBar/mod1/de.locallang_mod.xlf';`\r\n* `Resources/Private/Language/Overrides/Qux/Resources/Private/Language/locallang.xlf` yields \r\n  `$TYPO3_CONF_VARS['SYS']['locallangXMLOverride']['de']['EXT:qux/mod1/Resources/Private/Language/locallang.xlf'][] = 'EXT:my_extension/Resources/Private/Language/Overrides/Qux/Resources/Private/Language/locallang.xlf';`\r\n\r\nIt could be argued that the last example is unnecessarily verbose but it should be this way for consistency. If at one point in the future every extension sticks to `Resources/Private/Language`, this could be simplified a lot."}}