【问题标题】:How to manage internationalization with Hugo and NetlifyCMS如何使用 Hugo 和 NetlifyCMS 管理国际化
【发布时间】:2018-08-30 11:09:25
【问题描述】:
【问题讨论】:
标签:
internationalization
translation
hugo
netlify
netlify-cms
【解决方案1】:
在您的config.yml 中为i18n 文件创建一个File Collection,其中每种语言都有一个文件。
- name: Language
label: language
delete: false
files:
- name: english
file: 'i18n/en.yaml'
label: English
fields:
- widget: object
name: home
label: Home
fields:
- {widget: string, name: other, label: Other, required: true}
- widget: object
name: title
label: 'Site Title'
fields:
- {widget: string, name: other, label: Other, required: true}
- name: french
file: 'i18n/fr.yaml'
label: French
fields:
- widget: object
name: home
label: Home
fields:
- {widget: string, name: other, label: Other, required: true}
- widget: object
name: title
label: 'Site Title'
fields:
- {widget: string, name: other, label: Other, required: true}