-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Use with concrete module component label E.g. "Component: Webapi" + "Catalog"Fixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions (*)
- Error occourds in 2.1.14, but I can reproduce this also in 2.3-develop
- at least two store views. Default store-view locale != second store view
- It doesn't matter, if you have one or multiple stores
Steps to reproduce (*)
- Configure stores. I use Store-View "default" with locale en_US and StoreView "second" with locale de_DE
- Use something, that returns magento phrase (I wrote a test module here: https://github.com/jwundrak/magento2-api-locale )
- Call rest API (with the module /rest/second/V1/localeTest)
Actual result (*)
Output of the test module:
{
"locale": "en_US",
"test_translation": "Category",
"store_code": "second",
"store_locale": "de_DE"
}
Expected result (*)
Output of the test module:
{
"locale": "de_DE",
"test_translation": "Kategorie",
"store_code": "second",
"store_locale": "de_DE"
}
Possible solution
In \Magento\Webapi\Controller\PathProcessor::process
I start an emulation of the locale: $this->localeResolver->emulate($this->storeManager->getStore()->getId());
. I'm not sure, if this is the correct way, but works here in 2.1 and 2.3: https://gist.github.com/jwundrak/11ea7ca0b5c6cea57d3b7c8133548634
sreichel
Metadata
Metadata
Assignees
Labels
Component: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Use with concrete module component label E.g. "Component: Webapi" + "Catalog"Fixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release