Skip to content

Bug: i18n is a server-side singleton #545

@myieye

Description

@myieye

Our I18n translater is currently a server-side singleton.
So, a race condition could result in a user getting SSRed content in the locale of a different active user.

We re-initialize i18n on every page load. So, the correct locale is usually used.
But a second parallel request could set the locale to something else that is then used for both responses.

In other words, we need to put a translater into the context that explicitly uses the user's correct locale.
The library lets you pick a locale per translation we just haven't used that feature.

Here's the game plan:🏏

Metadata

Metadata

Assignees

Labels

Svelteowner: RobinbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions