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 – Vivek Kumar Dec 24 '17 at 14:02
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??? – Amd2030 Dec 25 '17 at 6:37
  • As mentioned in the code – Vivek Kumar Dec 25 '17 at 6:39
  • in which file I should but this code? – Amd2030 Dec 25 '17 at 6:40
  • Do you know the file where the text to be translated is written? – Vivek Kumar Dec 25 '17 at 6:41
  • yes in csv file – Amd2030 Dec 25 '17 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

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.