Closed Norsagir closed 3 years ago
Sorry about this, I should have caught the problem. I think I've found the underlying issue though. During a rewrite of the settings, we missed a few sections on the frontend where the language was cached, some parts of the website were pulling from one 'store' some were pulling from another.
Yes we never retrieve from the API but always from the store. So far I've tried a quick and simple fix but the API call comes too late after some frontend initialization (some items in the menu and Vuetify components). I'm still investigating. As a fallback solution, maybe we could set an env var for it and be done with it.
Yes we never retrieve from the API but always from the store. So far I've tried a quick and simple fix but the API call comes too late after some frontend initialization (some items in the menu and Vuetify components). I'm still investigating. As a fallback solution, maybe we could set an env var for it and be done with it.
I think I was able to get it sorted out in this commit . I think it's as simple as caching the siteSettings, pulling the language from the siteSettings cache and cleaning up all the old references/assignment. I still need to do another pass and make sure I caught all the references.
I like your solution better than the one I started to cook, but it's still not enough for some texts:
Same goes for the top-right menu and the admin menu.
'Standard' texts get translated on the fly but some stuff like these were coded differently and are not updated when the locale changes after the initialization.
Basically what fails us is the async thing: we'd need to wait for all translations to be calculated only when we get the settings from the API.
On second thought, maybe it's the way these menu items are generated that need refactoring, not the way we set the locale.
~~I think I just discovered than the same problem occurs when selecting a different color for the default theme : default colors are still displayed until I go to the Theme settings and reapply the default theme. Do you want me to open a new issue for that problem ?~~ EDIT : I failed cleaning the cache of my web browser, but the user may expect to see the website changing on all web browser even if cache is not clean. Is it another issue ?
Describe the bug When a language other than English is selected and settings are saved, site is still in English when using another PC/browser with clean cache.
Steps To Reproduce Please be specific!
Expected behavior Site is in the selected language with every browser.
Actual Behavior Site is in English with other browser except the one used to apply settings.
Device Information (please complete the following information):
Additional context Before opening this issue, I asked about this in the discussion #331