translating options in Selection attribute - bug?

Author Message

Michal Slocinski

Wednesday 30 July 2008 11:43:55 am

Hi,

I just noticed following issue:

I have a class with Selection attribute which is information collector.

When I translate this class to different language and change for example attribute name - it's properly applied. But if I translate option of this attribute - all translations of this option have value of translation which I entered as last one.

So for example, attribute Selection in eng-GB has option: 'good morning'

Now, I translate whole class and attribute to ger-DE and change this option to become: 'guten tag'

Result: both versions of this class (eng-GB and ger-DE) have same option 'guten tag' in this Selection attribute.

I discovered this on 4.0.1rc1 and noticed same behavior on 4.0 - are you aware of this problem and can someone confirm it?

Michal

André R.

Wednesday 30 July 2008 3:25:27 pm

Its not a bug, eZ Publish doesn't currently support translation on class attribute values (default values + selection values) only name of the attribute and name of the class.

A discussion on class enhancements:
http://ez.no/developer/forum/setup_design/content_class_attribute_description

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

Michal Slocinski

Wednesday 30 July 2008 3:35:01 pm

that's not pretty :-/

any plans to implements this? I'll have to workaround it somehow...

Piotrek Karaś

Wednesday 30 July 2008 9:39:51 pm

Michal,

It is definitely possible to implement with some extension-writing skills. I have a custom extension made for that (for checkboxes only, not all selection modes). I'm not sure if I will be able to share that, but the idea goes like this:

- there is an extra tab and interfaces for managing 1:n->1:n db model (category set -> category -> category translation); those make it possible to create sets that contain any number of identifier-named categories that can be assigned translations in any language available
- there is a special i18n operator for figuring out whether there is a translation for a category in this particular language, or if identifier should be used as a last resort.
- there is a datatype, for which you define which category set to use during class definition. It also introduces one more db table for actually reflecting object-category n:n relation.

As a result, categories are translated automatically (if the translations had been prepared), but again - the attribute itself is not translatable - it will have the exact same selection for each document translation (which was what we needed).

One good thing about this model is that we can categorize multiple class objects in this way, using one category set.

I'll see if we're able to share the extension.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Michal Slocinski

Thursday 31 July 2008 12:34:36 am

Thanks for hints, maybe it's time to start digging bit more into eZ internals ;-)

Kristof Coomans

Thursday 31 July 2008 12:41:42 am

Just for the reference: http://issues.ez.no/13248 : ezselection datatype translation not possible

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Ronny Vedå

Thursday 19 March 2009 3:32:50 pm

Now that 4.1 is done, can eZ Systems PLEASE put some resources into implementing translation of selection values.

Customers are not happy about this issue at all.

André R.

Friday 20 March 2009 12:42:06 am

We probably will.

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

J-A Eberhard

Sunday 29 March 2009 11:37:06 pm

Hi,

I hope eZ can put some works on this issue. This is just terribly important to claim that eZ is truly multilingual.

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Andreas Kaiser

Wednesday 29 April 2009 7:16:29 am

Yes, this is really important...

just opened a enhancement ticket (last one referring to this was some years old...)

By the way, i solved this for a client using an override of ezselection.tpl and changing:

{$Options.item.name|wash( xhtml )}

to

{$Options.item.name|i18n("example/options")|wash( xhtml )}

Of course very manual (for example when updating or adding options ts file has to be updated in all languages) but it works... :)

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

André R.

Wednesday 07 April 2010 5:15:14 am

Since this topic popped up again on twitter today, here is current progress:

What is left is for someone to complete ezselection2 with support for data_text_i18n and eventually upgrade script for ezselection -> ezselection2 so it can be included in eZ Publish and replace ezselection.

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

Helle Andersen

Thursday 29 April 2010 6:58:05 am

Just to let you know that it is very important to be able to translate selection datatypes - since this is not possible, we have not yet bothered to use class translations...... And we have to resolve to some pretty unlogical work-arounds in order to translate selections....

(I cannot quite figure out from this very short description how this low level support works in 4.3.....)

Richard Bayet

Friday 20 August 2010 5:05:07 am

"

Since this topic popped up again on twitter today, here is current progress:

What is left is for someone to complete ezselection2 with support for data_text_i18n and eventually upgrade script for ezselection -> ezselection2 so it can be included in eZ Publish and replace ezselection.

"

André, as far as I understood, the role of data_text_i18n is to store translatable "default values" (default ezstring value, default ezinteger value, etc), is that it ?

If the answer is yes, on a pure practical point of view, does anyone really need to support it in ezselection2 ?

Because if ezselection2 only lacks this (but DOES support multilingual options on the go) and an update script, I would consider it more beta than alpha for my personal use...

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 03:09:52
Script start
Timing: Jan 18 2025 03:09:52
Module start 'layout'
Timing: Jan 18 2025 03:09:52
Module start 'content'
Timing: Jan 18 2025 03:09:53
Module end 'content'
Timing: Jan 18 2025 03:09:53
Script end

Main resources:

Total runtime0.7032 sec
Peak memory usage4,096.0000 KB
Database Queries103

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 589.1563152.6406
Module start 'layout' 0.00450.0022 741.796939.4766
Module start 'content' 0.00670.6949 781.2734940.3750
Module end 'content' 0.70170.0015 1,721.648428.1250
Script end 0.7032  1,749.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4210160.0002
Check MTime0.00130.1841160.0001
Mysql Total
Database connection0.00060.086010.0006
Mysqli_queries0.608186.47171030.0059
Looping result0.00100.14461010.0000
Template Total0.681696.920.3408
Template load0.00180.257520.0009
Template processing0.679896.661220.3399
Template load and register function0.00010.017810.0001
states
state_id_array0.00060.079610.0006
state_identifier_array0.00060.090120.0003
Override
Cache load0.00180.2512800.0000
Sytem overhead
Fetch class attribute can translate value0.00070.101290.0001
Fetch class attribute name0.00110.1530180.0001
XML
Image XML parsing0.00290.406590.0003
class_abstraction
Instantiating content class attribute0.00010.0096200.0000
General
dbfile0.00140.2012410.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
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
20content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
4content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 57
 Number of unique templates used: 11

Time used to render debug report: 0.0001 secs