Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-11331

I18n with CustomField

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Following an old issue (JRA-6481), our requirment for i18n implementation is more and mroe important at the moment.

      • May we know when a such feature will be implemented in future release ?
      • Trying to understand how customfield rendering is done, I found a way to apply i18n translation.
        I proceed so :
        • Creating the CustomField as i18n keys : myCustomField
        • Adding the CustomField property value in a rebuild language_fr_FR.jar
          com/atlassian/jira/web/action/JiraWebActionSupport_fr.properties
          myCustomField=Mon Champ personnalisé
        • Adding the CustomField property value in a rebuild language_en_UK.jar
          com/atlassian/jira/web/action/JiraWebActionSupport_en.properties
          myCustomField=My Custom Field
        • ... and alos for any other required languages.
        • Modifying templates/plugins/jira/macros.vm as follow :
          • a new Macro
            ## I18n Headers required for CustomFields
            #macro(i18nCustomName $action $name)
                #set ($wordPos = $name.indexOf(" "))
                #if ($wordPos>0) 
                	#set($key=$name.substring(0,$wordPos)) 
                	$action.getText($key) $name.substring($wordPos,$name.length())
                #else
                	$action.getText($name)
                #end
            #end
          • Replacement of
            #if ($required)
                <span class="required" title="$action.getText("common.forms.requiredfields")"><sup>*</sup>
                $name:
                </span>
            #else
                $name:
            #end

            by

            #if ($required)
                <span class="required" title="$action.getText("common.forms.requiredfields")"><sup>*</sup>
                #i18nCustomName($action $name) :
                </span>
            #else
                #i18nCustomName($action $name) :
            #end
        • Modify includes/panels/issue/view_customfields.jsp as follow :
          Replacement of
          <tr id="rowFor<webwork:property value="./id" />">
              <td bgcolor="f0f0f0" width="20%" valign="top"><b><webwork:property value="name" />:</b></td>
              <td bgcolor="ffffff" width="80%">
                  <webwork:property value="/customFieldHtml(../fieldLayoutItem,., /issueObject)" escape="false" />
              </td>
          </tr>

          by

          <tr id="rowFor<webwork:property value="./id" />">
              <td bgcolor="f0f0f0" width="20%" valign="top"><b><webwork:property value="text(./name)" />:</b></td>
              <td bgcolor="ffffff" width="80%">
                  <webwork:property value="/customFieldHtml(../fieldLayoutItem,., /issueObject)" escape="false" />
              </td>
          </tr>

      Please, let me know if I may implement this, waiting the future feature ?
      What other problem may I encounter ? Probably Word and Excel rendering, I suppose ?

      Rgds
      Vincent

      Attachments

        1. src.zip
          23 kB
        2. customfieldtrans.png
          customfieldtrans.png
          39 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              5d77aaa81033 Vincent Thoulé
              Votes:
              60 Vote for this issue
              Watchers:
              45 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: