Closed bernd-reindl closed 7 months ago
Hi @bernd-reindl. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@bernd-reindl do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
i confirm
Hi @engcom-Charlie. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-30382
were created
Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Same here. M 2.3.2
Same here. M 2.3.3
@magento-engcom-team When can this ticket be picked up?
Just a workaround but you can force the theme translations in a custom rest endpoint by using the frontend store emulation with the force param set to true. This way the translations are reloaded with the respective theme.
$this->emulation->startEnvironmentEmulation($storeId, 'frontend', true);
Cart request on checkout is coming from web api. So theme translation is not in the scope of API. You can either add the translation under some other module or you can add it to under app/i18n/de_DE
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!
This issue is still relevant. I want to use the Finnish language pack, but there are a lot of translations in it that are non-translated (they are still English to English) and because they exist in the language pack, I can't override them in a module. I can override them in theme, but as mention earlier, API requests don't use translations from a theme.
I could copy the language pack and modify it manually, but that's going to make it very cumbersome to update it later.
I have already submitted all the translation changes I need via the usual channels to update the language packs, but it seems the language pack updating process is basically dead as well.
Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.
Please feel free to comment or reopen according to the Issue reporting guidelines
the ticket if you are still facing this issue on the latest 2.x-develop
branch. Thank you for collaboration.
Still valid on 2.4.3
Adding a frontend emulation around the exception works for me as a workaround.
# magento/module-quote/Model/CouponManagement.php
$this->emulation->startEnvironmentEmulation($quote->getStoreId(), 'frontend', true);
throw new NoSuchEntityException(__("The coupon code isn't valid. Verify the code and try again."));
$this->emulation->stopEnvironmentEmulation();
@stale
@magento-probot-user
@magento-probot-user unstale
Seems to be still valid in 2.4.1 and above.
Any updates ?
Thanks for reopening. We're seeing the exact same scenario on 2.4.2
Any update on this one? we are having the same issue on 2.4.2, two years with the same issue....
Any update on this one? same error on 2.4.3... :(
adding emulation into rest api functions is resolve the problem...
$emulation = ObjectManager::getInstance()->get('\Magento\Store\Model\App\Emulation');
$emulation->startEnvironmentEmulation($storeId, 'frontend', true);
// function content
$emulation->stopEnvironmentEmulation();
Is there anyone who could offer a fix for this problem?
To me it makes sense that a REST request does not use theme translations, because a theme has nothing to do with a REST request, no? A REST request is aware of a storeview, but not about themes, because that makes little sense.
If you want custom translations that are loaded both by the theme and the REST api, it will probably work when you put them in app/i18n/...
like explained over here or like @cyildirim already suggested earlier.
To me it makes sense that a REST request does not use theme translations, because a theme has nothing to do with a REST request, no? A REST request is aware of a storeview, but not about themes, because that makes little sense.
If you want custom translations that are loaded both by the theme and the REST api, it will probably work when you put them in
app/i18n/...
like explained over here or like @cyildirim already suggested earlier.
got it - thanks!! Its finally translated.
Just dropping this here...
--- a/vendor/magento/module-quote/Model/CouponManagement.php
+++ b/vendor/magento/module-quote/Model/CouponManagement.php
@@ -25,15 +25,22 @@
*/
protected $quoteRepository;
+ /**
+ * \Magento\Store\Model\App\Emulation
+ */
+ protected $emulation;
+
/**
* Constructs a coupon read service object.
*
* @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository Quote repository.
*/
public function __construct(
- \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
+ \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
+ \Magento\Store\Model\App\Emulation $emulation
) {
$this->quoteRepository = $quoteRepository;
+ $this->emulation = $emulation;
}
/**
@@ -73,7 +80,9 @@
);
}
if ($quote->getCouponCode() != $couponCode) {
+ $this->emulation->startEnvironmentEmulation($quote->getStoreId(), 'frontend', true);
throw new NoSuchEntityException(__("The coupon code isn't valid. Verify the code and try again."));
+ $this->emulation->stopEnvironmentEmulation();
}
return true;
}
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Hi @bernd-reindl
Thanks for reporting and collaboration.
Verified the issue in magento 2.4 dev instance but the issue is not reproducable.
We are seeing the error message in german.
Please refer the screenshots attached , please verify the issue in latest magneto instance and let us know if we missed anything.
Hi @bernd-reindl
We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.
Thanks.
@engcom-Dash Did you test this with V1/carts/mine/totals-information too?
A theme translation is not working there. A translation from app/i18n does.
@webloft, have you read the discussion? Like these comments for example:
@hostep yes we read that. We just not agree.
The request is loaded into a theme by default operation in frontend, so it has to deal with translations by the theme too. It can see the storefront, so where is the problem?
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)