Closed (fixed)
Project:
Localizer
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2007 at 18:17 UTC
Updated:
19 Mar 2007 at 22:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
giorgoskAfter some further investigation it seems that the only things that got translated from the CCK fields are the "text > text fields" CCK fields ( I have also some "Integer > text field" CCK field that does not translate.
Mind you the translation is only happening when I edit the node (on view the default language, english is displayed)
Just in case you were wondering tranlated string is done trough the Locale interface (admin/settings/locale manage strings)
related posts
there is some talk about it
http://drupal.org/node/117256 (similar localizer issue)
and
http://drupal.org/node/117474 (CCK translation support request)
Comment #2
huayen commentedHow did you get CCK field label translated? I tried a text field and can not see any 'locale' or 'translate' tab in the configuration...
Comment #3
giorgoskbefore I was referring to admin/settings/locale > manage strings and search and translate the string to be translated (the label name of your cck field in this case) you have to have Localizer (it probably works with I18n) and Locale enabled
when you edit the node the the CCK field labels should be translated to the correct locale
----------------------------
BUT,
I have actually found a solution to this if you are interested here it goes
1. drop the field.tpl.php and template.tpl.php from the modules/CCK/theme folder to your themes folder
(if template.tpl.php already exists just copy the contents in)
2. change the first line of field.tpl.php so it reads like this (I added the $label = ...)
3. that's it
Apparently it works with drupal cache on or off
And you can even search the cck field contents ( ???????? )
Comment #4
yched commentedDisplaying translated field labels is not a problem- simply a forgotten t().
Attached patch fixes it in the default theme_field function, and in the 'example' template.php for custom field theming.
(patch is for 5 branch, should apply easily on 4.7)
Once again, translation isues for _values_ is a whole other story.
Content translating is the scope of i18n / localizer modules.
(followup to the discussion in http://drupal.org/node/117474) Karen, I think there is no problem regarding the page cache. On a vanilla drupal install, anonymous users see the pages in the default language defined in core locale.module settings. If a site has multiple languages for anonymous users, then it has to use i18n / localizer, which (i think) handle the language in the url, so it's OK wrt page cache.
Comment #5
yched commentedOh, and it could use some review - mainly on the 'custom field templates' area :
Not sure whether it's best to t() the label in phptemplate_field(), or in the field.tpl.php file...
Comment #6
yched commentedI committed a slightly different of the default theme_field function to display the translated version of the field label, and updated the theming examples in cck/theme
Comment #7
(not verified) commented