cancel
Showing results for 
Search instead for 
Did you mean: 

Template with javascript translation.

SOLVED

Template with javascript translation.

I try to translate checkout page and have a problem.

For exaple: I have template file /app/code/Magento/Customer/view/frontend/web/template/customer-email.html

with the following content:

<span class="note" data-bind="text: $t('You already have an account with us. Sign in or continue as guest.')"></span>

How do I properly do the translation?

Replace the specified text string pattern seems wrong.

May be I need add content in file /pub/static/frontend/Magento/luma/en_US/js-translation.json ?

But I have no imagination should look like this file.
Tell me please format of the file, if wines relates to the translation.

2 REPLIES

Re: Template with javascript translation.

You should change

 

You already have an account with us. Sign in or continue as guest.

to

 

<?php echo $this->__('You already have an account with us. Sign in or continue as guest.'); ?>

You can then put that string in a locale file. You can actually include your own by putting it in your modules app/design/frontend/<package>/<theme>/locale/<code>/translate.csv

Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Template with javascript translation.

Is there a solution for Magento 2 too? The answer seems to be Matento 1 related and the question is Magento 2.