HBS supports multiple languages out of box, such as English, Simplified Chinese, Traditional Chinese, French, Russian, etc.
You can add your own translations on: hugo-theme-bootstrap/i18n
Supported Languages
| Language | Code |
|---|---|
| English | en |
| Simplified Chinese | zh-hans(Recommended), zh-cn |
| Traditional Chinese | zh-hant(Recommended), zh-tw, zh-hk |
| Spanish | es |
| Arabic | ar |
| German | de |
| French | fr |
| Indonesian | id |
| Japanese | ja |
| Polish | pl |
| Portuguese | pt |
| Russian | ru |
| Ukrainian | uk |
| Uzbek | uz |
Configuration
config/_default/language.toml
1[ar]
2 languageDirection = 'rtl'
3 title = 'مدونتي'
4 weight = 3
5[en]
6 languageName = 'English'
7 weight = 1
8[zh-hans]
9 languageName = '简体中文'
10 weight = 2
11 [zh-hans.params]
12 description = '一个快速、响应式和功能丰富的 Hugo 博客主题'
13 keywords = 'Hugo, Bootstrap, 博客主题'
config/_default/language.yaml
1ar:
2 languageDirection: rtl
3 title: مدونتي
4 weight: 3
5en:
6 languageName: English
7 weight: 1
8zh-hans:
9 languageName: 简体中文
10 params:
11 description: 一个快速、响应式和功能丰富的 Hugo 博客主题
12 keywords: Hugo, Bootstrap, 博客主题
13 weight: 2
config/_default/language.json
1{
2 "ar": {
3 "languageDirection": "rtl",
4 "title": "مدونتي",
5 "weight": 3
6 },
7 "en": {
8 "languageName": "English",
9 "weight": 1
10 },
11 "zh-hans": {
12 "languageName": "简体中文",
13 "params": {
14 "description": "一个快速、响应式和功能丰富的 Hugo 博客主题",
15 "keywords": "Hugo, Bootstrap, 博客主题"
16 },
17 "weight": 2
18 }
19}
You’ll need to specify the
languageDirectionasrtlfor Right-to-left writing languages.
See also Hugo Multilingual.*
The parameter that controls the default language of the site must be located in the site configuration file. See
defaultContentLanguageon Site Configuration.
Localization
The dateFormat supports localization, you can change it as :date_full, you can find more layouts in Date/time formatting layouts.
Please note that the
zh-cn,zh-twandzh-hkare not supported, since the language code could not match the locales defined in Hugo Locales.
Comments