mirror of
https://github.com/imfing/hextra.git
synced 2025-08-23 17:06:39 -04:00
chore: update zh-cn translation
This commit is contained in:
@@ -8,9 +8,9 @@ Hextra 支持使用 Hugo 的[多语言模式](https://gohugo.io/content-manageme
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 启用多语言
|
||||
## 启用多语言功能
|
||||
|
||||
要使我们的网站支持多语言,我们需要告诉 Hugo 支持的语言。我们需要在站点配置文件中添加:
|
||||
要使网站支持多语言,我们需要在站点配置文件中指定支持的语言:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
defaultContentLanguage: en
|
||||
@@ -28,7 +28,7 @@ languages:
|
||||
|
||||
## 通过文件名管理翻译
|
||||
|
||||
Hugo 支持通过文件名管理翻译。例如,如果我们有一个英文文件 `content/docs/_index.md`,我们可以创建一个文件 `content/docs/_index.fr.md` 作为法语翻译。
|
||||
Hugo 支持通过文件名管理翻译。例如,如果我们有一个英文文件 `content/docs/_index.md`,可以创建 `content/docs/_index.fr.md` 作为法语翻译。
|
||||
|
||||
{{< filetree/container >}}
|
||||
{{< filetree/folder name="content" >}}
|
||||
@@ -40,11 +40,11 @@ Hugo 支持通过文件名管理翻译。例如,如果我们有一个英文文
|
||||
{{< /filetree/folder >}}
|
||||
{{< /filetree/container >}}
|
||||
|
||||
注意:Hugo 还支持[通过内容目录进行翻译](https://gohugo.io/content-management/multilingual/#translation-by-content-directory)。
|
||||
注意:Hugo 还支持[通过内容目录翻译](https://gohugo.io/content-management/multilingual/#translation-by-content-directory)。
|
||||
|
||||
## 翻译菜单项
|
||||
|
||||
要翻译导航栏中的菜单项,我们需要设置 `identifier` 字段:
|
||||
要翻译导航栏中的菜单项,需要设置 `identifier` 字段:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
menu:
|
||||
@@ -59,7 +59,7 @@ menu:
|
||||
weight: 2
|
||||
```
|
||||
|
||||
并在相应的 i18n 文件中进行翻译:
|
||||
并在对应的 i18n 文件中进行翻译:
|
||||
|
||||
```yaml {filename="i18n/fr.yaml"}
|
||||
documentation: Documentation
|
||||
@@ -68,7 +68,7 @@ blog: Blog
|
||||
|
||||
## 翻译字符串
|
||||
|
||||
要翻译其他地方的字符串,我们需要将翻译添加到相应的 i18n 文件中:
|
||||
要翻译其他位置的字符串,需要将翻译添加到对应的 i18n 文件中:
|
||||
|
||||
```yaml {filename="i18n/fr.yaml"}
|
||||
readMore: Lire la suite
|
||||
@@ -76,7 +76,7 @@ readMore: Lire la suite
|
||||
|
||||
主题中使用的字符串列表可以在 `i18n/en.yaml` 文件中找到。
|
||||
|
||||
## 了解更多
|
||||
## 延伸阅读
|
||||
|
||||
- [Hugo 多语言模式](https://gohugo.io/content-management/multilingual/)
|
||||
- [Hugo 多语言第一部分:内容翻译](https://www.regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/)
|
||||
|
Reference in New Issue
Block a user