1

I uploaded a translation package from Magaplaze. but alert messages as text in red color in an image below not translated. how to do it?

Magento CE 2.1.9 enter image description here

1
  • Do you know where this text is coming from? If it is coming from a ko js file you can follow my answer Commented Dec 24, 2017 at 14:02

2 Answers 2

1

It seems the text you are trying to translate is coming from ko js. For translating phrases from ko js you should provide i18n: in front of the value of data-bind attribute. Something like below;

<element data-bind="i18n: something: function() { return $t('some string'); }" /> 

Note: Please note that the translation for corresponding string should be present in your language translation csv.

8
  • how to provide i18n: in front of the value of data-bind attribute??? Commented Dec 25, 2017 at 6:37
  • As mentioned in the code Commented Dec 25, 2017 at 6:39
  • in which file I should but this code? Commented Dec 25, 2017 at 6:40
  • Do you know the file where the text to be translated is written? Commented Dec 25, 2017 at 6:41
  • yes in csv file Commented Dec 25, 2017 at 7:22
0

It should be translated once the translation files are added. There is no any additional efforts required in case you are following the Magento 2 best practices.

Generally we need to add the text in below way to make it translatable by translation files:

<?php echo __('The text to be translated'); ?> 
4

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.