comprehensive-rust icon indicating copy to clipboard operation
comprehensive-rust copied to clipboard

How to create the translations drop down?

Open harryhanYuhao opened this issue 1 year ago • 1 comments

I am also writing a book with mdbook. I wonder how to you guys implement the globe sign on the upper right and the drop down menu for choosing languages?

I know the book uses mdbook-118n for internationalization, but I could not find anything relevant on the dropdown menu.

Thanks in advance.

harryhanYuhao avatar Aug 01 '24 04:08 harryhanYuhao

It's in theme/index.hbs: https://github.com/google/comprehensive-rust/blob/655b553abd132f06b9e110d4a5f998a107a917b5/theme/index.hbs#L171-L203

djmitche avatar Aug 01 '24 12:08 djmitche

Hi @harryhanYuhao, this is a definitely a pain point! We have https://github.com/google/mdbook-i18n-helpers/issues/12 for figuring out how to package a language selector somehow. If you have any ideas, then I suggest adding them there :smile:

mgeisler avatar Sep 07 '24 11:09 mgeisler