eZ Community » Forums » Setup & design » Bad Translation
expandshrink

Bad Translation

Bad Translation

Wednesday 07 December 2011 8:16:23 pm - 8 replies

Hello guys,

My site as 3 languages. English, Portuguese and Italian. Everything works just fine, except the words "Related Content". In English appears "Related Content" and in Italian "Contenuto Correlato" which is correct but in portuguese it should appear "Conteudo Relacionado", but apperas "Related Content" instead. Where can I change this word to the portuguese translation?

Wednesday 07 December 2011 9:02:23 pm

Hi Ricardo,

It is a string from ezwebin extension, and indeed it looks like it is not translated.

You can find the string (two actually) in extension/ezwebin/translations/por-BR/translation.ts, and as you can see there its translation says unfinished:

<message>
    <source>Related content</source>
    <translation type="unfinished"></translation>
</message>

You can change that to:

 <message>
    <source>Related content</source>
    <translation>Conteudo Relacionado</translation>
</message>

and after clearing the caches, it should be translated.

However, the best course of action would be not to modify the original files, but to create the translation file in your custom extension and do the translation over there, as you run a risk of loosing the translation when upgrading the installation to newer versions.

Modified on Wednesday 07 December 2011 9:02:44 pm by Edi Modrić

Wednesday 07 December 2011 9:04:14 pm

Take a look in your extension folder, maybe it contains a folder structure that looks like translations/por-PT@override/ containing a file called translation.tsMake sure your term exists in this file, in the right context. The context is given in the template as the first argument to the i18n template operator.

Saturday 10 December 2011 3:08:38 pm

Thank you for your help. Works perfectly.

 

Regards.

Saturday 10 December 2011 4:27:37 pm

 

Hi have another issue regarding the related content translation. All the elements in the related content menu appear in english even if they ridirect to the translated pages.

How can I solve this issue?

 

Thank you.

Monday 12 December 2011 10:10:58 am

What version of eZ Publish are you using? Are you by any chance using $object.name for displaying items in related content menu? $object.name was not translatable until version 4.4 IIRC.

If that is the issue, maybe you could be using content of an attribute to display in a menu, like $object.data_map.name.content ?

Tuesday 13 December 2011 10:21:27 pm

 

At this moment the code for the related content is the following:

 

 <div class="attribute-relatedcontent">
    <h1>{"Related content"|i18n("design/ezwebin/full/article")}</h1>
    <ul>
    {foreach $related_content|reverse() as $related_object max 7}
        <li><a href="{$related_object.url_alias|ezurl( 'no' )}" title="{$related_object.name|wash()}"
>{$related_object.name|wash()}</a></li>
    {/foreach}
    </ul>
</div>

 

How should I change this to have related content translated to other languages other than english?

Thank you.

Wednesday 14 December 2011 6:33:08 pm

Hi Ricardo,

Instead of $related_object.name, you should output the content of the attribute that is used to generate object name (for example: $related_object.data_map.title.content)

But, this is a bit tricky if your $related_content array holds objects of different classes because not all of them might have the "title" attribute.

Why not upgrade to latest available version of eZ Publish?

Wednesday 14 December 2011 11:05:40 pm

 

Thank you Edi. Your sugestion works fine. At this moment I am using the version 4.5. I've already tried to upgrade to version 4.6,  but without sucess. I will have to try it again, but at this moment I'am commited to finish the website configuration.

Thank you again for your help.

 

Regards.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from