Skip to content

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:

  1. #418290 (closed)
  2. #382387

How to set up and validate locally

  1. Simulate SaaS
  2. Visit local GDK /users/sign_up
  3. Delete the preferred_language cookie in browser
  4. Change browser setting to one of these languages: Deutsch, Francais, Japanese, Simplified-Chinese, Traditional-Chinese
  5. Visit sign-up page again, displayed language should correspond to the browser setting.
  6. Delete the preferred_language cookie again
  7. 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')
  8. 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.

Edited by Roy Liu

Merge request reports