Magento2: Unable to translate strings that come from JS

Created on 29 Jul 2016  路  11Comments  路  Source: magento/magento2

There are several strings in Magento that are not coded properly, see those two examples. You also can't clone the corresponding template files to your theme files and modify them, the changes are non functional.

Here are two examples:

  • in Checkout, when using an e-mail adress that is already registered -> password string.
    bildschirmfoto 2016-07-29 um 16 50 34
  • when trying to remove something from the minicart -> Remove String
    bildschirmfoto 2016-07-29 um 16 51 49

The String for the removal is located in /vendor/magento/module-checkout/web/view/minicart.js. You can modify the string to whatever, it won't change in the frontend.

needs update bug report

Most helpful comment

I have the same problem, I fixed it in a very ugly way with CSS
.modal-content > div::before { content: "Wollen Sie diesen Artikel wirklich aus Ihrem Einkaufswagen entfernen?"; color: #333; } .modal-content > div { color: white; }

All 11 comments

@antboiko passing to Anton. Think the JS strings may be a duplicate but please check the other issue mentioned

By the way, I've grepped all occourences of those strings via "$ grep -rl "string" *" and found only 2 appearances. One in a i18n-CSV and one in the JS Files.

Hi @grasdaggel , what Magento version are you using?

Thanks,
Anton.

Hi @antboiko, we are using Magento 2.0.6 and Magento 2.0.4 (Screenshots are from .6)

In Magento 2.1.0 I was able to translate to spanish the string: "Are you sure you would like to remove this item from the shopping cart?" using the .CSV file

Is it still actual? I can translate strings you mentioned. Try update to latest release version version.

Thanks for the information.

Updating would implement a bunch of other already known bugs, and therefore we will just use the version we are using right now.

We are closing this issue because it hasn鈥檛 been updated in more than two weeks. If you can still reproduce this issue, please create a new GitHub issue report.

If someone is having the same problem, that part of code in minicart.js has line breaks and indents:

'confirmMessage': $.mage.__(
                'Are you sure you would like to remove this item from the shopping cart?'
            )

Just add the checkout module to your theme Magento_Checkout/web/js/view/minicart.js, copy the minicart.js content and edit the specific part, so that it is one line.

'confirmMessage': $.mage.__('Are you sure you would like to remove this item from the shopping cart?')

@exreplay
Thank you but for me it still doesn't work.

I have the same problem, I fixed it in a very ugly way with CSS
.modal-content > div::before { content: "Wollen Sie diesen Artikel wirklich aus Ihrem Einkaufswagen entfernen?"; color: #333; } .modal-content > div { color: white; }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreaskoch picture andreaskoch  路  3Comments

denis-g picture denis-g  路  3Comments

phirunson picture phirunson  路  3Comments

jzalenski picture jzalenski  路  3Comments

PushEngineering picture PushEngineering  路  3Comments