Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Field (set) group label can be translated, but not the description?
Steps:
Install i18n, field_group field translation. Enable a second language (e.g. FR),
- enable multi.language for the article content type, add a field set and give it a label and description
- go to admin/config/regional/translate/translate and search for the label and description entered above.
- add an example text field within the field set and translate the field
- the field label/description can be translated fine
- whereas the fieldset label can be found and translated, but not the description cannot
Comment | File | Size | Author |
---|---|---|---|
#17 | field_group-make_description_translatable-1751002-17.patch | 1.04 KB | Georgique |
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedSome great work has been done here: http://drupal.org/sandbox/webflo/1413404. This will be the lead for the field_group integration on internationalization.
For this reason the t() is not used (anymore, would need to check) for labels and description. It is content in our opinion and thus of i18n_field_group.
Webflo has done some excellent work on that, just waiting on a release for it.
Comment #2
boran CreditAttribution: boran commentedThanks, but that sandbox is empty?
Comment #3
Stalski CreditAttribution: Stalski commentedNo, it isn't. Check : http://drupalcode.org/sandbox/webflo/1413404.git/tree/refs/heads/7.x-1.x
Comment #4
Pere OrgaI see that this is still not committed to 7.x-1.x-dev
Does anyone know if it will be at some point?
Cheers
Comment #5
Stalski CreditAttribution: Stalski commentedThis is not a commit on this module.
Comment #6
Stalski CreditAttribution: Stalski commentedSee
http://drupal.org/node/1751002
http://drupal.org/sandbox/opin/1762478
Another contrib will do all the work.
Comment #7
Pere OrgaGood to see a solution for this.
But is there any particular reason for having this in a different module?
And what is the difference between http://drupal.org/sandbox/webflo/1413404 and http://drupal.org/sandbox/opin/1762478 ? The two look inactive.
Comment #8
Pere OrgaIn my opinion this should be solved in this module and not in a separate one.
Comment #9
ovide CreditAttribution: ovide commentedComment #10
caktux CreditAttribution: caktux commentedHere's a git patch...
Comment #11
geek-merlinThis needs work.
* patches in #9 and #10 use t() which is not the way string translation should work (i18n assigns IDs to non-code strings so translations stick when source is changed)
* reviewed the 2 sandbox modules and code in https://drupal.org/sandbox/webflo/1413404 looks better to me
@Stalski: i also think this should live in field_group.module, would you as maintainer accept a patch that incorporates webflo's sandbox (with a namespace change) as a submodule?
Comment #12
Stalski CreditAttribution: Stalski commentedHi,
It could still go in for D7. Let's start from the sandbox of webflo and sync with him about this decision. I think he'll be happy.
So let's create a patch. There are some todo's in the code, so if someone is willing to make the final patch, let's have it :)
Comment #13
Georgique CreditAttribution: Georgique commentedIsn't description translated in field_group_pre_render_prepare()?
I believe it is, also it should be improved because there might be case when we translate empty string.
Patch is attached.
Comment #14
Georgique CreditAttribution: Georgique commentedComment #16
mibfire CreditAttribution: mibfire commentedhttps://drupal.org/sandbox/webflo/1413404 This module doesnt work on Commerce checkout pages. See: https://www.drupal.org/node/2368837
Comment #17
Georgique CreditAttribution: Georgique commentedLet's try this patch...
Comment #18
giupenni CreditAttribution: giupenni commentedI have to apply either the patch # 9 and # 10 to test?
Comment #19
bramvandenbulcke CreditAttribution: bramvandenbulcke commentedI'm using the latest version of Field Group, version 1.5 and it's possible to translate the description of a field group. The strange thing is it doesn't show up easily in the translate tab (/admin/config/regional/translate/translate). I ran cron and cache clear 10 times and did string refresh 3 times (/admin/config/regional/translate/i18n_string, but the string didn't show up on the translate tab. But after creating a node of that type, it did!
Hopefully this offers some help to others with the same problem.
Comment #20
Fabioc79 CreditAttribution: Fabioc79 commentedI spent half a day without being able to see field group labels/descriptions in the traslate page (/admin/config/regional/translate/translate). Finally I got the solution and I share it.
To make strings appear in the translation interface, you have to visit the page where those strings are printed IN THE LANGAUGE YOU WANT TO TRANSLATE (not in the default source language).
I hope this can help someone.
Comment #21
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #17 to field_group.module applied cleanly to the latest field_group 7.x-1.x-dev, but still needs review (if still applicable).
Comment #22
julien.reulos CreditAttribution: julien.reulos commentedI can translate field_group descriptions with version 1.6, no need for this patch. This issue should be closed as Fixed.
Comment #23
Anybody