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

Fix Arabic and Hebrew in invoices #27887

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Apr 17, 2020

Description (*)

I found fix that was reverted in 1c0549e due to backward compatibility issues (from @lenaorobei). I just re-applied these changes again, extracted whole logic with working with RTL texts to the separate model, covered it with unit tests and used it during invoice generation, so now it should be fully backward compatible.

Also I found that that solution didn't worked fine with Hebrew, so I also fixed it.

Note: for preparing test data I used some sample data generation service.

Related Pull Requests

Fixed Issues (if relevant)

  1. Arabic invoice pdf issue Magento 2.3.0 showing as Arabic letters but not correct  #25769

Manual testing scenarios (*)

  1. See Arabic invoice pdf issue Magento 2.3.0 showing as Arabic letters but not correct  #25769

Questions or comments

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)

Revert MC-13880 and bring back MAGETWO-95816

This reverts commit 1c0549e
Add model for processing RTL texts
@m2-assistant
Copy link

m2-assistant bot commented Apr 17, 2020

Hi @ihor-sviziev. 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.4-develop instance - deploy vanilla Magento instance

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

@ihor-sviziev ihor-sviziev changed the title Fix arabic and hebrew in invoices Fix Arabic and Hebrew in invoices Apr 17, 2020
@ihor-sviziev ihor-sviziev marked this pull request as ready for review April 17, 2020 17:32
@ihor-sviziev ihor-sviziev force-pushed the fix-arabic-hebrew-in-invoices branch from 5ada5c6 to 6d6cc47 Compare April 21, 2020 12:42
Use rtl text handler in invoice PDF generation
@ihor-sviziev ihor-sviziev force-pushed the fix-arabic-hebrew-in-invoices branch from 6d6cc47 to 27ec0ae Compare April 21, 2020 12:44
Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Looks fine, nice catch ✔️

@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-7465 has been created to process this Pull Request
✳️ @lbajsarowicz, 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-Delta
Copy link
Contributor

✔️ QA passed
Was used phrase الإسم ابو بدر المطيري for all input fields
Before:
image
image

الإسم ابو بدر المطيري from admin side invoice not equal with يريطملا ردب وبا مسإلا from invoice pdf

After:
image
image

الإسم ابو بدر المطيري form admin side invoice is equal with الإسم ابو بدر المطيري from invoice pdf

@ghost ghost added the Progress: accept label Apr 24, 2020
@slavvka slavvka added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix labels Apr 24, 2020
@slavvka slavvka added this to the 2.4.0 milestone Apr 24, 2020
@slavvka slavvka added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Apr 24, 2020
@magento-engcom-team magento-engcom-team merged commit d35ce43 into magento:2.4-develop Apr 25, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 25, 2020

Hi @ihor-sviziev, 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.

@zezooo2
Copy link

zezooo2 commented Jan 12, 2021

@ihor-sviziev thank you i used your fix and it already make the text be from right to left but the words are separated ?!
like أ ح م د
it must be أحمد
any help on that ? (magento 2.3.2)
thanx alot

@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Jan 12, 2021

O> @ihor-sviziev thank you i used your fix and it already make the text be from right to left but the words are separated ?!

like أ ح م د

it must be أحمد

any help on that ? (magento 2.3.2)

thanx alot

As I said above - with the current library, we can't fix it. We need to use another library for that. So far, it's quite a significant effort to implement it.

You could try to install some custom extension like https://store.fooman.co.nz/magento-extension-pdf-customiser-m2.html
Maybe it will fix the issue for you.

@zezooo2
Copy link

zezooo2 commented Jan 12, 2021

@ihor-sviziev thanks alot i will try 👍

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Sales Priority: P3 May be fixed according to the position in the backlog. Progress: accept Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arabic invoice pdf issue Magento 2.3.0 showing as Arabic letters but not correct
8 participants