Skip to content

Restructure for translations#6

Merged
lewtun merged 5 commits into
masterfrom
restructure-for-translations
Feb 7, 2022
Merged

Restructure for translations#6
lewtun merged 5 commits into
masterfrom
restructure-for-translations

Conversation

@lewtun

@lewtun lewtun commented Feb 4, 2022

Copy link
Copy Markdown
Member

This PR restructures the chapter content to enable the frontend to toggle between different languages. After discussing internally with @Pierrci we've settled on the following tree:

chapters
├── en
│   ├── _chapters.yml
│   ├── chapter0
│   ├── chapter1
│   ├── chapter2
│   ├── chapter3
│   ├── chapter4
│   ├── chapter5
│   ├── chapter6
│   ├── chapter7
│   ├── chapter8
│   └── event
└── es  <-- Spanish example to test with
    ├── _chapters.yml
    └── chapter0

Here, the idea for translators is to (minimally) copy-paste the table of contents file _chapters.yml and one or more chapters to translate. I've translated the first chapter to Spanish so we can test it on the frontend when this PR is merged.

Questions

  • By changing the repository structure, do I also need to update moon-landing to resolve the specific language directories like en and es?
  • Can / should we support partial translations, i.e. at the single chapter level? I could imagine each section (like this one) having a button at the top of the page that lets the reader switch between languages in a manner similar to switching between PyTorch & TensorFlow:

Screen Shot 2022-02-04 at 16 06 30

  • Should _chapters.yml be filled out to match the English source? For the Spanish example, I've only included the entry for the single translated chapter, but I'm wondering if this will cause havoc with the table of contents on the left-hand side of the website?

Screen Shot 2022-02-04 at 16 28 14

cc @mishig25 @julien-c @sgugger (since this might be relevant for the community-driven translations of our library docs)

@lewtun
lewtun requested a review from Pierrci February 4, 2022 11:04
Comment thread chapters/es/chapter0/section1.mdx Outdated
@sgugger

sgugger commented Feb 4, 2022

Copy link
Copy Markdown
Contributor

LGTM as long as it's good for the moon-landing side (especially on how to handle missing pages in a given language).
Excited to see community translations coming in!

@Pierrci

Pierrci commented Feb 4, 2022

Copy link
Copy Markdown
Member

See the PR I opened in moon-landing: https://github.com/huggingface/moon-landing/pull/2028. The course structure in this PR will work out-of-the-box w/ it.

Can / should we support partial translations, i.e. at the single chapter level? I could imagine each section (like this one) having a button at the top of the page that lets the reader switch between languages in a manner similar to switching between PyTorch & TensorFlow

Should _chapters.yml be filled out to match the English source? For the Spanish example, I've only included the entry for the single translated chapter, but I'm wondering if this will cause havoc with the table of contents on the left-hand side of the website?

The moon-landing PR only takes care of handling the new structure, the language in the URL, and returning the matching content. Pinging @gary149 on those points since it's a UX/UI decision (a decision that is not blocking for merging this PR since nothing will change visually on hf.co for now)

@mishig25 mishig25 mentioned this pull request Feb 7, 2022
@lewtun

lewtun commented Feb 7, 2022

Copy link
Copy Markdown
Member Author

The moon-landing PR only takes care of handling the new structure, the language in the URL, and returning the matching content. Pinging @gary149 on those points since it's a UX/UI decision (a decision that is not blocking for merging this PR since nothing will change visually on hf.co for now)

Thanks a lot for adding support for the translations on the moon-landing side! Shall we merge this PR now and iterate on the UX/UI issue once we have some URLs we can play with?

@Pierrci

Pierrci commented Feb 7, 2022

Copy link
Copy Markdown
Member

Your plan LGTM @lewtun! 👍

Will merge https://github.com/huggingface/moon-landing/pull/2028 once this one is merged.

@lewtun
lewtun merged commit 7b5da39 into master Feb 7, 2022
@lewtun
lewtun deleted the restructure-for-translations branch February 7, 2022 17:04
CaterinaBi added a commit to CaterinaBi/hugging-face-course-translation that referenced this pull request Oct 16, 2022
GITbaburin pushed a commit to GITbaburin/course that referenced this pull request May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants