Hexo-theme-next: Multilingual support

Created on 7 Aug 2019  ·  12Comments  ·  Source: theme-next/hexo-theme-next

Add a multilingual button for switching the website into different language version(contents of different language must be separated).

Backlog Feature Request 🎯 Roadmap

Most helpful comment

Issue-Label Bot is automatically applying the label Feature Request to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 12 comments

Issue-Label Bot is automatically applying the label Feature Request to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Added to v8.x roadmap

Multi-language support, need to consider how to implement 🤔
Some users use multiple hexo sites, and add those to the menu, like @Liam0205
https://liam.page/
Some add button to switch in post-meta, like me
https://www.dnocm.com/en/articles/beechnut/hexo-next-injects/

@S-W-K Which, or there are other ideas you prefer it?

@jiangtj
I prefer the former. But there's a problem that your Chinese posts and English posts are not totally separated. Both of those two kinds of posts will be archived and tagged together. This is my ideal design https://dengcb.com/zh/index.html

dengcb
dengcb's open source code

Does this plugin help: https://github.com/Jamling/hexo-generator-i18n

GitHub
Multi-languages generator for hexo. Contribute to Jamling/hexo-generator-i18n development by creating an account on GitHub.

@stevenjoezhang This plugin does not support the separation of contents of different languages. Also, it does not provide a language switcher button by default.

There is no extra space in the header, and in the Gemini / Pisces scheme, the sidebar is hidden on mobile. Therefore, the footer may be the only place to put this multilingual button.

截屏2020-02-28下午11 04 30

However, multilingual processing still has difficulties: Hexo does not provide enough easy-to-use APIs. Multi-language on hexo.io relies on a custom helper instead of Hexo's built-in methods:
https://github.com/hexojs/site/blob/f205475980049069f768aca0ed13a2a3633f9189/scripts/helpers.js#L149-L152

See also https://github.com/hexojs/hexo/issues/1696

GitHub
The website for Hexo. Contribute to hexojs/site development by creating an account on GitHub.

Are you currently configuring multiple languages based on this document?
https://hexo.io/zh-cn/docs/internationalization

@S-W-K @Gabirel @njzjz

Checkout this PR: #1391

Hexo
若要让您的网站以不同语言呈现,您可使用国际化(internationalization)功能。请先在 _config.yml 中调整 language 设定,这代表的是预设语言,您也可设定多个语言来调整预设语言的顺位。 language: zh-twlanguage: - zh-tw- en 语言文件语言文件可以使用 YAML 或 JSON 编写,并放在主题文件夹中的 languages 文件夹

Both of those two kinds of posts will be archived and tagged together.

This plugin does not support the separation of contents of different languages.

This feature is not as easy to implement as imagined. hexo-generator-index does not generate separate homepages for articles in different languages, which means that you must modify the configuration and execute Hexo generate multiple times to correctly generate multilingual website, or use third-party plugins like hexo-generator-i18n.

1391 is all the features that theme NexT can implement now. If you would like to simplify the generation of multilingual websites, please ask Hexo for help: http://github.com/hexojs/hexo/issues

Added in #1391

If you need full multi-language support, please submit an issue in Hexo's repository. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiapei100 picture jiapei100  ·  3Comments

yongjunwen picture yongjunwen  ·  6Comments

leeyongda picture leeyongda  ·  3Comments

AnkiKong picture AnkiKong  ·  6Comments

Linters picture Linters  ·  3Comments