0

I am working on a Hugo site with NetlifyCMS integration (GitLab as backend). I wanna know what options I have to allow modification of the internationalization files that Hugo uses (i18n/en.yaml, i18n/fr.yaml, ...) from within the NetlifyCMS admin panel.

It is easy to modify translations of content files (_index.md, _index.fr.md, ...) by just creating a separate collection for every page and adding each language version of one page under the same collection.

How should I approach the integration of the i18n files with NetlifyCMS? https://gohugo.io/content-management/multilingual/#translation-of-strings

eyettea
  • 1,376
  • 2
  • 16
  • 35

1 Answers1

1

Create a File Collection in your config.yml for the i18n files where there is a file for each language.

  - 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}
talves
  • 13,993
  • 5
  • 40
  • 63