feat: add translation support (#2870)

* feat: add translation support

* test(cypress): fix locale import

* docs: add locale documentation

* feat: add german translation (#2877)

* fix: locales package version, register all locales in netlify-cms
This commit is contained in:
Erez Rokah
2019-11-14 11:25:04 +02:00
committed by GitHub
parent 4833f33728
commit 096b067d45
22 changed files with 660 additions and 191 deletions

View File

@ -120,6 +120,35 @@ When the `logo_url` setting is specified, the CMS UI will change the logo displa
logo_url: https://your-site.com/images/logo.svg
```
## Locale
The CMS locale.
Defaults to `en`.
Other languages than English must be registered manually.
**Example**
In your `config.yml`:
```yaml
locale: 'de'
```
And in your custom JavaScript code:
```js
import CMS from 'netlify-cms-app';
import { de } from 'netlify-cms-locales';
CMS.registerLocale('de', de);
```
When a translation for the selected locale is missing the English one will be used.
> When importing `netlify-cms` all locales are registered by default (so you only need to update your `config.yml`).
## Show Preview Links
[Deploy preview links](../deploy-preview-links) can be disabled by setting `show_preview_links` to `false`.