Use setLocale in middleware, so the logic doesn't have to be repeated in every page route and layout template.
Associated issue
N/A
How to test
Open preview link
Switch between locales
Verify translations switch along with the locale
Repeat on a generic page
Checklist
[x] I have performed a self-review of my own code
[x] I have made sure that my PR is easy to review (not too big, includes comments)
I have added/updated tests to prove that my feature works (if not possible please explain why)
I have made changes to the README and if the change affects the project setup (npm commands changed, new service added, environmental variable added) (will add to docs/i18n PR)
I have added a decision log entry if the change affects the architecture or changes a significant technology
Changes
setLocale
in middleware, so the logic doesn't have to be repeated in every page route and layout template.Associated issue
N/A
How to test
Checklist
I have added/updated tests to prove that my feature works (if not possible please explain why)I have made changes to the README and if the change affects the project setup (npm commands changed, new service added, environmental variable added)(will add todocs/i18n
PR)I have added a decision log entry if the change affects the architecture or changes a significant technology