-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The initial implementation of the locale per thread was done manually by setting Thread.current[:rosetta_locale_session] to an instance of Rosetta::LocaleSession.
This model encapsulates the logic of finding the correct locale based on the supplied input and fallback to the default locale if not found. This works well but I wondered if we'd be better off simply using the Rails CurrentAtributes API.
- It's reset after each request, removing the need for
Rosetta#with_localeto ensure the locale is set back to whatever it was before - It's built-in rails
- One less thread-related consideration in the code, this simplifies things.
Warning
CurrentAttributes being a thread level singleton instance, one needs to be careful not to override any potential user-defined attribute.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels