-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Different locale Settings don't work #479
Comments
@sepple , could you please provide more details? I have just created two store views and set English for one and German for the other. On the frontend the locale were switched once I switched store views. |
Of course. The store view switch works perfectly, but the locale does not. I set locale en_US as default, Store View international uses default and Store View German uses de_DE (overrides default) in system configuration. When i switch the store view to German, the locale isn't changed according to the configuration settings. |
Well, that's strange. Let me then create a ticket for this and place it to the backlog. Once the team looks at it, we will let you know of the investigation results. |
@sepple , we had our team look at the issue. Well, no good news for this particular issue... We could not reproduce it. Locales are switched on the frontend when changing store views as assigned in the backend. Below is the response from the team regarding your original message: "Yes, in fact Magento\Core\Model\Locale::setLocale() is called without any arguments when initializing in the constructor. However, in the method itself, it inquires for a locale from the store configuration. Thus, if a locale set for the store is not default, it returns the locale set by you." |
I inspected it again and the behaviour is actually slightly different than I wrote before. Scenarios: I'll try to figure out what's going wrong at my installation and report afterwards (if I'm able to). |
@verklov I now traced it. Magento\Module\Updater in function updateScheme() Important thing is Magento\App\State::$_updateMode == true while looping When the loop arrives at Magento_Directory, couple of classes are instanciated, triggered by Using Magento\ObjectManager\ObjectManager, Magento\Interception\FactoryDecorator, Magento\ObjectManager\Factory\Factory, and Magento\ObjectManager\Factory\Factory::_resolveArguments(...) causing recursion following is instanciated: Magento\Core\Model\Locale::__construct(...) is called with arg[9] = NULL, this is the locale. This function calls Following is interesting now: $this->_getDefaultStore() simply returns $this-> _store when not empty. That's what is happening at my installation. The locale is then available in the Locale class and never set again during lifetime of Locale. So it never is set with update mode false and locale is always the locale of the first store in store list. |
@sepple , thanks for digging in the code! I will forward your investigation results to the team to look at the issue again. |
@sepple, apparently we had such issue at the time you reported it. Having verified it on the most recent code, we cannot reproduce it any more. We are closing this issue. |
[Folks] Shipping Address and Method in Quote API
Issues fixed: - MAGETWO-54026 Automate Move a Store View to Another Store on the Same Website - MAGETWO-55418 Variations and Constraints Review for automated functional tests in Store module - MAGETWO-58260 Automate Frontend Customer Change Email - MAGETWO-58261 Automate Frontend Customer Change Password - MAGETWO-58354 Automate Block Cache Exploit - MAGETWO-59432 Add missing constraints severity for cms module - MAGETWO-57719 Intermittent HTTP ERROR 500 during checkout
I was creating two store views and configured different locale settings in the backend. A store switch does not change the locale. Seems like just the default locale is used.
The text was updated successfully, but these errors were encountered: