magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Translations with \n are not translatable #38943

Closed DanieliMi closed 3 months ago

DanieliMi commented 4 months ago

Preconditions and environment

Steps to reproduce

  1. Go to storefront
  2. Add a product to the cart
  3. Go to the checkout
  4. Fill in form
  5. Provide an incorrect email address (for example just a string)
  6. Ignore/circumvent JS validation (this testcase assumes frontend validation fails/does not work and we have to rely on the backend validation)
  7. Place order

Expected result

You receive the translated message "Adressvalidierung fehlgeschlagen:..."

Actual result

You receive the original message. "Failed address validation:...".

Additional information

In https://github.com/magento/magento2/blob/1b99b6d59b27613ca70e60f4067743d715c3e02d/app/code/Magento/Quote/Model/SubmitQuoteValidator.php#L69C24-L69C56 "\n" is used but when the csv is read it equals to '\n' so the key cannot be found within \Magento\Framework\Phrase\Renderer\Translate::render.

Release note

No response

Triage and priority

m2-assistant[bot] commented 4 months ago

Hi @DanieliMi. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 4 months ago

Hi @engcom-Delta. 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: :point_down:

engcom-Delta commented 4 months ago

@magento give me 2.4-develop instance

engcom-Delta commented 3 months ago

Hi @DanieliMi ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance, but we are unable to reproduce the issue. Kindly refer the screenshots.

Steps to reproduce.

  1. Store with language de_DE
  2. Go to storefront
  3. Add an item to cart
  4. Navigate to checkout
  5. Disable email field validation by changing the validation.js and elements Email Address field image validation.js image
  6. Enter string value in the email field
  7. Fill Shipping information and click on proceed/further button.
  8. User will be navigated to the payment page.
  9. Fill in payment details and click on place order button
  10. Observe "Invalid Email Format" error displays instead of the error message mentioned in your steps i.e. "Failed address validation:..." invalid email error

Please let us know if any other steps are needed to be performed.

Thanks.

engcom-Delta commented 3 months ago

Hi @DanieliMi ,

We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.