mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Always set locale to use for a request in the api
This commit is contained in:
parent
f8c58b308a
commit
6a989e655a
1 changed files with 4 additions and 3 deletions
|
@ -554,9 +554,10 @@ class Interface(BaseInterface):
|
||||||
## Attempt to retrieve and set locale
|
## Attempt to retrieve and set locale
|
||||||
def api18n(callback):
|
def api18n(callback):
|
||||||
try:
|
try:
|
||||||
m18n.set_locale(request.params.pop('locale'))
|
locale = request.params.pop('locale')
|
||||||
except:
|
except KeyError:
|
||||||
pass
|
locale = m18n.default_locale
|
||||||
|
m18n.set_locale(locale)
|
||||||
return callback
|
return callback
|
||||||
|
|
||||||
# Install plugins
|
# Install plugins
|
||||||
|
|
Loading…
Add table
Reference in a new issue