diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-03-22 09:43:41 +0100 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-03-22 11:19:26 +0100 |
commit | ee6880a9f291b24da09b2e2844deeb0dfe14a5b6 (patch) | |
tree | 2ef5cf9461f5a8b54ba198a49f3211ed228bcf81 /ogcp | |
parent | c8cf49bf6caaaf632b6ea7a9687270ac46a5ea56 (diff) |
Use lazy translation on intervals' strings
Constant strings outside of a request must use lazy strings. See
flask-babel documentation for more information.
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/views.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 752db62..01b7a0f 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -25,6 +25,7 @@ from pathlib import Path from ogcp.models import User from ogcp.forms.auth import LoginForm from ogcp.og_server import OGServer +from flask_babel import lazy_gettext as _l from flask_babel import _ from ogcp import app import requests @@ -185,9 +186,9 @@ def get_user(username): intervals = ( - (_('days'), 86400), # 60 * 60 * 24 - (_('hours'), 3600), # 60 * 60 - (_('minutes'), 60), + (_l('days'), 86400), # 60 * 60 * 24 + (_l('hours'), 3600), # 60 * 60 + (_l('minutes'), 60), ) |