Jahia DX > Module internationalization

0 (0 Good)
0 (0 Bad)

Module internationalization

by  alexandre »  2011/06/07 18:05

Hello,

I managed to create several modules using the provided maven archetype, all my modules work fine but i would now like to internationalize them, i looked at the SDK documentation to internationalize my cnd file but it doesnt work, i also tried to put some internationalized text in the jsp page but without any success.

I looked at other modules I found in the Jahia subversion repository and figured out the way to do it was the following :

In the ressource folder i created 3 properties files :
- moduleName.properties
- moduleName_fr
- moduleName_en

They all contain :

moduleName.message=The message for each language

In the jsp page of my module i added a line to test the internationalization : 

<fmt:message key="moduleName.message" />

of course i declared the fmt taglib : 

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

After deploying with maven and even restarting Jahia, i can't have my international field working.

Something that bothers me is that i can't find any place to declare my properties files like i was doing with the good old Jahia 5, i'm surely doing something wrong and i hope you guys could tell me what it is.

Thanks in advance

  • Module internationalization
    2011/06/30 14:52

    alexandre <p> Hello,<br /> <br /> I managed to create several modules using the provided maven archetype, all my modules work fine but i would now like to internationalize them, i looked at the SDK documentation to internationalize my cnd file but it doesnt work, i also tried to put some internationalized text in the jsp page but without any success.<br /> <br /> I looked at other modules I found in the Jahia subversion repository and figured out the way to do it was the following :<br /> <br /> In the ressource folder i created 3 properties files :<br /> - moduleName.properties<br /> - moduleName_fr<br /> - moduleName_en<br /> <br /> They all contain :</p> <pre class="p1"> moduleName.message=The message for each language In the jsp page of my module i added a line to test the internationalization : &lt;fmt:message key=&quot;moduleName.message&quot; /&gt; of course i declared the fmt taglib : &lt;%@ taglib prefix=&quot;fmt&quot; uri=&quot;http://java.sun.com/jsp/jstl/fmt&quot; %&gt;</pre> <p class="p1"> After deploying with maven and even restarting Jahia, i can&#39;t have my international field working.</p> <p class="p1"> Something that bothers me is that i can&#39;t find any place to declare my properties files like i was doing with the good old Jahia 5, i&#39;m surely doing something wrong and i hope you guys could tell me what it is.</p> <p class="p1"> Thanks in advance</p>

  • Number of messages  9
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Module internationalization

    by  shuber »  2011/06/07 18:05

    Hello Alexandre,

    You need to be careful with the naming of your resource files. They need to be the same (with capitalization correct) as the modules <name> tag exception for the spaces that must be removed. So for example for the following name in pom.xml 

    <name>Jahia Article</name>

    The name of the file must be : 

    JahiaArticle.properties

    Regards,

    Serge Huber.

    Serge Huber (shuber)

    Number of messages  271
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: Module internationalization

    by  alexandre »  2011/06/07 18:05

    Thanks for your precise answer,
    it works perfectly now,
    i was struggling with this problew for days =)
  • Re: Module internationalization
    2011/06/07 18:05

    alexandre Thanks for your precise answer,<br/>it works perfectly now,<br/>i was struggling with this problew for days =)

  • Number of messages  9
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Module internationalization

    by  shuber »  2011/06/07 18:06

    Yes it's tricky. We wanted to change that but we didn't get around to it yet smiley But it will be documented in the integrator/template documentation.

    Regards,
    Serge Huber.

    Serge Huber (shuber)

    Number of messages  271
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page