2

After adding an item into cart if we goto mini cart and click on remove item a confirmation popup with Ok and Cancel option will appear. I am not able to translate the Ok and Cancel buttons.

Please guide me how to do this. Thanks in advance.

  • On which language you want to translate? – Sukumar Gorai Jul 12 '18 at 12:51
  • to german and french – Dilip Jul 12 '18 at 13:05
  • Did you solve this? – soofz Apr 17 at 7:49
  • No, i didn't get the answer. – Dilip Apr 23 at 9:38
1

Minicart confirmation popup button text Ok and Cancel option comes to the below file path. You can able to find that two button text form there.

File path: magento/vendor/magento/module-ui/view/base/web/js/modal/confirm.js

buttons: [{
    text: $t('Cancel'),
    class: 'action-secondary action-dismiss',

    /**
     * Click handler.
     */
    click: function (event) {
        this.closeModal(event);
    }
}, {
    text: $t('OK'),
    class: 'action-primary action-accept',

    /**
     * Click handler.
     */
    click: function (event) {
        this.closeModal(event, true);
    }
}]
0

https://github.com/magento/magento2/issues/17193 Magento 2.3.0. This fix cant resolve the issue for me. I fixed it via adding translation in template and variables:

vendor/magento/module-ui/view/base/web/templates/modal/modal-popup.html

        <footer class="modal-footer">
        <% _.each(data.buttons, function(button) { %>
        <button
            class="<%- button.class %>"
            type="button"
            data-role="action"><span><%= jQuery.mage.__(button.text) %></span></button>
        <% }); %>
    </footer>

and

vendor/magento/module-ui/view/base/web/js/modal/confirm.js

], function ($, _, $t) {
'use strict';

var cancelBtn = $t('Cancel');
var okBtn = $t('Ok');

and then

            buttons: [{
            text: cancelBtn,
            class: 'action-secondary action-dismiss',

            /**
             * Click handler.
             */
            click: function (event) {
                this.closeModal(event);
            }
        }, {
            text: okBtn,
            class: 'action-primary action-accept',

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.