Skip to content

Commit f186fa3

Browse files
committed
Multilingual support
1 parent 9035fbc commit f186fa3

22 files changed

+215
-29
lines changed

.frontmatter/database/mediaDb.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/docs/content-creation/content-folders.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ title: Content folders
33
slug: content-creation/content-folders
44
description: null
55
date: 2024-02-21T09:10:16.640Z
6-
lastmod: 2024-02-21T09:43:59.593Z
6+
lastmod: 2024-02-21T14:56:03.901Z
77
weight: 200.11
88
---
99

1010
# Content Folders
1111

1212
Content folders are a way to organize your pages/files. Most of the time,
13-
this location is defined by the Static Site Generator (SSG) you are using.
13+
the static site generator (SSG) you are using defines the location where
14+
you store your content.
1415

15-
To make sure that Front Matter CMS can find your content, and create the
16+
To make sure that Front Matter CMS can find your content and create the
1617
content in the correct place, you need to register the content/page folders.
1718

1819
## Registering content folders
1920

20-
The registration of the page folders is normally done during the setup of
21-
the CMS: [Step 3: Register content folder(s)][01].
21+
The registration of the page folders is typically performed during the setup of
22+
the CMS: [Step 3: Register content folder(s)][01],
23+
but you can perform changes at any time.
2224

2325
Content folders are stored in the [frontMatter.content.pageFolders][02] setting.
2426

@@ -73,7 +75,27 @@ Content folders are stored in the [frontMatter.content.pageFolders][02] setting.
7375
}
7476
```
7577

76-
Once the content folders are registered, you can start creating content with Front Matter CMS.
78+
Once the content folders are registered, you can create content with Front Matter CMS.
79+
80+
## Register a new content folder
81+
82+
### Settings view
83+
84+
You can make use of the settings view to easily add a new content folder.
85+
86+
To open the settings view, click on the gear icon in the top right corner in any of our dashboards.
87+
88+
1. Click on the "Content folders" tab.
89+
1. Click on the folders which you want to add as a content folder.
90+
91+
![Add a new content folder](/releases/v9.3.0/content-folders.png)
92+
93+
### Explorer view
94+
95+
You can also add a new content folder by right-clicking on a folder in the explorer view
96+
and clicking on `Register folder` under the Front Matter CMS context menu.
97+
98+
![Register a new content folder](/releases/v9.3.0/register-folder.png)
7799

78100
## Properties
79101

content/docs/content-creation/multilingual.md

Lines changed: 141 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,148 @@ title: Multilingual
33
slug: content-creation/multilingual
44
description: null
55
date: 2024-02-21T09:10:16.640Z
6-
lastmod: 2024-02-21T09:43:53.819Z
6+
lastmod: 2024-02-21T15:47:40.601Z
77
weight: 200.71
88
---
99

1010
# Multilingual content
11+
12+
Front Matter CMS supports multilingual content. This means that you can create
13+
content in multiple languages and manage them in the same workspace.
14+
15+
![Multilingual content](/releases/v10.0.0/multilingual-content.png)
16+
17+
## Configuration
18+
19+
To enable multilingual content, you need to define the default locale per content folder
20+
and define which locales which you want to support.
21+
22+
### Define the default locale per content folder
23+
24+
To define the default locale per content folder, you need to use the `defaultLocale`
25+
property on the `frontMatter.content.pageFolders` setting.
26+
27+
```json {{ "title": "Example of the default locale configuration" }}
28+
{
29+
"frontMatter.content.pageFolders": [
30+
{
31+
"title": "Multilingual",
32+
"path": "[[workspace]]/docs/en",
33+
"filePrefix": "",
34+
"defaultLocale": "en" // This value needs to map to the locale defined in the i18n setting
35+
}
36+
]
37+
}
38+
```
39+
40+
### Define the locales
41+
42+
You can define the locales on two levels:
43+
44+
- **Global level**: When using the `frontMatter.content.i18n` setting, you define
45+
the locales for the entire workspace. This means that any content folder which
46+
is multilingual enabled, it will use the locales defined in the global setting.
47+
- **Content folder level**: When using the `locales` property on the
48+
`frontMatter.content.pageFolders` setting, you can define the locales for a
49+
specific content folder.
50+
51+
#### Global level
52+
53+
To define the locales on the global level, you need to use the `frontMatter.content.i18n`
54+
setting.
55+
56+
```json {{ "title": "Example of the global i18n configuration" }}
57+
{
58+
"frontMatter.content.i18n": [
59+
{
60+
"title": "English",
61+
"locale": "en"
62+
},
63+
{
64+
"title": "German",
65+
"locale": "de",
66+
"path": "../de"
67+
},
68+
{
69+
"title": "Nederlands",
70+
"locale": "nl",
71+
"path": "../nl"
72+
}
73+
]
74+
}
75+
```
76+
77+
> **Important**: The default locale (like the **English** locale) does not
78+
> require to define a `path` as it is defined by the content folder configuration.
79+
80+
#### Content folder level
81+
82+
You can also define the locales on the content folder level. This allows you to
83+
override the global locales for a specific content folder.
84+
85+
```json {{ "title": "Example of the content folder i18n configuration" }}
86+
{
87+
"frontMatter.content.pageFolders": [
88+
{
89+
"title": "Multilingual",
90+
"path": "[[workspace]]/docs/en",
91+
"filePrefix": "",
92+
"defaultLocale": "en",
93+
"locales": [
94+
{
95+
"title": "English",
96+
"locale": "en"
97+
},
98+
{
99+
"title": "Nederlands",
100+
"locale": "nl",
101+
"path": "../nl"
102+
}
103+
]
104+
}
105+
]
106+
}
107+
```
108+
109+
## Create a translation
110+
111+
Once the multilingual settings are configured, you can create content in multiple
112+
languages with Front Matter CMS.
113+
114+
You can create content translations by starting from the default locale content and
115+
then you can use any of the following methods to create a new translation:
116+
117+
- Use the `Front Matter: Create new translation` command from the command palette
118+
- Use the `Create new translation` button in the content editor toolbar
119+
120+
![Create translation action](/releases/v10.0.0/create-translation.png)
121+
122+
- On the content dashboard, you can use the `create translation` action from the
123+
content item menu
124+
125+
![Create translation on content card](/releases/v10.0.0/card-create-translation-action.png)
126+
127+
## Automatic language translation
128+
129+
By default, the multilingual feature does not include automatic language translation of
130+
content. However, you can make use of [DeepL](https://www.deepl.com/) for automatic
131+
language translation.
132+
133+
To enable automatic language translation, you need to provide your authentication key
134+
from DeepL.
135+
136+
### Configure DeepL
137+
138+
Follow the next steps in order to configure the DeepL authentication key:
139+
140+
- Go to the [DeepL Account Summary](https://www.deepl.com/your-account/summary) page
141+
- Copy the `Authentication Key for DeepL API`
142+
- Back in Visual Studio Code, open the Front Matter CMS dashboard
143+
- Click on the gear icon in the top right corner to open the settings view
144+
- Click on the `Integration` tab
145+
- Paste the `Authentication Key for DeepL API` in the `Authentication key` field
146+
147+
![DeepL Authentication Key](/releases/v10.0.0/deepl-authentication-key.png)
148+
149+
Once you provided the authentication key, when you create a new translation, the
150+
content will be automatically translated to the target language.

public/config/content.pagefolders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.pagefolders.schema.json",
44
"description": "Defines the settings for Front Matter page folder",
5-
"lastModified": "2024-02-21T09:52:54.398Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - page folder",
88
"properties": {

public/config/content.placeholders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.placeholders.schema.json",
44
"description": "Defines the settings for Front Matter placeholder",
5-
"lastModified": "2024-02-21T09:52:54.399Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - placeholder",
88
"properties": {

public/config/content.snippets.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.snippets.schema.json",
44
"description": "Defines the settings for Front Matter snippet",
5-
"lastModified": "2024-02-21T09:52:54.399Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - snippet",
88
"required": [

public/config/custom.scripts.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/custom.scripts.schema.json",
44
"description": "Defines the settings for Front Matter custom script",
5-
"lastModified": "2024-02-21T09:52:54.398Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - custom script",
88
"properties": {

public/config/data.files.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.files.schema.json",
44
"description": "Defines the settings for Front Matter data file",
5-
"lastModified": "2024-02-21T09:52:54.399Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - data file",
88
"properties": {

public/config/data.folders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.folders.schema.json",
44
"description": "Defines the settings for Front Matter data folder",
5-
"lastModified": "2024-02-21T09:52:54.399Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - data folder",
88
"properties": {

public/config/data.types.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.types.schema.json",
44
"description": "Defines the settings for Front Matter data type",
5-
"lastModified": "2024-02-21T09:52:54.399Z",
5+
"lastModified": "2024-02-21T15:28:35.428Z",
66
"type": "object",
77
"title": "Front Matter - data type",
88
"properties": {

0 commit comments

Comments
 (0)