Magento2: Magento 2.1.9 translate doesn't work in minicart and checkout

Created on 29 Oct 2017  路  10Comments  路  Source: magento/magento2


Preconditions


  1. I am using Magento 2.1.9
  2. Instaled 2 language packs, English and Romanian (correctly deployed and upgraded, cache cleared etc.)

Steps to reproduce

  1. I have 3 translating issues when the site is in Romanian:
    a. The first one is when I click on the "Add to Cart" button, the following text is still in English: Adding..., Added, Add to Cart
    b. When I see the minicart in top right, none of the text is translated (e.g. Go to Checkout, See Details, Item(s), View or Edit Cart etc)
    c. When I go to Checkout I find that almost every text is in English
  2. I have checked the translation csv file and all the text is there.

Expected result

  1. Can anyone tell me how to solve this in order to have teh Romanian language loads correctly?

Actual result

  1. [Screenshot, logs]
    I have attached the minicart and checkout screen shots supposed to be in Romanian.
    screen shot 2017-10-29 at 23 38 35
    screen shot 2017-10-29 at 23 50 47

Format is valid needs update

Most helpful comment

Hello everyone,

I solved the issue following the post of @tadhgbowe on Jun 1st.

Here it is:
"Great! The fix is below. Sorry I don't have time to follow up myself. What would be even more amazing is to be able to track MAGETWO-69601 somewhere. When the ticket has been resolved it would be great if the original source (i.e. here) could be updated with the Magento release versions that contained the fix. For people who stumble across this post in the future they can then clearly see what version it was fixed in. Right now it's quite fuzzy. Cheers. T

In vendor/magento/module-translation/Model/Json/PreProcessor.php

$area = $this->areaList->getArea($areaCode);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

needs to be:

$area = $this->areaList->getArea($areaCode);
$area->load(\Magento\Framework\App\Area::PART_DESIGN);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

It needs to load the design before loading the translations. The above insertion then works for me! So hopefully Magento will pick up on this soon."

All 10 comments

@Cornel99 , thank you for your report.
We were not able to reproduce this issue by following the steps you provided.
Please provide more detail about language packages.

Steps to reproduce

a. When I click on the "Adauga in cos"(Add to Cart) button, the following text is appear in English (rather than the language used): Adding..., Added, Add to Cart
b. When I click on the minicart in top right to finalize the order, the texts also remain in English "Go to Checkout", "See Details", "Item(s)", "View or Edit Cart", "Qty")
c. When I go to Checkout I find that almost every text is in English
I have checked the translation csv file and all the text is there.

Expected result

a. after hitting the "Adauga in cos"(Add to Cart) button the text should be translated and to see "Se adauga...", "Adaugat" and came back to "Adauga in cos"
b. In the minicart the text should be "Finalizeaza" instead of "Go to Checkout". "Vezi detalii" instead of "See details" etc
c. In the Checkout area the text must be translated, like "Shipping", "Shipping Address", "Review and Payments", "Next", "Order Summary" etc.

Please check the screen shots.

If you need more info please let me know.
Cornel

Same problem here using 2.1.9

I've got the same issue with Magento 2.1.9.

Edit:
Looks like this issue is also on Magento 2.2.0

Same issue in Magento 2.2.0

Hello everyone,

I solved the issue following the post of @tadhgbowe on Jun 1st.

Here it is:
"Great! The fix is below. Sorry I don't have time to follow up myself. What would be even more amazing is to be able to track MAGETWO-69601 somewhere. When the ticket has been resolved it would be great if the original source (i.e. here) could be updated with the Magento release versions that contained the fix. For people who stumble across this post in the future they can then clearly see what version it was fixed in. Right now it's quite fuzzy. Cheers. T

In vendor/magento/module-translation/Model/Json/PreProcessor.php

$area = $this->areaList->getArea($areaCode);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

needs to be:

$area = $this->areaList->getArea($areaCode);
$area->load(\Magento\Framework\App\Area::PART_DESIGN);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

It needs to load the design before loading the translations. The above insertion then works for me! So hopefully Magento will pick up on this soon."

Thanks @Cornel99. It worked in Magento 2.2.0!

@Cornel99 After editing the PreProcessor.php file is there anything else I should do, I have cleared cache and re-run static-content:deploy, but I still have the issue that mini cart is not being translated.
Am running 2.1.10

same here in 2.1.9, I try to run the static-content:deploy then I also try for each separate languages, or only my theme, flush and clean the cache, flush cache storage in Admin, still no change...

I faced same issue,Page with loading translated text but not the mini cart content and "adding..., added"
words in Add to cart buttons.but later I checked that my app was on developer mode, so I ran static-content:deploye de_DE -f , and its works fine for me now. All words on my website is translted in german with minicart and other dynamic genrated text.

Was this page helpful?
0 / 5 - 0 ratings