I'm having a problem with the languages.
I'm developing two modules, one is the foundation it contains a lot of classes I want to reuse. These classes also handle some output so I include some $module->Lang(_) statements. Where $module is the current active module.
This works fine when testing in the foundation module. The en_US contains all the translations for this module. However once I start using the classes from the foundation modules from other modules the lang() function will no longer see the translation from the foundation module file.
I don't want to copy the foundation translations into every module I want to use it in. Is there a way to reference the translations from the foundation class in a absolute way?
Rephrase: Can you access the language array from module B from module A
Much appreciated,
Jeroen
using language files of other modules
Re: using language files of other modules
From your second module you can use either
or
to get a reference to the other module object.
You should then be able to call $modA->Lang('langstr');
Regards,
D
Code: Select all
$modA =& $this->cms->modules['ModuleA']['object'];
Code: Select all
$modA =& $this->getModuleInstance('ModuleA');
You should then be able to call $modA->Lang('langstr');
Regards,
D