decaporg / decaporg/decap-cms

Problem in admin for feature i18n

Open
#4,581 6 comments 3 reactions 0 assignees View on GitHub
area: i18n area: ui/editor type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Here is the video
https://streamable.com/be4qkh

Here the repo:
https://github.com/helderjnpinto/netlify-nuxt-boilerplate

**Describe the bug**
The problem is when we access the default locale is ok, but when access the other locales defined in i18n the fields are blank and when go back the "item" that represents previous access will be blank.

**To Reproduce**

1. Go to admin
2. Click on non default translated item
3. The fields appear blank on the default locale and the respected locale not showing
4. When go back this item on the list will be blank without any lable
5. Click on default translated item works fine.

**Expected behavior**
works from editing any locale

**Screenshots**

![ezgif com-gif-maker](https://user-images.githubusercontent.com/12281088/99097659-d5c75300-25cf-11eb-84da-9619c3aea761.gif)

**Applicable Versions:**

- Netlify CMS version: [e.g. 2.0.4]
"netlify-cms": "^2.10.68",
- Git provider: [e.g. GitHub, BitBucket]
github
- OS: [e.g. Windows 7]
ubuntu 20
- Browser version
Version 86.0.4240.183 (Official Build) (64-bit)

- Node.JS version: 12.16.1

**CMS configuration**

```yaml
site_url: https://app.netlify.com/sites/brave-franklin-eb5e16/
logo_url: https://app.netlify.com/sites/brave-franklin-eb5e16/icon.png

publish_mode: editorial_workflow
backend:
name: git-gateway
branch: master

media_folder: static/img
public_folder: /img

# when using the default proxy server port
# local_backend: true
local_backend:
# when using a custom proxy server port
url: http://localhost:8082/api/v1
# when accessing the local site from a host other than 'localhost' or '127.0.0.1'
allowed_hosts: ["192.168.0.1"]

i18n:
# Required and can be one of multiple_folders, multiple_files or single_file
# multiple_folders - persists files in `//.`
# multiple_files - persists files in `/..`
# single_file - persists a single file in `/.`
structure: multiple_files

# Required - a list of locales to show in the editor UI
locales: [en, pt]

# Optional, defaults to the first item in locales.
# The locale to be used for fields validation and as a baseline for the entry.
default_locale: pt

# Docs: https://www.netlifycms.org/docs/configuration-options/#collections
collections:
- label: "Site settings"
name: "site"
files:
- label: "Info"
name: "info"
file: "assets/content/site/info.json"
format: "json"
editor:
preview: false
fields:
- {
label: Site Name,
name: sitename,
widget: string,
hint: "This is used for the site title",
}
- {
label: Site Description,
name: sitedescription,
widget: string,
hint: "This is used as descriptive text for links that link to this site",
}
- {
label: Site Language,
name: sitelang,
widget: string,
pattern:
[
"^[a-z]{2}([-])?([A-Za-z]{2})?$",
'Must match "xx" or "xx-XX" syntax (ex. "en" or "sv-SE")',
],
}
- {
label: Site Email,
name: siteemail,
widget: string,
required: false,
}

- name: "blog"
label: "Blog"
identifier_field: name
folder: "assets/content/blog"
create: true
format: "json"
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
i18n: true
fields:
- { label: "Title", name: "title", widget: "string", i18n: true }
- {
label: "Publish Date",
name: "date",
widget: "datetime",
i18n: duplicate,
}
- {
label: "Description",
name: "description",
widget: "string",
i18n: true,
}
- { label: "Body", name: "body", widget: "markdown", i18n: true }

- name: "projects"
identifier_field: name
label: "Projects"
label_singular: "Project"
description: "All company Projects"
folder: "assets/content/projects"
create: true
format: "json"
slug: "{{project_type}}-{{slug}}"
preview_path: "projects/{{slug}}"
i18n: true
fields:
- {
label: "Project Type",
name: "project_type",
widget: "select",
default: "story",
options:
[
{ label: "Story", value: "story" },
{ label: "Photo", value: "photo" },
],
i18n: duplicate,
}
- {
label: "Publish Date",
name: "date",
widget: "datetime",
i18n: duplicate,
}
- { label: "Title", name: "title", widget: "string", i18n: true }
- {
label: "Description",
name: "description",
widget: "string",
required: false,
i18n: true,
}
- {
label: "Content",
name: "body",
widget: "markdown",
required: false,
i18n: true,
}
- {
label: "Cover Image",
name: "cover",
widget: "image",
required: false,
allow_multiple: false,
i18n: duplicate,
}
- {
label: "Gallery",
name: "gallery",
widget: "list",
required: false,
summary: "{{fields.image}}",
field:
{ label: "Image", name: "image", widget: "image", i18n: duplicate },
}

```

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.