Reputation: 1697
This article is about adding language management to Joomla components. I tried this for modules but that tutorial does not work for modules. How can I add language management to modules?
Upvotes: 0
Views: 60
Reputation: 1345
In the installation zip file of your module include a language
folder containing the language files you want, named like this:
bg-BG.mod_mymodule.ini
, de-DE.mod_mymodule.ini
etc.
Then in the installation mod_mymodule.xml
include a language section like this:
<languages folder="language">
<language tag="bg-BG">bg-BG.mod_mymodule.ini</language>
<language tag="de-DE">de-DE.mod_mymodule.ini</language>
</languages>
To use the above, in the code of your module you echo JText
like this:
JText::_('MYMODULE_MY_STRING_HERE')
where MYMODULE_MY_STRINGHERE
is defined in the language .ini
files for each language like this:
MYMODULE_MY_STRINGHERE="What you want it to say"
Upvotes: 2