cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with internationalization in "user_preferences.xhtml" view

geekonspace
Star Contributor
Star Contributor

When I select locale=English, the dropbox menu options at right is showed in spanish and when I select locale=Spanish the dropbox menu options at right is showed in English. The action button is translated correctly but its options are not translate correctly.

Attached an image

alt text

I am using nuxeo 5.6 and certainly, you do not have translation for spanish. In my plugin I did this translation and in my messages.properties file I added those lines:

label.userPreferences.updateLocale=Edit Locale Settings
label.userPreferences.resetTimeZone=Reset time zone from

and in my messages_es.properties file, I added thoses lines:

label.userPreferences.updateLocale=Editar la configuración regional
label.userPreferences.resetTimeZone=Cambiar zona horaria

Deploy fragment:

<?xml version="1.0"?>

<fragment version="1">
  <require>org.nuxeo.ecm.webapp.core</require>
  <require>org.nuxeo.ecm.platform.lang</require>

  <install>

    <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_es.properties"
            to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_fr.properties" 
            to="nuxeo.war/WEB-INF/classes/messages_fr.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages.properties" 
            to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true" />
    <delete path="${bundle.fileName}.tmp" />
 
    
  </install>
</fragment>

another question is: where can I translate this section in the view user_preferences.xhtml? Locale settings Español Time Zone Etc/UTC - Hora Universal Coordinada

1 ACCEPTED ANSWER

Thomas_Roger
Star Contributor
Star Contributor

You are adding your spanish translations to the wrong file (messages_en.properties). Here is a fixed deployment-fragment.xml:

<?xml version="1.0"?>

<fragment version="1">
  <require>org.nuxeo.ecm.webapp.core</require>
  <require>org.nuxeo.ecm.platform.lang</require>

  <install>

    <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_es.properties"
            to="nuxeo.war/WEB-INF/classes/messages_es.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_fr.properties" 
            to="nuxeo.war/WEB-INF/classes/messages_fr.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages.properties" 
            to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true" />
    <delete path="${bundle.fileName}.tmp" />

  </install>
</fragment>

The labels you are looking for to translate "Locale settings" and "Time Zone" are:

label.userpreferences.locale=Locale settings
label.userpreferences.timezone=Time Zone

The labels for the user preferences / user profile can be found in this file

View answer in original post

6 REPLIES 6

Thomas_Roger
Star Contributor
Star Contributor

Hi,

geekonspace
Star Contributor
Star Contributor

Hi, I edited my question

Thomas_Roger
Star Contributor
Star Contributor

Can you add the content of your deployment-fragment.xml file?

geekonspace
Star Contributor
Star Contributor

done what you need

Thomas_Roger
Star Contributor
Star Contributor

You are adding your spanish translations to the wrong file (messages_en.properties). Here is a fixed deployment-fragment.xml:

<?xml version="1.0"?>

<fragment version="1">
  <require>org.nuxeo.ecm.webapp.core</require>
  <require>org.nuxeo.ecm.platform.lang</require>

  <install>

    <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_es.properties"
            to="nuxeo.war/WEB-INF/classes/messages_es.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_fr.properties" 
            to="nuxeo.war/WEB-INF/classes/messages_fr.properties" addNewLine="true" />
    <append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages.properties" 
            to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true" />
    <delete path="${bundle.fileName}.tmp" />

  </install>
</fragment>

The labels you are looking for to translate "Locale settings" and "Time Zone" are:

label.userpreferences.locale=Locale settings
label.userpreferences.timezone=Time Zone

The labels for the user preferences / user profile can be found in this file

ohh thanks, and I found the other labels to translate

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.