magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

i18n generator generates dictionary with duplicated phrases

Open wojtekn opened this issue 11 years ago • 3 comments

i18n generator generates dictionary with duplicated phrases if escaped and non escaped forms are present in codebase eg.:

<?php echo __('What\'s this?') ?>
<?php echo __("What's this?"); ?>

It results in having two "What's this?" entries in generated dictionary file.

Steps to reproduce are:

  1. Generate dictionary file on the whole codebase

    php -f dev/tools/Magento/Tools/I18n/generator.php -- -d ./ -o dictionary.csv -m yes

  2. Try to run pack.php to find duplicated phrases:

    php -f dev/tools/Magento/Tools/I18n/pack.php -- -s dictionary.csv -l pl_PL -p app/i18n/

It outputs following on beta2 and installing translation fails:

Duplicated translation is found, but it is not allowed.
The phrase "Qty for Item's Status to Become Out of Stock" is translated differently in 2 places.
The phrase "What's this?" is translated differently in 2 places.
The phrase "We couldn't find records for this period." is translated differently in 2 places.
The phrase "We don't recognize or support this file extension type." is translated differently in 2 places.
The phrase "We can't complete your order because you don't have a payment method available." is translated differently in 2 places.

It's possible to install such dictionary by providing -d option to allow duplicates, however it makes sense to fix that either by unifying phrases or fixing tool.

wojtekn avatar Jan 04 '15 16:01 wojtekn

It looks similar issue was reported months ago (https://github.com/magento/magento2/issues/235), it was closed, but it looks it's not fixed.

wojtekn avatar Jan 04 '15 16:01 wojtekn

Internal ticket: MAGETWO-33028

monkeysee avatar Jan 23 '15 19:01 monkeysee

@wojtekn , thank you for reporting the issue. Internal ticket: MAGETWO-33028 has been closed and merged to develop branch. Please, let us know if you still have an issue

okorshenko avatar Oct 12 '15 12:10 okorshenko