facebook / facebook/docusaurus

[i18n] Making everything translatable (website title, description...)

未关闭
#4,542 37 条评论 9 个 reaction 已指派 0 人 在 GitHub 查看
domain: i18n feature
主要语言
TypeScript
星标
66.2k
派生
10k
平均合并
1 天 3 小时
30 天内合并 PR
52

描述

## 🚀 Feature

First of all, the i18n feature of Docusaurus is terrific, thanks a lot!

It seems that the website's title can't be translated. It's not a big problem if the website title is just a simple name or doesn't have much meaning. However, It's really not ideal especially when the website uses languages that use different alphabet: imagine the main language of the website is Chinese (or Hebrew, Thai, Russian, etc) and the website title is also written in this language, then all final html pages' title will contain this website title, even for pages written in secondary/other languages (English for example), which is a bit bad for viewers and SEO since the website title in the html title is almost unreadable.

Thus, I think it's a good idea to include the possibility to translate the website title in the i18n feature, to improve readability and SEO in the cases illustrated above.

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?

Yes.

## Motivation

See above.

## Pitch

It would be great if the website title can be translated just like how the navbar/footer/react code is translated: add translations in some json file in `i18n` directory. Or even better: provide the website title translation in `i18n` in `docusaurus.config.js` directly (maybe in `localConfigs` for example, with a optional field for website title translation).

PS. Still need to mention this again: thanks for the awesome i18n feature!

## TODOs

- [ ] site metadata in docusaurus.config.js
- Website title
- Announcement bar
- Logo alt
- Tagilne
- Copyright
- [x] Admonition title
- Blocked by 3p deps
- [X] Strings in plugin options
- Blog sidebar title
- [ ] DocSearch model
- Blocked by 3p deps

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。