profile explanation field not properly translated
| Project: | Internationalization |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
To reproduce:
start with English / Spanish site
1. Create a new checkbox profile item
2. Fill it out how ever you want, but make form_name profile_awesome, and in the explanation field type "are you awesome?"
3. Save
4. go to admin/build/translate/search and search on "awesome"
5. field:profile_awesome:explanation comes up
6. Edit at and add a translation (e.g. "¿Eres increíble?")
7. In another window load a profile with Spanish language selected
8. Explanation for checkbox is **NOT** Translated.
9. Do a search on "awesome" again.
10. now you've got
field:profile_awesome:explanation
**AND**
field:profile_awesome:description
11. Edit the field:profile_awesome:description and add the same translation.
12. In another window load a profile in Spanish
13. Translation works
Sure looks like a bug to me.
I think I fixed it. I attached a patch to HEAD. Don't know if I did it right since I've never posted a patch.
It's basically just changing "profile:field:$field:description" to "profile:field:$field:explanation" in one place.
| Attachment | Size |
|---|---|
| i18nprofile.module.patch | 874 bytes |

#1
I confirm I do have the same issue (French/English website).
The patch is solving partially the problem. It does indeed bring the translation of the profile explanation on the profile registration page. But at the same time the patch remove extra content (provided by drupal) added to the explanation (such as the privacy level of the field: "The content of this field is kept private and will not be shown publicly.")
Not sure if it can be fixed easily:
In drupal/module/profile/profile.module:
_profile_form_explanation($field)is used to add the extra information to the description when building the form. But from why I have read, i18n profile translate directly the form (i.e. once it has been created, after _profile_form_explanation() has been called).Unfortunately at this stage, the field structure (->visibilty, ->type) are no longer available (only the field name).
Sylvain
#2
Need to address spouilly's issues in #1.
About regenerating the explanation message and field's properties not available on form building, possibly we'll need to reload the field data (visibility, type) here.