The [node:metatag:*] tokens don't get translated properly when using entity translation.
e.g.:
I have an English node, translated to French via entity translation.
The meta description is properly translated and shows the French version when the current language is French.
The og description is set to [node:metatag:description], but this shows the English version for both French and English as current language.
This is because the function that gets the replacement data only checks for the main language of the entity, in stead of first checking the current language.
See "metatag_token_generate_array($entity, $entity_type, $bundle)" at about line 148 of metatags.token.inc
Comment | File | Size | Author |
---|---|---|---|
#10 | metatag-translation_metatag_token-2892670-10.patch | 2.85 KB | phjou |
#4 | metatag_token_translations-2892670-4.patch | 1.24 KB | brentg |
|
Comments
Comment #2
L_VanDamme CreditAttribution: L_VanDamme at Dropsolid commentedIn attachment a patch made against the 7.x-1.21 version.
Comment #3
DamienMcKennaCould you please reroll the patch? Thanks.
Comment #4
brentgRerolled the patch of @L_VanDamme
Comment #5
brentgComment #6
StijnStroobantsPatch looking fine! Thanks!
Comment #7
StijnStroobantsComment #8
DamienMcKennaThanks for rerolling the patch, StijnStroobants.
I'm going to need to have us work on some tests to make sure it works as intended and make sure there aren't any regressions.
Comment #9
StijnStroobants@DamienMcKenna, brentgees rerolled the patch, credits to him! ;-)
Comment #10
phjouHi,
I've debugging the exact same bug. The current patch is using the global language but Metatag is already passing the language into the options of the tokens. I think it's a better id to use it than the global language because you lose the metatag custom logic. For example, you have the metatag_entity_no_lang_default variable which impact the language.
What do you think?
Comment #11
PieterDCThanks for your hint @phjou
Changing metatag_entity_no_lang_default from 0 (default) to 1 helped, in my case, without needing the patch from this issue.
Comment #12
proweb.ua CreditAttribution: proweb.ua commented#10 works
7.x-1.27