i18n + CCK

neochief - July 27, 2009 - 01:26
Project:Internationalization
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:i18n + CCK
Description

Here's a module which provide translation for CCK fields (labels, descriptions, options).

AttachmentSize
i18ncck.patch4.33 KB

#1

neochief - July 27, 2009 - 01:30

This module depends on some changes to CCK: #531662: Internationalization support

#2

neochief - July 27, 2009 - 01:31

#3

neochief - July 27, 2009 - 01:31

#4

Jose Reyero - August 4, 2009 - 14:43
Status:needs review» postponed

Your module looks good, but it still needs the cck side patch. If that ever gets in we just add this module.

Otherwise, sorry, but no way we are shipping patches with the modules

#5

neochief - August 4, 2009 - 14:51

Yes, I know, thanks for review, will lobby that patch :)

#6

markus_petrux - August 11, 2009 - 10:39

For the project I'm working on, we're starting to play with i18n right now, so I expect to have time to review the proposed CCK patch and this module, hopefully soon.

drupal_alter() against the whole content types structure could be dangerous, as it opens the door to other module to alter things that shouldn't be altered. I'll try to find a way to just expose a structure of data for i18n.

Well, subscribing here. Updates on possible alternatives to the current i18n+CCK patch will be at #531662: Internationalization support.

#7

markus_petrux - August 11, 2009 - 17:25

As posted in the CCK issue, I think we have now something that needs testing, and that's aimed to cover field labels and descriptions. I'm not 100% sure about allowed values and content_format().

For example, in content_format(), item values are not always in $item['value']. What about fields that are not strings? ...etc.

So I would focus on the translation of labels/descriptions of CCK fields. This module could then be committed here, starting to support that. And once we one one piece, we can work/think on the others.

Well, it's just an idea. :)

#8

neochief - August 12, 2009 - 12:06

Attaching updated version (I think tarball is preferred, until module will be ready to be included).

AttachmentSize
i18ncck.zip 1.62 KB

#9

markus_petrux - August 14, 2009 - 12:06
Status:postponed» needs review

Hi, the CCK module already has the feature for fields and allowed values. I'm going to commit the stuff related to fieldgroups asap.

And here's an updated i18ncck module in tar format.

I have tested this on our environment and seems to work nicely.

PS: After downloading, rename the file from "i18ncck.tar_.gz" to "i18ncck.tar.gz". ;-)

AttachmentSize
i18ncck.tar_.gz 1.34 KB

#10

markus_petrux - August 14, 2009 - 12:22

I'm going to commit the stuff related to fieldgroups asap.

Done. Support for fieldgroups committed to CCK repo (branches CCK2 and CCK3). ;-)

#11

markus_petrux - August 14, 2009 - 14:11

Tar updated to fix drupal_alter() implementations to avoid generating entries when descriptions are empty.

AttachmentSize
i18ncck-531660-11.tar_.gz 1.36 KB

#12

Jolidog - August 14, 2009 - 14:45

Just tested this sub module, it's working great!

Thank you!

#13

markus_petrux - August 14, 2009 - 16:34

Also posted a patch to add support for CCK to Translation table module, here: #499668: Possibility to integrate cck fields?.

Cheers

#14

markus_petrux - August 17, 2009 - 10:43

The tar in #11 has an issue: we're filtering out content types that do not have translations enabled, but we shouldn't because CCK stuff is not content, but user interface stuff.

Attached tar fixes this.

Please, rename the file extension from "tar_.gz" to "tar.gz" before extracting.

AttachmentSize
i18ncck-531660-14.tar_.gz 1.31 KB

#15

Pasqualle - August 17, 2009 - 14:10

can you give an example when it makes sense to translate a CCK field of a non-multilingual node? Or you mean that a CCK field could be attached to other entities also, therefore the filter is wrong?

#16

markus_petrux - August 23, 2009 - 11:22

What we're translating here are field labels, descriptions, etc. and this is part of the user interface. That is, regardless of the fact that nodes of a particular content type can be translated or not, CCK field labels, descriptions, allowed values, etc. should match the user interface language, therefore these strings should be translatable.

#17

markus_petrux - August 23, 2009 - 11:38

Is there anything else we can do to make it easy to validate this addition to i18n?

Once this is included, we can start removing the use of t() in all those modules than display CCK field labels, etc. And this will avoid all those warnings that are displayed by Coder module when it finds t($field['widget']['label']), or when running potx to generate translation templates. :)

For example, once this module is committed to i18n, I would love to awake the following issue in Node Relationships module queue: #557070: Deprecate use of t() for field labels as soon as i18ncck module is committed to i18n project

#18

attiks - August 23, 2009 - 12:12

subscribing

#19

neochief - August 23, 2009 - 14:41
Status:needs review» fixed

Commited to 6.x-1.x-dev. Thanks! Marking this as fixed for now.

#20

markus_petrux - August 23, 2009 - 15:25

Sweet. Thanks! :)

#21

System Message - September 6, 2009 - 15:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#22

Jose Reyero - September 22, 2009 - 00:08
Status:closed» active

@neochief,

Nice work.

But I am thinking now this would be better merged into i18ncontent module, what do you think?

Also having a textgroup like 'CCK' is not much help for translators so maybe everything in 'Content types' text group would make more sense.

#23

MantasK - November 9, 2009 - 09:02

Does cck translation module work correctly? My default language is not English. So I enter label and options for select type in my native language. They all correctly appear in "Translate interface", but when I choose English on node view, strings are not translated. And I cannot use t() function in my template file, because there I must put English, but text comes not in English.

 
 

Drupal is a registered trademark of Dries Buytaert.