Closed
Description
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:
-
Generate dictionary file on the whole codebase
php -f dev/tools/Magento/Tools/I18n/generator.php -- -d ./ -o dictionary.csv -m yes
-
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.
Activity