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.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | addressfield_tokens_for_state_not_translating-2209629-2.patch | 1003 bytes | erichomanchuk |
Comments
Comment #1
erichomanchuk CreditAttribution: erichomanchuk commentedMessage deleted.
Comment #2
erichomanchuk CreditAttribution: erichomanchuk commentedSo 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.
Comment #3
erichomanchuk CreditAttribution: erichomanchuk commentedComment #4
erichomanchuk CreditAttribution: erichomanchuk commentedComment #5
erichomanchuk CreditAttribution: erichomanchuk commentedComment #6
shi99 CreditAttribution: shi99 commentedThanks for the patch.
I had the same issue and the Patch in #3 fixed it for me
Comment #7
erichomanchuk CreditAttribution: erichomanchuk commentedComment #8
markie CreditAttribution: markie commentedPatch looks good to me. Thanks for your help.