Permit custom locations for localization files (XLIFF file handling in llXmlAutoFileName)
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:
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.
#1 Updated by Ingo Kasch about 6 years ago
Just wanted to draw attention to this issue again. I'm currently working on a project using the most recent TYPO3 6.1.3 and this issue is still present. In my case I use XLIFF localization files in an extension, which are located in the "fileadmin" folder (Exactly the usecase descripted in the initial post).
After applying the attached patch everything is working as expected.