feat: i18n support (#387)

This commit is contained in:
Daniel Lautzenheiser
2023-01-18 15:08:40 -05:00
committed by GitHub
parent 7372c3735b
commit a01f30ef69
22 changed files with 580 additions and 425 deletions

View File

@ -0,0 +1,8 @@
---
description: Kaffee ist ein kleiner Baum oder Strauch, der in seiner wilden Form
im Unterholz des Waldes wächst und traditionell kommerziell unter anderen
Bäumen angebaut wurde, die Schatten spendeten. Die waldähnliche Struktur
schattiger Kaffeefarmen bietet Lebensraum für eine Vielzahl von wandernden und
ansässigen Arten.
date: 2023-01-18T14:41:54.252-05:00
---

View File

@ -0,0 +1,8 @@
---
slug: file1
description: Coffee is a small tree or shrub that grows in the forest understory
in its wild form, and traditionally was grown commercially under other trees
that provided shade. The forest-like structure of shade coffee farms provides
habitat for a great number of migratory and resident species.
date: 2023-01-18T14:41:54.252-05:00
---

View File

@ -0,0 +1,8 @@
---
description: Le café est un petit arbre ou un arbuste qui pousse dans le
sous-étage de la forêt sous sa forme sauvage et qui était traditionnellement
cultivé commercialement sous d\'autres arbres qui fournissaient de l\'ombre.
La structure forestière des plantations de café d\'ombre fournit un habitat à
un grand nombre d\'espèces migratrices et résidentes.
date: 2023-01-18T14:41:54.252-05:00
---

View File

@ -7,6 +7,19 @@ local_backend: true
media_folder: /packages/core/dev-test/backends/proxy/assets/upload
public_folder: /backends/proxy/assets/upload
i18n:
# Required and can be one of multiple_folders, multiple_files or single_file
# multiple_folders - persists files in `<folder>/<locale>/<slug>.<extension>`
# multiple_files - persists files in `<folder>/<slug>.<locale>.<extension>`
# single_file - persists a single file in `<folder>/<slug>.<extension>`
structure: multiple_files
# Required - a list of locales to show in the editor UI
locales: [en, de, fr]
# Optional, defaults to the first item in locales.
# The locale to be used for fields validation and as a baseline for the entry.
defaultLocale: en
collections:
- name: posts
label: Posts
@ -469,3 +482,24 @@ collections:
- label: File
name: file
widget: file
- name: i18n_playground
label: i18n Playground
i18n: true
folder: packages/core/dev-test/backends/proxy/_i18n_playground
identifier_field: slug
create: true
fields:
# The slug field will be omitted from the translation.
- name: slug
label: Slug
widget: string
# same as 'i18n: translate'. Allows translation of the description field
- name: description
label: Description
widget: text
i18n: true
# The date field will be duplicated from the default locale.
- name: date
label: Date
widget: datetime
i18n: duplicate

View File

@ -3,6 +3,19 @@ backend:
site_url: 'https://example.com'
media_folder: assets/uploads
locale: en
i18n:
# Required and can be one of multiple_folders, multiple_files or single_file
# multiple_folders - persists files in `<folder>/<locale>/<slug>.<extension>`
# multiple_files - persists files in `<folder>/<slug>.<locale>.<extension>`
# single_file - persists a single file in `<folder>/<slug>.<extension>`
structure: multiple_files
# Required - a list of locales to show in the editor UI
locales: [en, de, fr]
# Optional, defaults to the first item in locales.
# The locale to be used for fields validation and as a baseline for the entry.
defaultLocale: en
collections:
- name: posts
label: Posts
@ -1188,3 +1201,24 @@ collections:
- label: File
name: file
widget: file
- name: i18n_playground
label: i18n Playground
i18n: true
folder: _i18n_playground
identifier_field: slug
create: true
fields:
# The slug field will be omitted from the translation.
- name: slug
label: Slug
widget: string
# same as 'i18n: translate'. Allows translation of the description field
- name: description
label: Description
widget: text
i18n: true
# The date field will be duplicated from the default locale.
- name: date
label: Date
widget: datetime
i18n: duplicate

File diff suppressed because one or more lines are too long