
The first thing you face once managing a Magento 2 multi-language store, is translating all of your content and landing pages. However, the content you create and publish on the frontend is not the only content you need to translate.
That's why you have to generate a translation dictionary to form a list of texts to translate in email templates, third-party extensions, JS files, and so on. That's when you could face the Magento "Missed phrase" error.
Note: if you're using the and use the Search and Translate panel to find text to translate, you might still encounter this issue.
Reasons for Magento "missing phrase"
Magento "missing phrase" error mainly appears when you try to generate a translation dictionary when running the following command:
bin/magento i18n:collect-phrases --magento
Most often, the "Missed phrase" error comes from the third-party extensions. It's caused an empty string, like __('') the system tries to translate. In other words, it appears when the text wrapped in the translation function is missing.
How to Fix the Magento "missing phrase" Error?
To fix the issue, you first need to learn what module is causing the issue. For that run the following command:
grep -rnw . -e "__('')" -e '__("")'
It should return the files containing those empty strings as a parameter for the translation function.
Note: you have to pay attention to the non-Magento folders and files of the custom modules and themes.
If the command returns nothing, run the next commands to find a missed phrase
bin/magento i18n:collect-phrases ./app/
bin/magento i18n:collect-phrases ./vendor/
Once you track down those files, you have to change __('') to '' and __("") to "" in the file code.
After you've made the required changes in the corresponding files, you can regenerate the translation dictionary. The Magento "Missing phrase" error should be gone.
And if you want to extend your dictionary and automatically look for text to translate configure Magento Translation Extension.