I'm creating a module but I need it to be multilingual. I know that I can create field params, duplicate the module, and set different values for these params based on the languague but I would like to know if there's any way to use Language Constant like we do with components.
Yes, you set them up in a similar way to components.
In your module directory create a folder
language, and then a subfolder for the language within that, and into that subfolder put your language INI file(s). If your module is called
Inside your module xml file include the language folder within a
<languages> section (updated from within a
<files> section based on the comment from Sharky below):
<languages folder="language"> <language tag="en-GB">en-GB/en-GB.mod_example.ini</language> <language tag="es-ES">es-ES/es-ES.mod_example.ini</language> </languages>
Then in your module you can use language strings in the usual way: