WIP chapter 2#71
Conversation
lewtun
left a comment
There was a problem hiding this comment.
Thank you for this great PR! I've left a small comment about adding the table of contents and a glossary, but otherwise this is looking good 🚀
I'll ask the Persian community for a quick review :)
| @@ -0,0 +1,32 @@ | |||
| Transformer,ترنسفورمر | |||
There was a problem hiding this comment.
I've been talking about a glossary / vocabulary with the Italian translators in #45 and I think it would be nice to have this as a "chapter" that the Persian readers can access.
To enable that, you'll just need to add a new section to the _toctree.yml file like the following:
- title: Glossary # <= translate this to Farsi
sections:
- local: glossary/1
title: Glossary # Same here
| @@ -0,0 +1,20 @@ | |||
| #مقدمه | |||
There was a problem hiding this comment.
To render this on the website, we should add a _toctree.yml file with the following content:
- title: 1. Transformer models # Translate this
sections:
- local: chapter2/1
title: Introduction # And this
| @@ -0,0 +1,20 @@ | |||
| #مقدمه | |||
There was a problem hiding this comment.
To render this on the website, we should add a _toctree.yml file with the following content:
- title: 1. Transformer models # Translate this
sections:
- local: chapter2/1
title: Introduction # And this
| @@ -0,0 +1,353 @@ | |||
| <FrameworkSwitchCourse {fw} /> | |||
There was a problem hiding this comment.
You should remove all the untranslated files - we only render on the website the chapters / sections that are translated
| @@ -0,0 +1,353 @@ | |||
| <FrameworkSwitchCourse {fw} /> | |||
There was a problem hiding this comment.
You should remove all the untranslated files - we only render on the website the chapters / sections that are translated
MehranMirkhan
left a comment
There was a problem hiding this comment.
I am a native Persian speaker. The translations look good to me.
|
@lewtun can we get this through I have another page incoming and need to add terms to the glossary but don't want to invalidate this review. :) |
|
I have chapter 0 ready for merge in a separate branch on my fork. Will submit in separate PR for review. |
| @@ -0,0 +1,32 @@ | |||
| Transformer,ترنسفورمر | |||
There was a problem hiding this comment.
I've been talking about a glossary / vocabulary with the Italian translators in #45 and I think it would be nice to have this as a "chapter" that the Persian readers can access.
To enable that, you'll just need to add a new section to the _toctree.yml file like the following:
- title: Glossary # <= translate this to Farsi
sections:
- local: glossary/1
title: Glossary # Same here
There was a problem hiding this comment.
I added a section for glossary, it is no longer a CSV file. This I think is resolved. Looks like this in _toctree.yml:
- title: واژهنامه
sections:- local: glossary/1
title: واژهنامه
- local: glossary/1
| @@ -0,0 +1,26 @@ | |||
| <div dir="rtl"> | |||
| <h1>مقدمه</h1> | |||
There was a problem hiding this comment.
I seem to be having some trouble building the docs because the tool we use assumes that we have a Markdown header like
# Chapter title
as the start of the file. Could you please try installing our doc-builder tool via:
pip install git+https://github.com/huggingface/doc-builder.git
Then try building the docs with:
doc-builder build course ../course/chapters/fa --build_dir tmp-docs --clean --not_python_module --html --language fa
You might need to experiment with the format of the header here - are there any guidelines on writing Farsi in Markdown?
There was a problem hiding this comment.
Thanks for this. will do tonight. I am having so much trouble both with the characters and the RTL nature of the language. Finding editors is hard too. We might need to write that guide, haven't come across one myself.
| @@ -0,0 +1,52 @@ | |||
| | معادل در منبع | معادل در ترجمه | | |||
There was a problem hiding this comment.
Similarly, here we'll need a H1 header with something like
# Glossary <= translate this
Hey @jowharshamshiri happy to merge this once we can get the docs to build. I've left some suggestions on trying this yourself, but please let me know if you need some help! |
|
Hey @lewtun, I got the docs to build with a workaround--the first header is now unfortunately rendering in LTR mode. This is ok for now so we can move forward with translating other pages. I also experimented with DISABLE-FRONTMATTER-SECTIONS and even adding an empty code block but alas to no avail. I want to open an issue on doc-builder, whereby we add a 'direction' arg or otherwise automatically figure out the direction of languages. That info is then used to automatically handle the direction of the generated divs and whatnot. If we do that we can dispense with the extra RTL divs and spans everywhere in Persian and also other RTL-language docs. Is that something that sounds worthwhile to you or am I confused? |
|
Thanks a lot for diving into this @jowharshamshiri - I had no idea it would be so tricky 😬 . I think opening an issue on In the meantime, I'll test I can build the current PR! |
| path_to_docs: course/chapters/ | ||
| additional_args: --not_python_module | ||
| languages: en es fr he pt ru th tr | ||
| languages: en es fa fr he pt ru th tr |
There was a problem hiding this comment.
FYI I've added Farsi to the list of languages here so we can build the docs in the CI
|
The documentation is not available anymore as the PR was closed or merged. |
|
Hey @lewtun, while trying to file the issue and reproduce the problem I found a simpler workaround which I included in new commits. Please kindly merge. The first header now renders correctly as RTL. I filed an issue on doc-builder here to automate this. P.S. I think maybe in the CI build you have the lang arg still set to en. It is building the original English docs. |
|
Thank you for finding a nice fix! Will merge this now 🤗
Yeah that's a current limitation with our UI - we need to add a dropdown button to view the PR in language X, hopefully will have that soon! |
WIP chapter 2
Translated the introduction to chapter 2. This is a first draft to just get in sync with other contributors and find our common tone in translation. Also created glossary.csv in the root of 'fa' folder to standardize translations of some commonly mistranslated words--this too is a first draft open to suggestions from other contributors.
Related to #49