I build a multilingual site. The default language is EN and NL and FR is used too. I have several views which list different content types. These are created in English and then translated to the other languages using configuration translation.
The path alias for the content types is 'view-path'/[node:title] ('view-path' is added manually as a string, not using tokens, eg. products/[node:title]).
When I switch the language, the view title segment keeps its language, not changes to the selected language. (Eg if it was NL it keeps to be the NL translation regardless the language switch.) I have to empty the cache after switching language to see the right translation.
It may be something related to core because I have a similar experience with admin menu items.
Additional information (I do not think it should be related but may be useful):
- The site uses the language_access module to hide EN lang from non-admin users.
- The page title block is hidden on the view pages.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | easy_breadcrumb_language_cache_context-3029117-5.patch | 699 bytes | imre.horjan |
Comments
Comment #2
thamasComment #3
imre.horjanLet's try using languages as a cache context.
Comment #5
imre.horjanComment #6
greg boggsNice! After 3 years, I think we've finally got cache expiration working as expected.
Comment #7
tatarbjwoohoo, Hungarian spirit \o/
Comment #8
tatarbjI've tested the given scenario and with the applied patch on 8.x-1.x-dev I didn't have to clear the cache to get the correct segment.
For me it's ready to be committed - maybe some further manual tests are needed also would be nice to have some coverage in the tests for it, but maybe in a follow-up it makes more sense.
Bests,
Balazs.
Comment #9
imre.horjanThanks for your feedback.
We've done some manual testing with heavy caching, and didn't solve the problem in our use case.
Let me dig deeper, maybe I can find anything else to fix this.
In our use case the parent page is a views page, while the sub page is a node page.
Comment #10
tatarbjAwesome, thanks for stepping up!
Comment #11
imre.horjanI've tested again, and it seems to work. Maybe I did something wrong while testing (or my browser's cache tricked me).
Putting back to RTBC.
Comment #12
diamondseafix title typo
Comment #14
diamondsea