Translation of labels and values for CCK fields

GN - August 9, 2008 - 20:13
Project:Internationalization
Version:6.x-1.0-beta3
Component:Compatibility
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

In the last couple of years, there were quite a lot of posts on the problem of label translation for the list of allowed CCK field values (see e.g. http://drupal.org/node/182884 or http://drupal.org/node/248573);
with newer versions of Drupal, CCK, and i18n released since then, this problem still does not seem to be fully resolved.

For example, I create a text CCK field for countries that should be selected from the "Value|Label" list:

AL|Albania
AM|Armenia

and so on.
Then, I'm trying to translate country names into another language.
I go to admin/build/translate/search and search for 'Albania' string - but I cannot find it.
I do "Refresh strings", I run cron, I dance with a tambourine - but I still cannot find it.
Okay, let's try to use an old trick of assigning label strings via a php code:
return array(
'AL' => t('Albania'),
'AM' => t('Armenia')
);

This seems to work better, and in most cases I am able to find the strings to translate.
Sometimes, however, it does not work either. It may help if you edit and save a node that refers to this CCK field - then, you are usually able to find a string that was not found before. (This also works better for php code than for the regular way of defining value labels).

To cut a long story short, translation of value labels often seems to require some creative efforts instead of being a routine procedure.
Does anybody know - is this a locale issue, or i18n issue, or cck issue?

#1

Jose Reyero - October 1, 2008 - 14:35
Title:Translation of labels for CCK field values - still problematic...» Translation of labels and values for CCK fields
Component:User interface» Compatibility
Category:support request» feature request

This behavior you describe is consistent with Drupal 6 not translating user defined strings.

So this may be a feature request for i18n, cck, or both. For now, it's in the 'to-do' list.

#2

SaxxIng - January 13, 2009 - 14:25

I'm interested too to this feature... essentially it is a behavior like the selected fields in core profile (that are correctly translatable with the i18nprofile). To Implement this type of feature, at the moment, the major problem/limit is in 18n or in cck?
Regards,
Saxx

#3

.jon - January 21, 2009 - 00:33

This missing feature essentially means that you cannot supply a fully translated site, if you use custom CCK fields.

Or is there a way around this? (Displaying translated custom CCK field labels according to the node language)

#4

amccann - February 13, 2009 - 03:59

I will be a sponsor of a fix for this if someone is interested in working on it.

#5

Cactii1 - February 20, 2009 - 19:56

I've tried with the code but it doesn't seem to work for me.

Going to be playing with this for awhile it seems.

EDIT

Forget it - this is not possible.
Going to have to go with a database for each language.
Careful uninstalling anything that has to do with Multi-Language stuff. Totally broke my site and left my database a complete mess.

#6

jakosa - February 22, 2009 - 21:49

Ooops. Not good. Hope this will be fixed nicely soon.

#7

Vote_Sizing_Steve - February 26, 2009 - 00:19

subscribing

#8

iernst - April 11, 2009 - 23:53

i would like to be a sponsor too, if this will be fixed.

#9

YesCT - April 23, 2009 - 04:31

subscribing.

#10

peterpoe - May 17, 2009 - 12:43

My workaround (just for labels) is to change the t() functions in content-field.tpl.php from this:

t($label)

to this:

t($label, array(), $node->language)

Now the labels have the same language of the node.

#11

alonpeer - May 26, 2009 - 08:05

Subscribe

#12

ErwanF - June 1, 2009 - 17:22

Subscribing. I can hardly believe this.

#13

Jose Reyero - June 13, 2009 - 13:51
Status:active» postponed (maintainer needs more info)

I think they finally added t() to titles and descriptions in CCK, so this may not be an issue anymore.

#14

danorton - June 17, 2009 - 14:35

subscribe

#15

sandino - July 3, 2009 - 00:11

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.