#47172Permit custom locations for localization files (XLIFF file handling in llXmlAutoFileName)
Description
Currently, when working with XLIFF localization files, the method \TYPO3\CMS\Core\Utility\GeneralUtility::llXmlAutoFileName() is used for determining the names of localization files other than the default language. Unfortunately the method restricts the valid locations for such files to the following directories:
- typo3/sysext/
- typo3/ext/
- typo3conf/ext/
- tests/
- (typo3_src/tests/)
In other words: Localization files are assumed to reside inside an extension (none of our installations has the test folder, so …). While I don’t understand the need to restrict the valid locations for localization files in general (anyone? do they any harm?), there exist some extensions (like e.g. formhandler) that encourage / require you to use custom localization files. However, as described above, the llXmlAutoFileName() prevents you from putting localization files into any other directory than the listed ones while using a format relying on automatic file name determination (= XLIFF, although the method name *llXml*AutoFileName suggests that the old llXML format might be affected as well) at the same time. My personal choice for files like this would definitely be the fileadmin directory … In any case, both
- creating an extension just for putting localization files into it as well as
- dismissing the XLIFF format just for the sake of the above restrictions
don’t seem viable options to me. Currently, if you want to use custom localization files inside / below e.g. the fileadmin folder, you’re stuck to the old llXML format, carrying mutliple languages in one single file. I surely don’t have to elaborate on the disadvantages of this pretty oldschool approach … (Btw. I’m not absolutely sure, but as far as I know these restrictions also apply to the f:translate viewhelper within fluid templates, again in conjunction with custom language files, which is quite a common use case for us. bummer as well …)
I suggest the llXmlAutoFileName() to be adapted in a way that either
- at least one fixed, neutral folder is being considered an additional valid location for localization files (e.g. the fileadmin directory, as assumed in the attached patch), or
- that one or even more such folders can be defined by the integrator (e.g. via the install tool), or
- that the restriction is dropped completely (if there are e.g. no security concerns).
Finally, this feature request seems somehow related to #34728.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.