async-book icon indicating copy to clipboard operation
async-book copied to clipboard

i18n question

Open huangjj27 opened this issue 5 years ago • 14 comments

I'm about to write a Chinese Translation of this book(I have a translated version for the old book), and I found that mdbook can use multilanguage feature, So is it a good time to start i18n works now?

huangjj27 avatar Jul 28 '19 09:07 huangjj27

Officially mdbook not support i18n. PR by gambhiro with i18n was rejected.

Also i agree with idea of starting i18n works now.

We (in Russian community) start translation of this book and use GitLocalize for tracking changes (our translatioin on GitLocalize, i can add other languages for test this tool).

funkill avatar Jul 28 '19 14:07 funkill

That would be awesome! I know nothing about i18n + mdbook, but I'd be happy to do anything I can to help make this book more accessible to folks.

cramertj avatar Aug 02 '19 18:08 cramertj

Currently i don't understand development flow of mdbook, but i want add i18n to mdbook for start using i18n in TRPL and other official books. (I suggest using GitLocalize or other tool for TRPL here, after that we started testing of GitLocalize)

funkill avatar Aug 02 '19 19:08 funkill

I tried GitLocalize and consider it ok for translation. As for the publication of localized document, we can use CI to copy only the translated documents and build it as a github page. However, I don't know how to make the translations linked to the original one(translation as a subpage of the original book).

huangjj27 avatar Aug 03 '19 14:08 huangjj27

However, I don't know how to make the translations linked to the original one(translation as a subpage of the original book).

With current version of mdbook (without l10n) - nothing. Mdbook (with l10n) must create crooslinks between translations

funkill avatar Aug 03 '19 19:08 funkill

Simplified Chinese translation is on here, making CI work by replacing the src directory on CI with the translated one.

In order to get update from upstream to my fork, I don't translate the docs on the original files, but copy them to a new directores that can be recognized by GitLocalize. It should be much more easier for both translating and reviewing.

Progess is slow for pure-hand-typed translation

huangjj27 avatar Aug 04 '19 14:08 huangjj27

Traditional Chinese translation is also available. And here is the forked repo. We are really looking forward to any form of i18n supports.

weihanglo avatar Aug 12 '19 14:08 weihanglo

Russian translation completed, deployed here: https://doc.rust-lang.ru/async-book

funkill avatar Aug 30 '19 09:08 funkill

Hi all!

I wrote very simple i18n plugin for mdbook. This plugin has some limitations, e.g. it don't support cross links between translations but in future i want add that.

Also i create example repo with "Async book" and deploy created books with that plugin:

  • en: https://funkill.github.io/async-book-i18n/en
  • ru: https://funkill.github.io/async-book-i18n/ru
  • zh-tw: https://funkill.github.io/async-book-i18n/zh-tw
  • zh-cn: https://funkill.github.io/async-book-i18n/zh-cn

UPD: For this example repo language hardcoded in custom theme, change language button placed in top right near print button.

funkill avatar Sep 06 '19 16:09 funkill

@cramertj Can we include translations to this repository and build all books with i18n render?

funkill avatar Nov 20 '19 11:11 funkill

That sounds fine to me!

cramertj avatar Nov 20 '19 18:11 cramertj

I get an idea, that we may use GitLocalize to put translated content into src_%lang% directories, then we serve translation under https://rust-lang.github.io/async-book/%lang%/. Here are the steps:

  1. Gather translated contents
  2. Modify the CI file, add environment for every %lang%
  3. build with corresponding %lang% contents. then serve to the async-book/%lang%/ site.

huangjj27 avatar Aug 01 '20 10:08 huangjj27

As said in #63, I'd prefer not to include translations directly in this repo.

I'd prefer not to include translations directly in this repo because we can't immediately propagate changes made in English versions to other language versions and have no bandwidth to maintain them.

Instead, I would accept a PR to add a page for links to translations, like rust/book's translations appendix.

taiki-e avatar Aug 01 '20 12:08 taiki-e

Ok. So let me find out how to solve the conflict when merge with master's CI.

huangjj27 avatar Aug 01 '20 13:08 huangjj27