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?
2 Answers
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.
- how to provide i18n: in front of the value of data-bind attribute???Amd2030– Amd20302017-12-25 06:37:42 +00:00Commented Dec 25, 2017 at 6:37
- As mentioned in the codeVivek Kumar– Vivek Kumar2017-12-25 06:39:22 +00:00Commented Dec 25, 2017 at 6:39
- in which file I should but this code?Amd2030– Amd20302017-12-25 06:40:05 +00:00Commented Dec 25, 2017 at 6:40
- Do you know the file where the text to be translated is written?Vivek Kumar– Vivek Kumar2017-12-25 06:41:53 +00:00Commented Dec 25, 2017 at 6:41
-
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'); ?> - @Ahmedabad all the text" this is a required feild" is translated in translation files. where should i put this code?Amd2030– Amd20302017-12-23 21:18:33 +00:00Commented Dec 23, 2017 at 21:18
- Please check step by step explanation at devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/…Himmat Paliwal– Himmat Paliwal2017-12-24 04:19:11 +00:00Commented Dec 24, 2017 at 4:19
- also check devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/… :), hope it help!Himmat Paliwal– Himmat Paliwal2017-12-24 04:20:38 +00:00Commented Dec 24, 2017 at 4:20
- @Ahmedabad really not help is there steps to solve this issue?Amd2030– Amd20302017-12-24 06:10:29 +00:00Commented Dec 24, 2017 at 6:10
