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

  (alexandre)

Number of messages  9
Registration date
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 =)

  (alexandre)

Number of messages  9
Registration date
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