-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADX-1014 Add Babel translation #6
Conversation
…cture environment
# Conflicts: # Pipfile.lock # ape/logic.py # ape/routes.py # ape/util.py
…event form resubmission upon page refresh
@@ -1,6 +1,7 @@ | |||
from flask_wtf import FlaskForm | |||
from wtforms import StringField, SubmitField, EmailField | |||
from wtforms.validators import DataRequired, Email | |||
from flask_babel import lazy_gettext as _l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we use only underscore as an alias to gettext. Please change to:
from flask_babel import lazy_gettext as _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use it for lazy_gettext as well? This convention (_l
) was suggested by Miguel Grindberg, as it's a different import. I suggest leave it as is, since lazy_gettext
is different than gettext
and to see this one would need to look at import statement.
ape/routes.py
Outdated
+ urlencode( | ||
{ | ||
"returnTo": url_for("main.home", _external=True), | ||
"client_id": env.get("AUTH0_CLIENT_ID"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AUTH0_CLIENT_ID should be read from config?
ADX-1014 Add Babel translation
Add translation feature of all messages in application. Move configuration into
Config
object pattern.Dependency Changes (delete if not applicable)
flask-babel has been added in latest version, which changed a bit way of setting up translations comparing to navigator. Namely, the 'locale_selector' is a function passed into babel's
init_app()
.Testing (delete if not applicable)
Internationalisation and Localisation (delete if not applicable)
Translations to
fr
andpt_PT
done.Checklist
Put an
x
in the boxes that apply to this pull request (you can also fill these out after opening the pull request).You may not need to check all boxes.