Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multilanguage support for oneamongus.ca #3

Open
sauricat opened this issue Sep 22, 2023 · 4 comments
Open

Add multilanguage support for oneamongus.ca #3

sauricat opened this issue Sep 22, 2023 · 4 comments

Comments

@sauricat
Copy link
Member

这个站做成多语言有没有困难?目测可以加中文和日文之类的。尤其是 Links(就是很多组织都有的 link tree,我们 host 在自己网站上就可以了)。

@BeiyanYunyi 由于这个站是你之前搭建的,麻烦说一下想法。如果不是很空闲的话,具体实现可以让我们其他朋友来操作。

cc 技术支援组 @artefaritaKuniklo

@BeiyanYunyi
Copy link
Member

BeiyanYunyi commented Sep 22, 2023

没有困难。

https://vitepress.dev/guide/i18n

今天或者明天我抽空做一下。

BeiyanYunyi added a commit that referenced this issue Sep 22, 2023
BeiyanYunyi added a commit that referenced this issue Sep 22, 2023
@BeiyanYunyi
Copy link
Member

BeiyanYunyi commented Sep 22, 2023

https://github.com/one-among-us/about-site/tree/i18n ,目前的做法是:英语放在根目录,其他语言放在其对应目录。例:/zh-cn/posts。需要注意的地方有如下几处:

  • /content/.vitepress/config.tsrewrite 配置。
  • 同上,locales 配置。
  • 各文档内部的链接,需要修改为链接至自己语言页的页面,如 /posts 修改为 /zh-cn/posts

路径名具体应当采用哪种方案,如使用 zh-cn 还是 zh-Hans(我的建议是后者),有待进一步讨论。

@artefaritaKuniklo
Copy link
Contributor

https://github.com/one-among-us/about-site/tree/i18n ,目前的做法是:英语放在根目录,其他语言放在其对应目录。例:/zh-cn/posts。需要注意的地方有如下几处:

  • /content/.vitepress/config.tsrewrite 配置。
  • 同上,locales 配置。
  • 各文档内部的链接,需要修改为链接至自己语言页的页面,如 /posts 修改为 /zh-cn/posts

路径名具体应当采用哪种方案,如使用 zh-cn 还是 zh-Hans(我的建议是后者),有待进一步讨论。

和.us站统一起来的话用的是zh-Hans

BeiyanYunyi added a commit that referenced this issue Sep 30, 2023
* [+] I18n example, #3

* [U] Change zh-cn to zh-Hans

* [U] Update flake

* [U] Update zh-Hans translation

* [+] Add contact zh-Hans

* [F] Fix punctuation

* [+] Add zh-Hans posts

Bug unfixed: index of "posts" shows english page

* [U] Fix i18n

* [F] Fix title of zh-Hans

* [F] Fix format

* [F] Fix frontpage buttons zh-Hans

* [U] Add i18n for index page

* [U] Update frontpage

* [U] Use useData instead of useRoute

---------

Co-authored-by: sauricat <[email protected]>
@sauricat
Copy link
Member Author

sauricat commented Oct 7, 2023

Temporarily solved. We can add more languages in the future. I suggest not closing the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants