2

I need to translate the text Enter your billing address to get a tax estimate. in vendor\magento\module-checkout\view\frontend\web\template\cart\shipping-estimation.html

It is a text showing in the cart

<form method="post" id="shipping-zip-form">
    <fieldset class="fieldset estimate">
        <legend class="legend">
            <span data-bind="text: isVirtual ? $t('Estimate Tax') : $t('Estimate Shipping and Tax') "></span>
        </legend><br>
        <p class="field note" data-bind="text: isVirtual ? $t('Enter your billing address to get a tax estimate.') : $t('Enter your destination to get a shipping estimate.')"></p>
        <!-- ko foreach: getRegion('address-fieldsets') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
    </fieldset>
</form>

I added the translation in app\design\frontend\company\base\i18n\de_DE.csv:

"Enter your destination to get a shipping estimate.", "Bitte geben Sie Ihren Ort an um eine Versandkostenschätzung zu erhalten."

and cleared the cache, but nothing changes.

2

I think I found a solution that works for me at least.

My translation file is in:

app/design/frontend/**MyPackage**/**MyTheme**/i18n/XX_XX.csv

I added the string there.

Then I copied this file to my theme folder:

vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-estimation

to

app/design/frontend/**Yourpackage**/**Yourtheme**/Magento_Checkout/web/template/cart/shipping-estimation.html

Then I flushed all caches and manually deleted this file (I'm in developer mode):

pub/static/frontend/**Yourpackage**/**Yourtheme**/XX_XX/js-translation.json

When I refreshed the frontend checkout page the string was translated.

3
  • 1
    The solution is to clear the folder pub/static/frontend/, you don't need a copy of the template in your theme. I solved it by executing grunt clean and clearing the cache. – Black Mar 26 '20 at 12:45
  • 1
    Ok. Have to try that. Maybe I missed that... I ran to this problem myself today. Thanks for the info. – Webninja Mar 26 '20 at 14:01
  • When I follow these steps my styling is changing just for the part I translated – jibin george Jun 22 '20 at 10:08

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.