In magento 2, I need to export in file all alert and error messages in order to translate them.

I already try this :

php bin/magento i18n:collect-phrases app/code/ -o translate.csv

But this not exactly what I want because every text are exported, I just want alert or error messages.

Do you know a way to achieve this ?


1 Answer 1


In Magento all strings that are to be translated are treated by the system in the same way, regardless if that is used as an error message or as a success message. So you have to filter your translate.csv manually. Anyway, the best approach is to translate them all.

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.