Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
mrtopf opened this issue Apr 19, 2013 · 0 comments

Comments

@mrtopf
Copy link
Member

mrtopf commented Apr 19, 2013

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant