cancel
Showing results for 
Search instead for 
Did you mean: 

Icon tip (mouse over) translation

patrek
Star Contributor
Star Contributor

When the interface is in French, in a list (like in a Workspace or Folder), if I hover over an item icon, I see the English version of the tip.

If I look at the produced html, the img tag contain the alt="Folder" and title="Folder" attributes.

For the document-type we created, we see a translated version.

Shouldn't we also see a translated version for the Main document-types? I checked and the values are present in the messages_fr.properties file.

Any ideas?

Affected types :

  • File : Fichier
  • Picture : Image
  • Folder : Dossier
  • Picturebook : Livre d'image
  • Workspace : Espace de travail
  • Ordered folder : Dossier ordonné
1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Waiting the correction You can create your own Content View with studio and create a template type widget that will displays the icon. This template will reuse the default template used for displaying the icon but for the alt value will use the #{messages[document.type]} and add keys into the message property into studio (Resources > I18n Files).

If I'm right here is the xhtml fragment used to display icon:

<f:subview id="#{widget.id}"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxp="http://nuxeo.org/nxweb/pdf">
<c:if test="#{nxl:isLikePlainMode(widget.mode)}">#{field_2}</c:if>
<c:if test="#{nxl:isLikeViewMode(widget.mode)}">

  <div id="docRefTarget:#{field_1}"
    class="#{nxu:test(field_3, 'nxDropTarget', '')}">
    <div id="docRef:#{field_1}"
      class="cell popupTarget dropout nxDraggable"
      docRef="#{field_1}">
      <nxu:graphicImage
        value="#{nxd:iconPath(field_0)}" alt="#{field_2}" title="#{field_2}"
        rendered="#{!empty nxd:iconPath(field_0)}"
        styleClass="smallIcon" />
    </div>
  </div>
</c:if>
<c:if test="#{widget.mode == 'pdf'}">
  <nxp:html>
    <nxu:graphicImage
      value="#{nxd:iconPath(field_0)}" alt="#{field_2}" title="#{field_2}"
      rendered="#{!empty nxd:iconPath(field_0)}"
      styleClass="smallIcon" />
  </nxp:html>
</c:if>
</f:subview>

So replace alt="#{field_2}" by alt="#{messages[field_2]}".

About widget configuration you have to bind the fields like in this order:

        <field>data</field>
        <field>data.ref</field>
        <field>data.type</field>
        <field>data.folder</field>

Or you wait for the fix 😄

View answer in original post

7 REPLIES 7

Florent_Guillau
World-Class Innovator
World-Class Innovator

Yes, this would be better. What's your question (this site is for questions)?

If you have a bug report (which this seems to be), please do it in http://jira.nuxeo.com/

Bug open into the client's account.

Can you copy the jira issue link here ?

Ok. https

This trouble has been fixed into the 5.5.0-HF07 and back ported into nuxeo 5.6

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Waiting the correction You can create your own Content View with studio and create a template type widget that will displays the icon. This template will reuse the default template used for displaying the icon but for the alt value will use the #{messages[document.type]} and add keys into the message property into studio (Resources > I18n Files).

If I'm right here is the xhtml fragment used to display icon:

<f:subview id="#{widget.id}"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxp="http://nuxeo.org/nxweb/pdf">
<c:if test="#{nxl:isLikePlainMode(widget.mode)}">#{field_2}</c:if>
<c:if test="#{nxl:isLikeViewMode(widget.mode)}">

  <div id="docRefTarget:#{field_1}"
    class="#{nxu:test(field_3, 'nxDropTarget', '')}">
    <div id="docRef:#{field_1}"
      class="cell popupTarget dropout nxDraggable"
      docRef="#{field_1}">
      <nxu:graphicImage
        value="#{nxd:iconPath(field_0)}" alt="#{field_2}" title="#{field_2}"
        rendered="#{!empty nxd:iconPath(field_0)}"
        styleClass="smallIcon" />
    </div>
  </div>
</c:if>
<c:if test="#{widget.mode == 'pdf'}">
  <nxp:html>
    <nxu:graphicImage
      value="#{nxd:iconPath(field_0)}" alt="#{field_2}" title="#{field_2}"
      rendered="#{!empty nxd:iconPath(field_0)}"
      styleClass="smallIcon" />
  </nxp:html>
</c:if>
</f:subview>

So replace alt="#{field_2}" by alt="#{messages[field_2]}".

About widget configuration you have to bind the fields like in this order:

        <field>data</field>
        <field>data.ref</field>
        <field>data.type</field>
        <field>data.folder</field>

Or you wait for the fix 😄

Thanks, I'll try that as soon as possible.

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.