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...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:41:50
Script start
Timing: Jan 30 2025 21:41:50
Module start 'layout'
Timing: Jan 30 2025 21:41:50
Module start 'content'
Timing: Jan 30 2025 21:41:51
Module end 'content'
Timing: Jan 30 2025 21:41:51
Script end

Main resources:

Total runtime1.1749 sec
Peak memory usage8,192.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1406151.2109
Module start 'layout' 0.00540.0041 739.3516220.7031
Module start 'content' 0.00951.1647 960.05474,430.5859
Module end 'content' 1.17420.0006 5,390.64067.8438
Script end 1.1748  5,398.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2882160.0002
Check MTime0.00120.1035160.0001
Mysql Total
Database connection0.00080.068910.0008
Mysqli_queries1.094993.1952540.0203
Looping result0.00060.0470520.0000
Template Total1.127195.920.5635
Template load0.00190.165720.0010
Template processing1.125195.765720.5626
Template load and register function0.00160.133010.0016
states
state_id_array0.00200.171310.0020
state_identifier_array0.00100.084820.0005
Override
Cache load0.00160.1392180.0001
Sytem overhead
Fetch class attribute can translate value0.00200.173220.0010
Fetch class attribute name0.00190.157630.0006
XML
Image XML parsing0.00180.151420.0009
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00180.1531160.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs