How to fix the «Missed phrase» exception on running the «bin/magento i18n:collect-phrases» command?

i18n:collect-phrases
localization
bug
bug-fix
command-line
third-party-extension
(Lin) #1

Sir
i try to translations export

bin/magento i18n:collect-phrases -o “/usr/share/nginx/html/123.csv” -m

but get error

[DomainException]
** Missed phrase**

0 Likes

Wondering if you're interested in an ongoing development support? Something like a monthly engagement where there are a few work on and off for extending Magento and managing it (system-level like upgrades)
(Dmitry Fedyuk) #2

It looks like a bug in Magento 2 core.
It is reproduced when the core tries to translate an empty string (in a way like this: __('')) from a third-party extension (or a design theme).

It is not reproduced if a system contains only the core Magento 2 modules.
It is not reproduced if a system contains only the core Magento 2 modules and Mage2.PRO extensions:

So it is a bug in the core, but in is caused by a third-party extension.
I recommend to look the installed third-part extensions (and design themes) source code for the empty translation expressions like __('').

0 Likes

(Lin) #3

I disable all third-part extensions still not work
But before is work
can you help me?

0 Likes

(Dmitry Fedyuk) #4

You can find the problem expressions by running the following command from your Magento 2 root folder:

grep -rnw . -e "__('')" -e '__("")'

The output for your store:

./app/code/Magestore/Affiliateplus/view/frontend/templates/account/program.phtml:84: $commissionText = $block->formatPrice($commission) . ’ ’ . __(’’);
./app/code/Magestore/Affiliateplus/view/frontend/templates/account/program.phtml:91: $secText = $block->formatPrice($secCommission) . ’ ’ . __(’’);
./app/code/Magestore/Affiliateplus/view/frontend/templates/payment/moneybooker.phtml:69: <?php echo __('') ?>
./app/code/Magestore/Affiliateplus/view/frontend/templates/payment/paypal.phtml:65: <?php echo __('') ?>

As you can see, the problem is because of the «Magestore Affiliateplus» extension.
Report the bug to the extension’s developer.

0 Likes

(Saleh El Jabarty) #5

Thanks @dmitry_fedyuk … it did helped me to find which file was causing the problem, but solving it was not possible by just replacing the qouts from ‘’ to “”, after adding a single space " " it worked

0 Likes