Monday 15 October 2007 8:30:14 pm - 14 replies
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.
Monday 15 October 2007 10: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?
Tuesday 16 October 2007 8:53:56 am
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.
Wednesday 21 September 2011 9:36:46 am
I have been facing this bug in the last eZ Publish version, and I was very disapointed - A solution is needed to allow translation of ezselection (by the way i think the ezselection datatype should be rewrited).
I have been thinking about it a little bit, and as a workaround I used the i18n template operator in tpl but this is not really convenient.
So I have started to work on a patch, and I wanted to validate the possible solution I found:
When we look to the way data are stored in the contentclass_attribute table we see it is stored through an xml in data_text5 column this way:
<?xml version="1.0" encoding="utf-8"?> <ezselection> <options> <option id="0" name="Ws"/> <option id="1" name="Cn"/> </options> </ezselection>
So I was thinking it could be possible to store the language as an attribute of <options> tag this way:
<?xml version="1.0" encoding="utf-8"?> <ezselection> <options lang="fre-FR"> <option id="0" name="Webinaires"/><option id="1" name="Certification"/> </options> <options lang="eng-GB"> <option id="0" name="Webinars"/><option id="1" name="Certifs"/> </options> </ezselection>
What do you think about this solution ? Is there something that could make this solution innapropriate ?
Thanks for your feedback,
Modified on Wednesday 21 September 2011 9:37:28 am by Nicolas OTTAVI
Wednesday 21 September 2011 10:17:04 am
I have read about this ezselection2 project, but unless I am blind I can't find any source code for this project ... Subversion and Download tabs are "empty" ... I have tried to find something on github bug did not ... If you have some link where I could download it it would be useful, and may be make my "project" of rewriting ezselection not necessary anymore
Wednesday 21 September 2011 10:30:43 am
Wednesday 21 September 2011 11:18:51 am
I would start with ezselection2 maybe ( sole reason: it solves the index being int problem, not allowing you to re arrange options later), "only" problem with it is that the developer that started on it tried to do to many things. There is yui 2.x stuff in there that should be scrapped by now, potentially rewritten in jQuery, but "kiss"..
So a simpler starting point would be to "enhancedselection" which also solved the index issue, its the one ezselection2 was based on, which again is based selection datatype in eZ Publish.
As for your translation proposal, could probably work. However as of 4.3 a new translatable attribute was added where you could place the data as xml or json (if you break the format, why not brak to one that is easier to use and takes less space ).
Modified on Wednesday 21 September 2011 11:19:32 am by André R
Wednesday 21 September 2011 11:29:26 am
I know, this is why before starting to work on a solution I asking you as very experienced eZ developers if my solution could make sense
We are just starting with translation feature in http://projects.ez.no/eztags
Though, I don't know when we will have something operational (http://projects.ez.no/eztags/forum/general/multilingual)
Modified on Wednesday 21 September 2011 11:32:16 am by Ivo Lukač
You must be logged in to post messages in this topic!