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

advanced bundling js translation not (always) working #23821

Closed
davidverholen opened this issue Jul 22, 2019 · 8 comments
Closed

advanced bundling js translation not (always) working #23821

davidverholen opened this issue Jul 22, 2019 · 8 comments
Labels
Component: Translation Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@davidverholen
Copy link
Member

When using advanced bundling, some core strings are not translatable.

Preconditions (*)

  1. Use any supported Magento Version (e.g. latest)
  2. Configure and use advanced bundling (eventually also reproducable with current default bundling implementation)
  3. use a language pack or translate "Cancel" to anything else in your locale

Steps to reproduce (*)

  1. add product to cart
  2. hit the delete button in minicart

Expected result (*)

  1. The Cancel Button is translated

Actual result (*)

  1. The Cancel Button is not translated
    (same probably for OK, but OK does not have to be translated for many locales)

This error can potentially appear in many more cases, where strings are translated in js before the translations are fully initialized.

I'm not a frontend dev but it seems that the translations are initialized in the body here while some js components already try to use the translate function during initialization.
When bundled, this happens before the actual translations are loaded

See translation initialization:
https://github.com/magento/magento2/blob/2e7f0396e370074b4998a6b56636fb1ddb6da74b/app/code/Magento/Translation/view/base/templates/translate.phtml

and confirm modal initialization:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Ui/view/base/web/js/modal/confirm.js

@m2-assistant
Copy link

m2-assistant bot commented Jul 22, 2019

Hi @davidverholen. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@davidverholen do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@davidverholen davidverholen self-assigned this Jul 22, 2019
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 22, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jul 22, 2019

Hi @davidverholen. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@davidverholen davidverholen added Component: Translation Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 22, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @davidverholen
Thank you for verifying the issue. Based on the provided information internal tickets MC-18420, MC-18421 were created

Issue Available: @davidverholen, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 22, 2019
@davidverholen
Copy link
Member Author

@DrewML fyi. I do not really have an idea what happens in the translate.phtml and why it is implemented like that (instead of adding the translations during init of the translate component) so I do not really have an Idea how to fix this.

@DrewML
Copy link

DrewML commented Jul 25, 2019

No problem @davidverholen - appreciate the thorough bug report. Getting it assigned out to someone internally

@adifucan
Copy link
Contributor

Internal ticket MC-19247 created and it is currently in progress

@adifucan
Copy link
Contributor

adifucan commented Oct 3, 2019

Hi @davidverholen fix is merged into mainline with this commit:
71c781d

@sdzhepa
Copy link
Contributor

sdzhepa commented Oct 8, 2019

The issue has been fixed and delivered into 2.3develop.
Closed.

@sdzhepa sdzhepa closed this as completed Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Translation Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants