-
Notifications
You must be signed in to change notification settings - Fork 1
Rebase PR 1943 of git/git-scm.com #1
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
base: master
Are you sure you want to change the base?
Conversation
…from en to fa language
Of course, dear @dscho. This was a very professional and interesting move, and I truly appreciate it. My initial review of your translation was quite good. However, the Persian translation had some structural issues that needed correction. I'll edit them to ensure a flawless and accurate translation. The Iranian open-source community will be grateful to you. |
As long as I did not cause more work for you, I'm happy! |
Change the translation to a more fluent and well-structured one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot claim to understand Farsi, and I lack permissions to approve the PR, but I'd say: ship it!
Dear friends, the revisions and translation of this pull request have been completed. @jnavila Please check it and let me know if there are no structural issues and the code is working fine, so we can merge the pull request. Or you can merge it yourself. @dscho, you can correct the untranslated sections or those with translation issues in the same way we proceeded. Let's resolve the issues and apply the changes. I am available, and you can tag me for translations of any pull requests. |
Dear @dscho , As we know, Persian—like Arabic—is a right-to-left (RTL) language, but currently on the GitHub site, the layout is left-to-right (LTR). This problem can be solved quite easily, and we can also handle the RTL formatting in our future translations. Just needs to change #content direction from this to dir="rtl" or we can handle it in out files |
Since I offered to help with rebasing git/git-scm.com#1943, I figured I should give it a quick try, to see how hard it would be.
Narrator's voice: It was hard. Very.
When I saw just how involved it would be, I didn't want to just look from the peanut gallery but offer my assistance. And while I have literally no knowledge whatsoever of Farsi, I know other languages, such as Javascript. So I wrote a node.js script to help rebase the patches.
This is the script I used.
True to form, as a one-time hack, it lacks pretty much all of the documentation.
As one might guess, I started out with something straight-forward: parse the diffs, ignoring the HTML tags, trying to let the script figure out automatically what text snippets should be replaced with what other text snippets.
However, some of the HTML -- even between HTML tags -- needed to be "back-converted" to AsciiDoc. So I added that.
From there, I worked my way through the exceptions to that rule, and there were tons.
The high-level overview of the script is that the loop at the end of the script tries to fetch the commits as patches, then calls
rebasePatch()
, which parses first the header (to learn the metadata that will later be used to create the commit), then parses the diff to obtain minimal pre-/post-images, then transforms those to look a lot more like AsciiDoc than HTML, then splits by HTML tags, then iterates over the parts between the HTML tags (verifying that the HTML tags are identical between English and Farsi). For the parts between the HTML tags that differ between English and Farsi, the script usesgit grep -F
to figure out which file needs to be edited, then finds the respective location where the English text (= "pre-image") is located, and replaces it with the Farsi text. In this part, there are quite a few hacks related to my reluctance to replace<
/>
wholesale, and there are quite a few hacks due to the{{< relurl ... >}}
links no longer necessarily having all the information to recreate the AsciiDoc<<...>>
references.The last commit of git/git-scm.com#1943, git/git-scm.com@dfd9553, is not even applicable because the AsciiDoc references do not have the link text, and neither do they have full links.
Now, @YasinDehfuli I hope that this here PR is useful in some shape or form and does not cause more work than it took to craft.