funkill / mdbook-i18n

MIT License
21 stars 6 forks source link

Hope for adding the lang-switch tool. #22

Closed SuccinctPaul closed 1 year ago

SuccinctPaul commented 1 year ago

For now, we can't switch the lang.

Thanks for dev the tool, maybe we can enhance it.

funkill commented 1 year ago

Hi!

Maybe for now theme from example helps you? Example deployed here, switch button near print button.

Currently automatic generation of lang switcher not implemented :(

SuccinctPaul commented 1 year ago

Thx for that. It does help me a lot. I've tried it on a mdbook-docs.

The style seems a little bit wrong. The title of chapter is shadowed. Not like what in your demo

image

image

You can try it on my ph-page.https://chengyuejia.github.io/move/en/conditionals.html. And the source code is here

funkill commented 1 year ago

I send PR to your fork with updated theme. Previous version of mdbook-i18n used old theme from mdbook. I synced theme with new version.

On holidays i thinked about automatic generating script parts with langs and injecting to mdbook template (without overriding template as currently implemented) but mdbook can't inject custom fields to template and overriding template with manually added langs required :(

SuccinctPaul commented 1 year ago

Wow, Thanks a lot to help me. I'll merge it.

So sad to know mdbook can't support the auto-generated lang-switcher script.

There will be other way to make it. As a script can auto modify or generate the theme files account to the .toml files. ? LoL

The mdbook-i18n is greet. You already did a great job , It's helps me a lot , and will help more projects.