move icon indicating copy to clipboard operation
move copied to clipboard

Add move-book i18n ability.

Open SuccinctPaul opened this issue 3 years ago • 8 comments

Motivation

Gather multi-lang move-book in a gh-page.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

you guys can view it on my gh-page. https://chengyuejia.github.io/move/en/conditionals.html The lang-switcher is near the printer.

image

link to #512

SuccinctPaul avatar Oct 08 '22 09:10 SuccinctPaul

I will accept this, but I think the final call is up to @geometryolife--let me know if this is good to go from your perspective and I will land!

Ok, I will review this pr tomorrow.

geometryolife avatar Dec 07 '22 14:12 geometryolife

image

How should the local preview be? I did mdbook build then mdbook serve --open and it doesn't seem to work. I have installed mdbook-i18n.

@ChengYueJia @funkill

geometryolife avatar Dec 08 '22 09:12 geometryolife

@geometryolife Hi! Each mdbook render saves artifacts to separate directory: builtin render to html dir, for other render - in directory with render's name https://github.com/rust-lang/mdBook/blob/master/src/book/mod.rs#L216. While serving, mdbook looks only for html directory https://github.com/rust-lang/mdBook/blob/master/src/cmd/serve.rs#L88 and we can't use serve command for other renders.

funkill avatar Dec 08 '22 11:12 funkill

How should the local preview be? I did mdbook build then mdbook serve --open and it doesn't seem to work. I have installed mdbook-i18n.

@geometryolife Hi, you have to add the lang-path to the url. http://127.0.0.1:3000/i18n/lang eg: http://127.0.0.1:3000/i18n/zh, http://127.0.0.1:3000/i18n/en

For the online one, not need for the /i18n, just specify the lang. like this. https://chengyuejia.github.io/move/en/abilities.html

SuccinctPaul avatar Dec 08 '22 14:12 SuccinctPaul

How should the local preview be? I did mdbook build then mdbook serve --open and it doesn't seem to work. I have installed mdbook-i18n.

@geometryolife Hi, you have to add the lang-path to the url. http://127.0.0.1:3000/i18n/lang eg: http://127.0.0.1:3000/i18n/zh, http://127.0.0.1:3000/i18n/en

For the online one, not need for the /i18n, just specify the lang. like this. https://chengyuejia.github.io/move/en/abilities.html

image

I tried it, but it seems that no rendering resources will be loaded locally, which seems to be bad for local development and inspection.

geometryolife avatar Dec 08 '22 15:12 geometryolife

I tried it, but it seems that no rendering resources will be loaded locally, which seems to be bad for local development and inspection.

@geometryolife The problem seem like we have to specifiy the chapter on url. eg http://localhost:3000/i18n/en/introduction.html This won't happen online for I've specify it on the workflow. Hope this can help you. image

SuccinctPaul avatar Dec 09 '22 02:12 SuccinctPaul

The problem seem like we have to specifiy the chapter on url. eg http://localhost:3000/i18n/en/introduction.html This won't happen online for I've specify it on the workflow. Hope this can help you.

I'm using the latest commit from your repository and it's running normally now. Looks Good To Me. @sblackshear

@tnowacki Could you help take a look and give some suggestion?

geometryolife avatar Dec 09 '22 05:12 geometryolife

I thought about it carefully. If this PR is merged, move-book-zh will not support serve, and the updated content cannot be rendered in time, which will increase the difficulty of maintenance. The translation of move-book-zh is still in progress, I think this PR will be merged later. @ChengYueJia @sblackshear

geometryolife avatar Dec 10 '22 07:12 geometryolife