
Felix J. Ogris schrieb:
Oliver Tappe (ot@otrs.com) wrote:
Ah, you are right of course. I was not precise enough - what I should have been saying is that OTRS always loads all Language modules matching the current language. So if the user is currently surfing the FAQ-module in German, the de_* files for all other modules would be loaded, too, even if they are not used at all by the current HTTP-request.
How are you going to tell Kernel::Language which language subset you need for the current request? Kernel::Language is instanced from Kernel::Output::HTML::Layout. So either Kernel::Language evaluates the current action parameter,
that probably wouldn't be enough, as it would still be possible for other modules' translations to be required (e.g. for toplevel icon names). It would be difficult to find out which ones just by looking at the action parameter.
or the frontend modules in Kernel/Modules/ provide each call of LayoutObject->Output() with that extra information.
Well, kind of. Every invocation of Kernel::Language::Get() would have to provide a context along with the string that's to be translated. This context would be useful for separating multiple occurrences of the same phrase (with different translations), too. As part of that context, the originating module could be specified. But this clearly is future stuff. cheers, Oliver