Forums / Developer / Tip for selection not translatable ...

Tip for selection not translatable ...

Author Message

Jean-Yves Zinsou

Thursday 26 February 2009 9:38:08 am

The options of an ezselection is not translatable.
How do you ezgurus guys handle this problem ?
The easiest solution i found in my case was to use the translations.ts files for each option label and then override the ezselection.tpl with this code :

                                                                                                                                 
  {let selected_id_array=$attribute.content}
  {section var=Options loop=$attribute.class_content.options}
  {section-exclude match=$selected_id_array|contains( $Options.item.id )|not}
  {$Options.item.name|wash( xhtml )|i18n("options")}{delimiter}<br/>{/delimiter}{/section}
  {/let}

(added i18n command to handle the translation)

Smarter way anyone ?
Any ezselection translatable datatype i haven't seen in the contribs ?

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Fabien Mas

Wednesday 25 November 2009 1:56:40 am

Hi Jean Yves

We have the same problem and we handle it by the same solution

But there are some issues with this method :

+ Only the primary language is indexed , so if you do a search on this field in another language you will have no result found..

+ We gave the possibility to our customer to add some options, but they have no access to the translation files so they can't translate it...