Skip to content

i18n generator generates dictionary with duplicated phrases #896

Closed
@wojtekn

Description

@wojtekn

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions