0

Like in the title - I have a problem with adding translate to file master.html in PageBuilder. I tried these solutions:

 <h3 data-bind="i18n: 'text'"></h3>
 <h3 translate="'text'"></h3>

And it doesn't work.

2 Answers 2

0

Follow these steps to add translation functionality to the master.html file in Magento 2 Page Builder:

  1. Create a language file for your theme first. To accomplish this, create a new directory in app/design/frontend/YourVendor/YourTheme/i18n and name it en US for English US.
  2. Next, in the i18n directory, create a new CSV file and name it after your theme (e.g. YourTheme.csv). Your translations will be saved in this file.
  3. Open Page Builder and locate the text that needs to be translated in the master.html file.
  4. Wrap the text in the __() function, as in: __("Your text here").
  5. Save the master.html file.
  6. Open the YourTheme.csv file and create a new row for each text string to be translated. The text string (in English) should be in the first column, and the translated text string should be in the second.
  7. Save the file YourTheme.csv.
  8. Flush the Magento cache.

When you view your store in the translated language, the text that you wrapped in the __() function should now be displayed in the translated language.

1
  • It doesn't works
    – bambo
    Mar 22 at 9:49
0

you need to use:

 {{trans "Lorem Ipsum is simply dummy text of the printing"}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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