Default to auto-detected language in user registration email. #129
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
KittenSquad/glewlwyd!129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "autodetect-registrant-language"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The email address confirmation button in the user registration form currently defaults to
config.languages[0].With this PR, new users will be proposed to receive their confirmation email in the language of the UI, typically as autodetected by
i18next-browser-languageDetector. (To be sure, I am also keepingconfig.languages[0]as a fallback, although I cannot imagine any conditions under which it would be useful; please feel free to trim if/as necessary.)The user remains free to select an alternative email language. That said, I wouldn't be against the removal of button altogether. Isn't it safe to assume that the UI language applies to emails, as well?
Thanks!
PS: Side-question: Do I understand correctly that a
langfield is attached to each user in the database? If so, when is it set and updated?Thanks for the PR @yrammos ,
To answer your questions, why there is a select available for the lang is because UI lang are for now limited, but an admin can add 50 different langs in the e-mail if she/he can.
On the opposite, if there are more langs available in the UI than in the e-mails, or different sets, this must be addressed to avoid UI bugs.
en,fr,nl, the user navigates innl, but the langs available in the e-mail areen,fr,ru, your PR would select an unavailable language. In the end the user would receive an e-mail with the default language but the UI may be buggy. This is easily fixable by checking that the current UI language is available in the e-mail languages though.In the registration plugin, the user isn't created yet, so there is no
langproperty attached yet. But in the e-mail code scheme, thelangproperty must be set@babelouest my PR may have been premature. A more robust solution would be to:
config.languageslist (otherwise disable the checkbox for that language).If this sounds good to you I can try to revise and resubmit.
That can be done, although the meaning is similar
I think that's overkill, if the admin wants to provide multiple e-mail languages, she/he must provide the translation of the full application in those languages first, otherwise they can't add the language in the list.
My experience is that lots of non-english speaking users are familiar with english forms, it's easy to understand the meaning of
Name,E-mailandPasswordso they can fill the form, but if they can have the confirmation e-mail in their own language, that's an easy nice-to-have.That's already the case, you must enter at least one e-mail content and you have to have one default language in the e-mail content list. Although the e-mail langs don't have to be UI languages if the admin doesn't want to.
That more or less what I intend to do.
When you arrive in the registration page, the
send registratione-mail is already present with the e-mail lang dropdown, after that, the user can change the UI lang. If so, the e-mail lang will be changed for the lang selected, unless the lang is unavailable for the e-mail, in that case the selected e-mail lang will be the default one.And of course, the user can manually select the e-mail lang.
@yrammos , I've updated the pull request with the change I described in the point 4 above.
If you have other feature requests or improvements, don't hesitate!