On node forms the labels and descriptions for metatags are not translated correctly if caching is turned on.

In metatag_get_info() a comment says:

    // hook_metatag_info() includes translated strings, so each language is cached
    // separately.

but they are not as right after the comment LANGUAGE_NONE is used.

Comments

czigor’s picture

Status: Active » Needs review
StatusFileSize
new567 bytes
damienmckenna’s picture

Title: Metatag info not cached languagewise » Metatag info caches translated strings, causes confusion when metatag_metatags_form translated

I think a better way would be to move the translation functionality to getForm().

damienmckenna’s picture

Status: Needs review » Needs work
damienmckenna’s picture

Status: Needs work » Needs review

You know, after spending half-an-hour digging through the meta tag definitions and various form fields, etc, changing the module so that the strings were only translated upon display in forms, I've realized that a) it's much more work, b) it is unreliable anyway as many strings, particularly meta tag descriptions, have string replacements for e.g. URLs that would be much more effort to replicate.

So I'm going to test the patch in #1 a little more and will then probably commit it as-is.

damienmckenna’s picture

StatusFileSize
new652 bytes

This is a little better as it isn't dependent upon using a global variable.

@czigor, does this work for you?

czigor’s picture

This does not work. language_default() returns the same language (the default site language) and not the actual language.

Leaving it on needs review as #1 still works for me.

damienmckenna’s picture

Status: Needs review » Fixed

I checked with some others on the language identification and am happy with this patch. Committed! Thanks czigor!

Status: Fixed » Closed (fixed)

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