Translations are not showing

translation
module
Tags: #<Tag:0x00007efd19e27968> #<Tag:0x00007efd19e27800>

(Vicente Bermúdez) #1

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?


(Ali Habib) #2

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.properties

You’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


(Vicente Bermúdez) #3

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!


(Wyclif Luyima) #4

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>