Problem/Motivation

Currently it seems like the calls to token_replace() lack the optional language options.
Due to this alt / title tags that use tokens based on translated files to contain always the source language instead of the translated version.

Proposed resolution

Pass in the language option with the current interface language.

Remaining tasks

Reviews needed.

User interface changes

None

API changes

None

Data model changes

None

Comments

das-peter created an issue. See original summary.

leksat’s picture

Status: Needs review » Reviewed & tested by the community

In my case, the fielname_field (provided by the title module) was also affected. Works like a charm after applying the patch.

catch’s picture

This is a duplicate of #2473621: Alt and title text don't appear in the correct language when viewing a file in a language other than the current page language although the patches take different approaches. Back to CNR though since they need consolidating.

joseph.olstad’s picture

I also noticed this issue. See the approach I took (a small, fairely straightforward core patch)
#2835135: image formatter needs to handle alt/title from file entities on images for multi language support

I'm thinking of committing either the patch to file_entity by @David_Rothstein
#2473621: Alt and title text don't appear in the correct language when viewing a file in a language other than the current page language

OR
the one by @das-peter :
#2806081: translated Title and Alt text fix, use optionally with entitycache and entity_translation

different approaches , but both look good. I'm leaning towards the @David_Rothstein approach because it is maybe slightly simpler? not sure.

joseph.olstad’s picture

Status: Needs review » Closed (duplicate)
joseph.olstad’s picture

Status: Needs review » Closed (duplicate)

We went with the other patch in this issue instead.
#2806081: translated Title and Alt text fix, use optionally with entitycache and entity_translation

Thanks everyone, this is fixed.