Closed Osmose closed 11 years ago
Excellent! Can't find anything wrong. r+
I guess I don't really understand it actually. When you do request_args = dict(getattr(settings, ...
what type does request_args
become at that point? A <type dict>
or some sort of lazy object?
It becomes a dict. Calling dict
on it forces evaluation of the lazy value at that moment. Same with the LazyEncoder
: it uses unicode
to force evaluation only when we finally need the value. And since that happens during a request, the localization and reversing work as expected.
It looks good to me. I don't really get it about the unicode promises and how that relates to l10n but I feel you're a couple of steps ahead on that one.
Want me to merge it?
Updates our use of BROWSERID_REQUEST_ARGS to support Django Promises. This is primarily useful for translating strings in the request args using lazy translation, as well as reversing URLs using reverse_lazy.