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

Empty `defaultCpLanguage` sets initial account language to German on visiting and saving Account page #3142

Closed
rungta opened this issue Jul 24, 2018 · 3 comments

Comments

@rungta
Copy link

commented Jul 24, 2018

Description

A fresh Craft install with no custom value for the defaultCpLanguage config, and a single site with the language set to a region specific English (like en-in) does not appear to explicitly assign a language for the initial user account. This leads to the user account being assigned the first option from the list of supported languages in the Language dropdown on the My Account page, and saving that page results in the user's language inadvertently switching to German. The issue does not effect any subsequent accounts created from inside the control panel, just the initial account created during the setup process.

Steps to reproduce

  1. Create a fresh Craft CMS install
  2. During the setup, pick a region specific English, like en-IN as the default site's Language.
  3. Complete the setup process
  4. Visit the default user's My Account page
  5. Save

Additional info

  • Craft version: 3.0.16.1
  • PHP version: 7.1
  • Database driver & version: MySQL
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 24, 2018

With Dev Mode enabled, please create a test template with this in it:

{{ dump(craft.app.request.getAcceptableLanguages()) }}

Can you tell me what that outputs when you access it from a browser?

@rungta

This comment has been minimized.

Copy link
Author

commented Jul 24, 2018

array(4) {
  [0]=>
  string(5) "en-GB"
  [1]=>
  string(2) "en"
  [2]=>
  string(5) "en-US"
  [3]=>
  string(2) "hi"
}
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 24, 2018

Thanks! Fixed for today’s release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.