Skip to content

In Sales Emails no translation using order.getStatusLabel() #14849

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

Closed
raymond62 opened this issue Apr 25, 2018 · 6 comments
Closed

In Sales Emails no translation using order.getStatusLabel() #14849

raymond62 opened this issue Apr 25, 2018 · 6 comments
Assignees
Labels
Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@raymond62
Copy link

Sending sales emails the label for order status is not translated.

Preconditions

  1. Magento 2.2.3., PHP 7.0, MySql 5.6

Steps to reproduce

  1. edit order status of any status and creat language labels (image 1)
  2. send an email using the sales area in your backoffice (image 2)
  3. see the status label in the email (image 3)

Expected result

  1. The status label in the email should get the respective order status label language

Actual result

  1. edit order status
    grafik

  2. send an email using the sales area
    grafik

  3. status label in the email. This should be German in this case
    grafik

I've read this issue, but guess this is not the same
#9014

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 25, 2018
@phoenix128 phoenix128 self-assigned this Apr 30, 2018
@phoenix128 phoenix128 added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release labels Apr 30, 2018
phoenix128 added a commit to phoenix128/magento2 that referenced this issue Apr 30, 2018
…der.getStatusLabel()

\Magento\Sales\Model\Order\Config::getStatusLabel(), used by template email was forcing the usage of getLabel() when in adminhtml area.
I added a new method getFrontendStatusLabel() in \Magento\Sales\Model\Order and modified email template files to use it instead of the original implementation.
I did not modify the original implementation because still in use by backend and frontend.
@Userr017
Copy link

Userr017 commented Jul 21, 2018

I have same problem with magento 2.2.5. What is the correctly fix for this without problems?

@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Sales Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Aug 29, 2018
@magento-engcom-team
Copy link
Contributor

Hi @raymond62. Thank you for your report.
The issue has been fixed in #14914 by @phoenix128 in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 12, 2018
magento-engcom-team added a commit that referenced this issue Nov 12, 2018
…ing order.getStatusLabel() #14914

 - Merge Pull Request #14914 from phoenix128/magento2:issue-14849-no-translation-order-status
 - Merged commits:
   1. 03e7de4
   2. 5d2b5be
   3. 1c9ce84
   4. 18ca5f0
   5. bd80b1a
   6. 2e634e4
magento-engcom-team pushed a commit that referenced this issue Nov 12, 2018
p-bystritsky added a commit to p-bystritsky/magento2 that referenced this issue Nov 13, 2018
p-bystritsky added a commit to p-bystritsky/magento2 that referenced this issue Jan 24, 2019
@magento-engcom-team
Copy link
Contributor

Hi @raymond62. Thank you for your report.
The issue has been fixed in #19182 by @p-bystritsky in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 1, 2019
@aqdennis
Copy link

aqdennis commented Apr 1, 2020

Are you sure it's fixed, because I'm still having this in version 2.3.2 ??

@Djohn12
Copy link

Djohn12 commented Sep 11, 2020

Hi,

I just came accross the issue in Magento 2.3.5-p2

The template /vendor/magento/module-sales/view/frontend/email/order_update.html is displaying order_status using

$order_data.frontend_status_label

That variable is set in /vendor/magento/module-sales/Model/Order/Email/Sender/OrderCommentSender.php and is not using the proper storeId. Thus the value cannot be properly translated.

'order_data' =>[ 'customer_name' => $order->getCustomerName(), 'frontend_status_label' => $order->getFrontendStatusLabel() ]

The use of $order.getFrontendStatusLabel() inside the template is working fine.

Do you plan on updating the template to implement the method getFrontendStatusLabel() so every status can be translated accordingly ?

@YiffyToys
Copy link

The use of $order.getFrontendStatusLabel() inside the template is working fine.

Do you plan on updating the template to implement the method getFrontendStatusLabel() so every status can be translated accordingly ?

In current Magento versions function calls are no loner allowed in email templates.
So this fix no longer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

8 participants