mirumee / django-prices

Django fields for the prices module
158 stars 53 forks source link

Update prices_i18n.py #16

Closed pbecotte closed 9 years ago

pbecotte commented 10 years ago

By default, babel will look at an environment variable to determine locale for currency. Since this doesn't look at the user's computer, we need to call this function with the locale variable set.

patrys commented 10 years ago

One thing is that Babel should follow Django's locale when configured properly:

http://babel.edgewall.org/wiki/BabelDjango#UsingtheMiddleware

Another thing is that you've changed all tags to display the gross price which seems to be a copy-paste error.

pbecotte commented 10 years ago

I corrected the copy paste error.

translation.get_language() will return the Django default from the settings file if there is not one in the user request. Also, BabelDjango isn't a requirement of the prices package- this makes it work with the regular babel package (at least on my installation lol). I haven't tried installing BabelDjango- does it work properly with that?

patrys commented 9 years ago

Closing as it works properly with BabelDjango.