Use preferred language from browser for registration flows
What does this MR do and why?
Detect marketing site language option and browser language setting, and set the preferred_language
cookie base on that if the language is valid (high translation level).
Solves these two issues:
How to set up and validate locally
- Simulate SaaS
- Visit local GDK
/users/sign_up
- Delete the
preferred_language
cookie in browser - Change browser setting to one of these languages: Deutsch, Francais, Japanese, Simplified-Chinese, Traditional-Chinese
- Visit sign-up page again, displayed language should correspond to the browser setting.
- Delete the
preferred_language
cookie again - Visit
/-/trial_registrations/new?glm_source=about.gitlab.com/fr-fr/
(if browser setting is already French, change 'fr-fr' to 'de-de' or 'ja-jp') - Displayed language on trial registration page should correspond to the url param.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Roy Liu