cancel
Showing results for 
Search instead for 
Did you mean: 

localization bug?

Bauke_Roo
Star Contributor
Star Contributor

Hi There,

I'm trying to append a few labels to the dutch translation. However this does not work.

This is my messages_nl.properties which I need to append:

# lines for chat

label.context.menu.chat.with=Chat
label.context.menu.call.with=Bel

This is the part of my deployment-fragment.xml

 <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_nl.properties"
                to="nuxeo.war/WEB-INF/classes/messages_nl.properties" addNewLine="true"/>

It does work for messages_en.properties

Is this a bug?

Edit: extra info, I'm using Nuxeo 5.8 with HF's installed.

Thanks in advance, Bauke Roo

1 ACCEPTED ANSWER

Laurent_Doguin
Star Collaborator
Star Collaborator

Hi,

Since Nuxeo 5.8, the messages files have moved from a two-letter scheme to a four-letter one. So your deployment-fragment.xml should look like:

<?xml version="1.0"?>
<fragment version="1">
   <require>org.nuxeo.ecm.platform.lang.ext</require>
   <install>
     <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_nl.properties"
            to="nuxeo.war/WEB-INF/classes/messages_nl.properties" addNewLine="true"/>
     <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_nl.properties"
            to="nuxeo.war/WEB-INF/classes/messages_nl_NL.properties" addNewLine="true"/>
   </install>
</fragment>

As Anahide told me, adding the good require tag in the deployment-fragment should make sure the file you want to append text to is actually here. This is a first requirement for this to work 🙂

The two letter file is used as a fallback in case the browser does not know what to do with a four letter code like nl_NL. They are both identical so you need to append your changes to both files to be consistent.

As for the english file, its behavior is a little different as it's maintained by Nuxeo. But it will soon use the same behavior.

View answer in original post

2 REPLIES 2

Laurent_Doguin
Star Collaborator
Star Collaborator

Hi,

Since Nuxeo 5.8, the messages files have moved from a two-letter scheme to a four-letter one. So your deployment-fragment.xml should look like:

<?xml version="1.0"?>
<fragment version="1">
   <require>org.nuxeo.ecm.platform.lang.ext</require>
   <install>
     <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_nl.properties"
            to="nuxeo.war/WEB-INF/classes/messages_nl.properties" addNewLine="true"/>
     <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_nl.properties"
            to="nuxeo.war/WEB-INF/classes/messages_nl_NL.properties" addNewLine="true"/>
   </install>
</fragment>

As Anahide told me, adding the good require tag in the deployment-fragment should make sure the file you want to append text to is actually here. This is a first requirement for this to work 🙂

The two letter file is used as a fallback in case the browser does not know what to do with a four letter code like nl_NL. They are both identical so you need to append your changes to both files to be consistent.

As for the english file, its behavior is a little different as it's maintained by Nuxeo. But it will soon use the same behavior.

Bauke_Roo
Star Contributor
Star Contributor

Hi Laurent,

Thanks, I didn't have the requiretag properly. (I had it like this, but that didn't work)

<require>org.nuxeo.ecm.platform.lang</require>

But with the following it works fine 🙂

<require>org.nuxeo.ecm.platform.lang.ext</require>

Bauke Roo

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.