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) |
Jump to:
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|Armeniaand 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
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
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
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
I will be a sponsor of a fix for this if someone is interested in working on it.
#5
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
Ooops. Not good. Hope this will be fixed nicely soon.
#7
subscribing
#8
i would like to be a sponsor too, if this will be fixed.
#9
subscribing.
#10
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
Subscribe
#12
Subscribing. I can hardly believe this.
#13
I think they finally added t() to titles and descriptions in CCK, so this may not be an issue anymore.
#14
subscribe
#15
subscribe