I have translations for a module. I created the message_es.properties file and added it to the module’s resource folder. Everything has been translated but when I choose the “spanish” at the bottom of the page my translations don’t show up. Why is this? How can I add my translation?
Hi Vicente
Have you added the locale and the name of the translation file to your module’s config.xml file? See below for what this looks like:
en messages.propertiesYou’ll need to add an additional messages tag for the es locale and message_es.properties file.
Ali
Ali Habib Chief Executive Officer Interactive Health Solutions Ph: +92-21-34327697 ali.habib@irdresearch.org
1 Like
Ah. I had written this:
<lang>en</lang> <lang>es</lang> <file>messages.properties</file>
And I changed it to:
<lang>en</lang> <file>messages.properties</file> <lang>es</lang> <file>messages_es.properties</file>
And it worked. Thank you!
I know it works for you but the correct thing to do is to define each lang and file in a separate messages tag as seen below
<messages>
<lang>en</lang>
<file>messages.properties</file>
</messages>
<messages>
<lang>es</lang>
<file>messages_es.properties</file>
</messages>
1 Like