Skip to content
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

i18n: Fixing mark for translation. #416

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jun 9, 2022

@ghost ghost force-pushed the fix-translation-mark branch from cc63fa6 to fdec657 Compare June 9, 2022 07:33
@kpsherva kpsherva self-requested a review June 9, 2022 09:46
@@ -206,5 +206,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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACCOUNTS_USERNAME_RULES_TEXT is "double translated" in this way, I would probably only leave one of the two translation function calls, what do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACCOUNTS_USERNAME_RULES_TEXT is an argument for current_app.config.
Currently the string ACCOUNTS_USERNAME_RULES_TEXT is marked for translation, meaning that we change this string and therefore the argument for current_app.config - not the message that is returned.

What we need to do is to translate the string that is returned as message instead. This is part of config.py and there we marked the respective string for translation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ghost ghost force-pushed the fix-translation-mark branch from fdec657 to 2bd3a69 Compare June 9, 2022 09:55
@kpsherva kpsherva merged commit 9bb9c90 into inveniosoftware:master Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect marking for translation
1 participant