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: Reversed Arabic letters in Invoice Pdfs #27306

Closed
wants to merge 2 commits into from

Conversation

baranada
Copy link

Description (*)

Zend Pdf does not support RTL languages. So I made magento pdf chacters are reversed when the orders are sent to RTL speaking language countries and the characters of a word are consists of more than 80%.

Related Pull Requests

Fixed Issues (if relevant)

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

Manual testing scenarios (*)

  1. make order with arabic names ship to saudi arabia.
  2. make invoice from admin panel.
  3. check the generated pdf.

Questions or comments

  1. I might have broken magento code contribution rules. so if you find one please let me know.
  2. if the target word to be changed has a alphabetic part or numerical part within it, it might not work properly.
  3. it first identify shipping country is in RTL language country list and it identify characters of word are consists of RTL characters.

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 Mar 17, 2020

Hi @baranada. 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
Copy link
Contributor

Hi @baranada,

I just found that this issue was already fixed by magento internal team and then that fix was reverted in 1c0549e.

I just compared your solution and from magento internal team and I think that 2nd one is better, as it checks exact content, but not a country from the billing/shipping address - it will work more accurate.

I also worked on the same issue, so I took fix from internal team that was reverted, updated it to be backward compatible and could be accepted, result you can see in #27887.

As we already have better solution - I'm closing your PR.
Thank you so much for your contribution!

@m2-assistant
Copy link

m2-assistant bot commented Apr 17, 2020

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

3 participants