From 3b0f0a18bc063ec01ed23f2d431cd2871e4d31ff Mon Sep 17 00:00:00 2001 From: "Zeller, Christina" Date: Thu, 9 Jun 2022 09:14:25 +0200 Subject: [PATCH 1/2] i18n: removes incorrect mark for translation. * Refs: #415 --- invenio_accounts/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_accounts/utils.py b/invenio_accounts/utils.py index 988088ca..5826b908 100644 --- a/invenio_accounts/utils.py +++ b/invenio_accounts/utils.py @@ -215,5 +215,5 @@ def validate_username(username): if not re.fullmatch(username_regex, username): # if validation fails, we raise a ValueError with the configured # text explaining the validation rules. - message = _(current_app.config["ACCOUNTS_USERNAME_RULES_TEXT"]) + message = current_app.config["ACCOUNTS_USERNAME_RULES_TEXT"] raise ValueError(message) From 2bd3a6947d294a8fe2217e0d2bd8ea319520318c Mon Sep 17 00:00:00 2001 From: "Zeller, Christina" Date: Thu, 9 Jun 2022 09:17:54 +0200 Subject: [PATCH 2/2] i18n: Adds mark for translation. * Refs: #415 --- invenio_accounts/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invenio_accounts/config.py b/invenio_accounts/config.py index 7b1e1fed..386c6799 100644 --- a/invenio_accounts/config.py +++ b/invenio_accounts/config.py @@ -11,6 +11,8 @@ from datetime import timedelta +from flask_babelex import lazy_gettext as _ + from .profiles import UserPreferencesSchema, UserProfileSchema from .views import login @@ -317,7 +319,7 @@ to reflect the changes. """ -ACCOUNTS_USERNAME_RULES_TEXT = ( +ACCOUNTS_USERNAME_RULES_TEXT = _( "Username must start with a letter, be at least three characters long and" " only contain alphanumeric characters, dashes and underscores." )