Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19602

Node attributes are not being translated

    XMLWordPrintable

Details

    Description

      We have a full article view which provides an english and german language switch which stays on the same siteaccess. to achieve the different language we use the language paramenter in the url, like: /(language)/ger-DE

      Now we have the problem that not everything of the article full view is translated.

      {foreach $node.data_map.special_linklist.content.relation_list as $item}
                                          {def $temp_info = fetch( 'content', 'node', hash( 'node_id', $item.node_id ) )}
                                          {if $temp_info.is_hidden|eq(0)}
                                              <li><a href={$temp_info.url_alias|ezurl()} title="{$temp_info.name|wash()}">
                                                  {if and($temp_info.object.class_identifier|eq("article"), $temp_info.data_map.headline.has_content)}
                                                      <span>{attribute_view_gui attribute=$temp_info.data_map.headline}:</span>
                                                  {elseif $temp_info.object.class_identifier|eq("event")}
                                                      <span>{fetch("content", "node", hash("node_id", $temp_info.object.main_parent_node_id)).name|wash()}:</span>
                                                  {/if}
                                                  {$temp_info.name|wash()}</a>
                                              </li>
                                          {/if}
                                          {undef $temp_info}
                                      {/foreach}
      

      That returns a list of names and links of object relation list attribute of the node.
      Unfortunately everything remains in the siteaccess language and doesnt care about the language parameter in the url.

      We believe, that the code should return translated content since its part of the module view and the $node attributes are translated. and yes, the related objects have a proper translation.

      Steps to reproduce

      1. Create a custom class, for example, a duplicate of the article class, and add a Object Relations attribute to it;
      2. Create an object of that class translated in your default language;
      3. Translate your object in a secondary language (example: ger-DE);
      4. Add some random objects to the relation list of your custom object;
      5. Translate your related objects in your secondary language;
      6. Add the code above to your full.tpl (by default: extension/ezwebin/design/ezwebin/templates/node/view/full.tpl);
      7. View your object calling YOUR_SITE/index.php/content/view/full/<NODE_ID>/(language)/ger-DE

      Your object's attributes should be translated in your secondary language, but the default translations is used instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rc@ez.no Ricardo Correia
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m