Skip to content

make call to get_locale of handler lazy and remove it from before_handler() #1

@mrtopf

Description

@mrtopf

Indirectly get_locale from the language selector function will be called on before_handler. If you need information from another module inside that function and the module in question is called afterwards, you don't have that (e.g. the user from userbase).

Thus this function should be called lazy and not on handler instantiation. it should be called once it's first used (and only once apparently but the code might make sure of that already by storing the result in the handler).

Best would probably be in self._() although this is already bound to gettext IIRC. But there should be some solution to that or alternatively a user should make sure that babel is always the last module.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions