Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n generator generates dictionary with duplicated phrases #896

Closed
wojtekn opened this issue Jan 4, 2015 · 3 comments
Closed

i18n generator generates dictionary with duplicated phrases #896

wojtekn opened this issue Jan 4, 2015 · 3 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@wojtekn
Copy link
Contributor

wojtekn commented Jan 4, 2015

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
Copy link
Contributor Author

wojtekn commented Jan 4, 2015

It looks similar issue was reported months ago (#235), it was closed, but it looks it's not fixed.

@monkeysee
Copy link
Contributor

Internal ticket: MAGETWO-33028

@muasir muasir added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 23, 2015
@okorshenko
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

5 participants