cancel
Showing results for 
Search instead for 
Did you mean: 

Can't append custom translations to messages properties file

ciberg_
Champ in-the-making
Champ in-the-making

I need to create a custom translation for Nuxeo DM.

I created a bundle to deploy the files but append doesn't work.

I tried the following in deployment-fragment.xml:

Try number 1:

    <unzip from="${bundle.fileName}" to="/" prefix="web">
        <include>/web/nuxeo.war/**</include>
    </unzip>
	<delete path="language.tmp" />
	<mkdir path="language.tmp" />
	<unzip from="${bundle.fileName}" to="language.tmp" prefix="web">
        <include>/web/language/**</include>
    </unzip>
	<append from="language.tmp/language/messages_en.properties"
		to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true" />

try number 2:

<unzip from="${bundle.fileName}" to="/" prefix="web">
  <include>web/nuxeo.war/**</include>
</unzip>

<delete path="${bundle.fileName}.tmp" />
<mkdir path="${bundle.fileName}.tmp" />
<unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" />

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

Deploying any of the above will unzip the contents to the right places, so the bundle works, I can even put new files on the deployment but no appending to existing files is done.

Supposely the append command should add the lines from the unzipped file to the messages properties files, but nothing happens although the files are correctly unzipped. There is no error in the server.log file.

I created the bundle following the cookbook example from nuxeo documentation, build the jar using maven and put the jar on the plugins folder.

I'm getting desperate, can you help me.

1 ACCEPTED ANSWER

ciberg_
Champ in-the-making
Champ in-the-making

@patrek: Yes, I look into the file under nxserver/nuxeo.war/WEB-INF/classes/messages_en.properties and nothing changes.

Where do I need to put the overriden.contribution sentence? Is it in the deployment-fragment.xml file?

@Julien Carsique: I use the same code and nothing happens. The customized messages_en.properties file is in the following folder of the bundle structure:

/src/main/resources/OSGI-INF/l10n

I assume this is the correct location.

View answer in original post

4 REPLIES 4

patrek
Star Contributor
Star Contributor

Did you look into the file under nxserver/nuxeo.war/WEB-INF/classes/messages_en.properties ?

Are you trying to override the translation? In that case, you need to add a <required>overriden.contribution</required> to make sure your translation appears after the original sentences.

Julien_Carsique
Elite Collaborator
Elite Collaborator

Hello,

The following is appending translations from the bundle to "nuxeo.war/WEB-INF/classes/messages_en.properties":

  <install>
    <unzip from="${bundle.fileName}" to="/" prefix="web">
      <include>web/nuxeo.war/**</include>
    </unzip>
    <!-- translations -->
    <delete path="${bundle.fileName}.tmp" />
    <mkdir path="${bundle.fileName}.tmp" />
    <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_en.properties"
      to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true" />
    <delete path="${bundle.fileName}.tmp" />
  </install>

ciberg_
Champ in-the-making
Champ in-the-making

@patrek: Yes, I look into the file under nxserver/nuxeo.war/WEB-INF/classes/messages_en.properties and nothing changes.

Where do I need to put the overriden.contribution sentence? Is it in the deployment-fragment.xml file?

@Julien Carsique: I use the same code and nothing happens. The customized messages_en.properties file is in the following folder of the bundle structure:

/src/main/resources/OSGI-INF/l10n

I assume this is the correct location.

Where do I need to put the &lt;required&gt;overriden.contribution&lt;/required&gt; sentence? Is it in the deployment-fragment.xml file?

Getting started

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.