Translation of select options

Author Message

Carlos Revillo

Monday 15 October 2007 11:30:14 am

Hello.

I've a custom class with a selection field in it. i would like to offer the user these two options in his language, but i don't know how.
i mean, let's suppose i have a select field with the options "one", "two" and "three". i would like to show these options to the user, but if the user is entering the spanish zone of my site i would like to show hime the options "uno", "dos" and "tres".

is this possible? thank you.

André R.

Monday 15 October 2007 12:25:24 pm

Tried to translate the class?
If that doesn't work, you can alwayse override the edit and view templates for that attribute to translate the values.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Carlos Revillo

Monday 15 October 2007 1:48:40 pm

Thank you Andre.

I tried that. i tried to edit the class in spanish, and i could change "labels" for fields. i mean, i can change "number" for "número" (spanish word for number). but if, in the spanish version of the class i change "one" to "uno", i always see "uno" for this option, in english and spanish...

do i miss something related to class translation?
thank you,.

André R.

Monday 15 October 2007 11:53:56 pm

No probably not, seems the class translation is restricted to class and attribute names.
So you can either do the other thing I mentioned (translate it in the templates), or a third option would be to use object relations list set up in drop down mode. Then you can translate the relations as you wish.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 18 2025 21:08:48
Script start
Timing: Jan 18 2025 21:08:48
Module start 'layout'
Timing: Jan 18 2025 21:08:48
Module start 'content'
Timing: Jan 18 2025 21:08:49
Module end 'content'
Timing: Jan 18 2025 21:08:49
Script end

Main resources:

Total runtime0.7106 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9063152.6250
Module start 'layout' 0.00590.0036 740.531339.4453
Module start 'content' 0.00960.6997 779.9766550.9609
Module end 'content' 0.70930.0013 1,330.937512.1641
Script end 0.7106  1,343.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5143160.0002
Check MTime0.00140.1940160.0001
Mysql Total
Database connection0.00110.159110.0011
Mysqli_queries0.659992.8627600.0110
Looping result0.00060.0870580.0000
Template Total0.674794.920.3373
Template load0.00280.395720.0014
Template processing0.671894.542320.3359
Template load and register function0.00010.020310.0001
states
state_id_array0.00100.141110.0010
state_identifier_array0.00110.149720.0005
Override
Cache load0.00230.3223200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.094820.0003
Fetch class attribute name0.00090.130650.0002
XML
Image XML parsing0.00060.083220.0003
class_abstraction
Instantiating content class attribute0.00000.002260.0000
General
dbfile0.00070.0933170.0000
String conversion0.00000.000840.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs