Addressfield Tokens for states are not translation. I have a site that is both english and french with a view that uses addressfield token. When I view the page in english everything is fine when I switch to french the states are still shown in english. When I clear the cache the states are shown in french then when I switch to english the states are still shown in french until I clear the cache again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

erichomanchuk’s picture

Message deleted.

erichomanchuk’s picture

So I've come back to this issue as Im updating the modules for the project I was working on where I encountered the issue. It appears that addressfield_tokens for states do not translate because they are stored in cache and the cached output doesn't use the language variable to specify a cache for different languages. I've created a patch that will use the language code as part of the cache name which will fix the issue that you get the wrong state names on different languages, specifically whichever language the cache was built on.

erichomanchuk’s picture

erichomanchuk’s picture

Version: 7.x-1.3 » 7.x-1.5
erichomanchuk’s picture

Issue summary: View changes
shi99’s picture

Thanks for the patch.
I had the same issue and the Patch in #3 fixed it for me

erichomanchuk’s picture

Status: Active » Needs review
markie’s picture

Status: Needs review » Fixed

Patch looks good to me. Thanks for your help.

Status: Fixed » Closed (fixed)

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