Unfortunatelly in my case I cannot uncheck Locale setting, it is disabled. Could you please give me some help how to associate english language to English store. Thx
This can happen when your site is production mode because if the locale is changed and there has been no static content generated for that locale there will be no assets available. The frontend would request assets from a location that would not exist and all styles and scripts would 404, which obviously isn't ideal.
You can see the disabling happening here: https://github.com/magento/magento2/blob/2.2.6/app/code/Magento/Backend/etc/adminhtml/di.xml#L149-L155. The class
ConcealInProductionWithoutScdOnDemand is disabling the field if "Static Content On Demand" is not enabled (I'm not exactly sure where this feature is enabled if I'm honest) preventing you from potentially breaking the site.
If you are sure you have static content succesfully generated for the locale you're changing to either change this via one of these methods:
- Change the value using the CLI with
- Change the value directly in the DB
- Force the value using devtools in the browser
For me, I'll need to introduce the change at the start of my deploy process. It's up to you to establish when to change the value based on your process.
Change to developer mode using bellow command, change your settings, save, and back to production, and deploy again using your new locals.
change to developer
php bin/magento deploy:mode:set developer --skip-compilation
back to productin
php bin/magento deploy:mode:set production --skip-compilation
php bin/magento setup:static-content:deploy en_GB
So far I didn't go deep and debug the cause. But as quick workaround you can use your browser's developer console and remove the "disabled" attribute from the checkbox "Use Website". This allows you to uncheck it, select a locale and save the configuration.
This does not solve the problem itself, but worked for me to set the locale.