Skip to content

Fix #25243 #25359

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

Merged
merged 11 commits into from
Feb 28, 2020
Merged

Conversation

korostii
Copy link
Contributor

@korostii korostii commented Oct 29, 2019

Description (*)

JS version of __('Carrier with such method not found: %1, %2', 'one', 'two') should produce the message of 'Carrier with such method not found: one, two'

JS component receives a pre-translated message template yet parameters are sent separately:
JSON sent via ajax response
And then the messages.js assumes that resulting messageObj property names should match the varNames in the message template string (discounting the first % symbol) which happens to be off by one if the varNames are integers.

Worth mentioning: in most cases they are numbers, however support for string varNames seems to be implied and even relied on, for example there a translated string like the following: You can check the status of your order by <a href=""%account_url"">logging into your account</a>..

Solution: simply decrement varName (as long as it's a number).

Fixed Issues

  1. Numerical placeholder count in Phrase starts with %1, however js code assumes 0% #25243: Numerical placeholder count in Phrase starts with %1, however JS code assumes %0

Manual testing scenarios

Please see #25243 for detailed steps.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Oct 29, 2019

Hi @korostii. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

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

@ghost ghost assigned krzksz Dec 9, 2019
@engcom-Alfa engcom-Alfa self-assigned this Dec 13, 2019
@engcom-Alfa engcom-Alfa added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Dec 13, 2019
@engcom-Alfa
Copy link
Contributor

Hi @korostii.
Due to Magento Definition of Done all code must be covered by tests. Please cover your fix by jasmine test.
Thanks!

@korostii
Copy link
Contributor Author

Hi @engcom-Alfa so we've looked into these jasmine tests as used by Magento with a colleague of mine, as guided by the devdocs article and we can't seem to figure out if it supports frontend theme tests, at all (and this PR deals with JS used on frontend).
So for example grunt spec:backend does run some tests (some of them failing on a clean Magento), whereas grunt spec:frontend doesn't seem to invoke Jasmine, at all:
Screenshot from 2019-12-19 18-58-13
Screenshot from 2019-12-19 19-05-04

Any hints/directions?

@krzksz
Copy link
Contributor

krzksz commented Dec 20, 2019

@korostii You can try grunt spec:blank and grunt spec:luma.

@engcom-Golf
Copy link
Contributor

HI @krzksz could you please review new changes ?

@krzksz krzksz self-requested a review February 25, 2020 06:21
krzksz
krzksz previously requested changes Feb 25, 2020
Copy link
Contributor

@krzksz krzksz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the update! Unfortunately there is still this thing I mentioned in #25359 (review) which should be taken into account in my opinion.

@ghost ghost dismissed krzksz’s stale review February 25, 2020 06:22

Pull Request state was updated. Re-review required.

@engcom-Golf
Copy link
Contributor

@krzksz could you please take a look ?

@magento-engcom-team
Copy link
Contributor

Hi @krzksz, thank you for the review.
ENGCOM-6996 has been created to process this Pull Request
✳️ @krzksz, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Before:
before

After:
after

@m2-assistant
Copy link

m2-assistant bot commented Feb 28, 2020

Hi @korostii, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

10 participants