I need to translate this question: "The requested qty is not available\nSome of the products are out of stock." This is a message from API payment information on the checkout page when I click the button checkout.

I add this sentence to my translate file. But it is not working because of "\n". I can't change the message so how can I translate this?

I overrided file Magento_Ui/web/template/messages.html (change text: $data to i18n: $data)

Please help me. Thank you.

1 Answer 1


Try placing the \ with ', like \', followed by the n = \'n.

Magento uses " for starting and ending the translation and ' for special characters inside a translation.

But it may not be related to the "\n". Sometimes Magento seems to ignore the translations on certain sentences of added extensions. You may translate it directly on the checkout page file of your theme and extension, not on i18n .csv file. I have been forced to do this several times on my projects.

Your Answer

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

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