Add support for localization
cauebs opened this issue · 3 comments
cauebs commented
It would be great if we could provide multiple versions of a book and switch between them using a menu similar to the one we have for themes.
mattico commented
This should be fairly straightforward:
- Add a config option to set the default language.
- Determine & document the folder structure used for the translations.
- Change index generation to ignore translations.
- Set the
lang
template parameter inhbs_renderer
based on the page path + default config. - Add a menu to the html template + stylus.
- In
hbs_renderer
, look for different versions of the current page and add them to the template parameter. - Set the language used to generate the search index.
- Add a cargo feature to disable this functionality, since rustc can't have the search language support due to licensing issues.
Edit:
Links might also need to be adjusted so they point at the page for the current language. This might not be necessary if the correct relative links are used, I'd have to check.
Endermanbugzjfc commented
This should be fairly straightforward:
- Add a config option to set the default language.
- Determine & document the folder structure used for the translations.
- Change index generation to ignore translations.
- Set the
lang
template parameter inhbs_renderer
based on the page path + default config.- Add a menu to the html template + stylus.
- In
hbs_renderer
, look for different versions of the current page and add them to the template parameter.- Set the language used to generate the search index.
- Add a cargo feature to disable this functionality, since rustc can't have the search language support due to licensing issues.
Edit:
Links might also need to be adjusted so they point at the page for the current language. This might not be necessary if the correct relative links are used, I'd have to check.
Could anyone give me some instances, please?