comprehensive-rust
comprehensive-rust copied to clipboard
Persian translation
Hi @mbpouri, here is an issue for you!
I don't see any translation on https://doc.rust-lang.org/book/appendix-06-translation.html, but perhaps there is a Persian Rust community somewhere where you can find translations of common words :smile:
The translation is live at https://google.github.io/comprehensive-rust/fa/.
Let me know if/when you run into https://github.com/rust-lang/mdBook/issues/1486 — then we'll have to work on adding good support for right-to-left languages in mdbook.
sure, on it. thanks pal @mgeisler
@DannyRavi, I tried out the translation in #1042 and the text looks like this out of the box:
Adding dir="rtl" to the html tag makes it look like this:
Does this look more correct to you? I cannot read it, so it's hard for me to judge how it looks :slightly_smiling_face:
Ideally, we should fix this in the upstream mdbook project (https://github.com/rust-lang/mdBook/issues/1486), but we can perhaps prototype a fix for them here and then contribute it upstream. I'm thinking we can simply use different index.hbs template depending on the writing direction.
Before starting the translation of the texts. I noticed that the book has a problem with right-to-left texts according to links #1486 and #671 After translating some texts and testing the program on a local server, I realized that the right-to-left texts are not correct and the texts are difficult to understand for Persian speakers. Finally, I had no idea for right-to-left texts.
Hi @DannyRavi, could you test locally with mdbook serve after modifying theme/index.hbs like this:
modified theme/index.hbs
@@ -1,5 +1,5 @@
<!DOCTYPE HTML>
-<html lang="{{ language }}" class="sidebar-visible no-js {{ default_theme }}">
+<html lang="{{ language }}" dir="rtl" class="sidebar-visible no-js {{ default_theme }}">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
This simply adds the dir="rtl" attribute to the html tag. Is this enough to make the page readable? If so, we could use this as a starting point and fix other issues down the road.
Hey @DannyRavi, @mbpouri, and @javad-jafari — would you be able to review each other's PRs? We have #1209 (by @DannyRavi) and #1341 (by @javad-jafari) open right now.
Hey there, i just saw this issue and the work you guys all are doing, that mean a lot to Persian community, Thank you all.
Can we use custom font for Persian translation? it's not pretty good. I'm available to change and fix it if you are okay with it.
I'm suggesting to use Vazir fonts family for Persian texts.
@DannyRavi @mbpouri Thank you and @javad-jafari for your great work on translation.
I just checked some of translations and it seems there is a good amount of ZWNG missing in translations, let's fix them before merge to ensure a good quality text.
And I suggest we use راست for word Rust because reading it is easier and it's pretty common in Persian community right now.
Hey there, i just saw this issue and the work you guys all are doing, that mean a lot to Persian community, Thank you all.
Hi @hamidrezakp, thanks for joining in!
Can we use custom font for Persian translation? it's not pretty good. I'm available to change and fix it if you are okay with it. I'm suggesting to use
Vazirfonts family for Persian texts.
Awesome! If you can write a PR which tweaks the CSS, then I would be happy to add it!
We should ultimately add this upstream in https://github.com/rust-lang/mdBook/ since we're relying on the right-to-left support recently added there (https://github.com/rust-lang/mdBook/pull/1641).
If the fix/improvement is clear, then I suggest adding it upstream directly. Otherwise we can also modify our CSS and theme as needed. Just let me know.
If we can find 2-3 people who are interested in reviewing, then add yourself to the CODEOWNERS file.
That way you'll be auto-added to future PRs and will thus be able to do everything yourself — @henrif75 and myself should not really be involved in the Persian translation :smile:
If the fix/improvement is clear, then I suggest adding it upstream directly. Otherwise we can also modify our CSS and theme as needed. Just let me know.
So let me open an issue there and ask them if we can use custom fonts for Persian language; if not, we add it here.
That way you'll be auto-added to future PRs and will thus be able to do everything yourself — @henrif75 and myself should not really be involved in the Persian translation 😄
Yeah you are right 😄 it's just impossible for you to review or check translations, I think i can find some friends in Persian Rust community that are willing to be maintainer here.
Hey folks, so existed about this.
I can help with reviewing the translations and other stuff related to fa translations.
@mehrad77 I have added your name to reviewers for Persian(#1375 ), Which one of this PRs do you want to review?
- #1209
- #1341
You can assign them to yourself and we will pick others.
@hamidrezakp I see there is a problem with the #1209 and I see no change in that PR. With that said I'll assign myself to review #1341
I've just made a look. I see lots of not related changes (mostly code style and text formatting, new lines, etc...). When opening new PRs I think its very important to keep that in mind to not change parts of the document that are not related to the Farsi translation and limit the scope of changes. It'll make the reviewing a lot easier. At this moment I have no idea what to do with this much unrelated change in #1341
Besides that I see that a lot of chapters are not translated.I want to know is there a bigger plan to split chapters and assign the task of translation of each chapter to one person? I rather get involved in the translation itself and start making a bigger picture of who is translating which parts. I'll start translating the "Day 2" morning. (from chapter 12 to 17) and open a new PR.
Yeah i agree but maybe you can just check last commit (although it contains a lot of non-related things to translation and that's because of poor formatting i guess).
Anyways, That's a good idea to split the translation task into smaller chunks and more organized so contributors can easily pick 'em up and translate.
If you can open a draft PR that mentions what you are working on would be great.
Hi @hamidrezakp .
Unfortunately, the word راست in Farsi, which means Rust programming language, is the same as the word راست ,which means Right , and this would increase the error of reading and misunderstand the translated text, and suggestions like رااست have been discussed before and have not reached a conclusion.
@DannyRavi my suggestion is using رآست with the U+0622 instead of U+0627. (As afshin introduced on Mastadon). But I'm seeing that رااست has more adaption. I'm in favor of both of these.
@DannyRavi @mehrad77 I think we should do some polls in communities and social media to see what are everyone okay with.
Yeah i agree but maybe you can just check last commit (although it contains a lot of non-related things to translation and that's because of poor formatting i guess).
If the poor formatting is about lines being re-wrapped in strange ways, then we have a solution for that: we recently (#1359) introduced a GitHub check which requires PO files to be formatted consistently. This boils down to following the preparation section of TRANSLATIONS.md and then running
dprint fmt
Btw, I've found that using gh and bat works very well for reviewing the large diffs:
gh pr diff 1341 | bat -l patch
is very quick and shows me that changes of #1341 in a nice way.
@DannyRavi @mehrad77 I think we should do some polls in communities and social media to see what are everyone okay with.
Great idea! Feel free to use the discussions here or any other convenient place!
First of all, special thanks to @mgeisler for adding dir="rtl|ltr" to the html template
https://github.com/google/comprehensive-rust/issues/671#issuecomment-1661888029
When you add dir="rtl" to html, the page direction will be right to left, but what about the English text (or any other LTR text) between the contents (or vice versa)?
For example,
In #1413 , I proposed a simple way to handle it with theme but not the most suitable way for doing it.
It's better to mention it here as well.
Thanks @moaminsharifi for looking at this. As I wrote in #1413, I think we should first understand if the right-to-left support works okayish for fully-translated pages. If it does, then the problem you point out is a temporary problem — if it doesn't, then I would need help from people here to find a good solution.
Thanks @moaminsharifi for looking at this. As I wrote in #1413, I think we should first understand if the right-to-left support works okayish for fully-translated pages. If it does, then the problem you point out is a temporary problem — if it doesn't, then I would need help from people here to find a good solution.
@mgeisler, For the time being, I think we should close that github issue #1413 until the pages are completely translated, then check it out again.
@mgeisler
Some of markdown renders to svg with ```bob , but I can not find in the translate file.
There is 10 Item like that:
but mostly 4 in each translation file like (
fa.po):
Is that something we must add it manually?
Hi @moaminsharifi, the svgbob images disappeared from the translation pipeline with https://github.com/google/mdbook-i18n-helpers/pull/75 by @dyoo: we now only translate a code block if it contains " or // since that is a very simple heuristic to recognize code with string literals or comments.
We should restore this and https://github.com/google/mdbook-i18n-helpers/issues/76 is in some sense about this problem: with that feature implemented, we should be able to say "always translate svgbob code blocks".
Note that our text extraction tooling will become more fine-grained with https://github.com/google/mdbook-i18n-helpers/pull/109, which will be merged later today or tomorrow after a small rebase.