Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: unable to save content #5122

Closed
khawarizmus opened this issue Mar 15, 2021 · 0 comments
Closed

i18n: unable to save content #5122

khawarizmus opened this issue Mar 15, 2021 · 0 comments
Labels
area: i18n area: ui/editor type: bug code to address defects in shipped code

Comments

@khawarizmus
Copy link

Describe the bug

The bug is inconsistent and I can't yet point out what the issue is but I keep getting an error when trying to save a translated version of a collection the save button is not responsive.

image

and I get a not very helpful error in the console:

image

To Reproduce

The following is my config.yml

site_url: https://SOMETHING.netlify.app/
logo_url: https://SOMETHING.netlify.app/logo.png

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

media_folder: static/img
public_folder: /img

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_folders

  # Required - a list of locales to show in the editor UI
  # en - English
  # ar - Arabic
  # ms - Malay
  # sw - Swahili
  locales: [en, ar, ms, sw]

  # 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: en

# Docs: https://www.netlifycms.org/docs/configuration-options/#collections
collections:
  - label: 'Site settings'
    name: 'site'
    files:
      - label: 'Info'
        name: 'info'
        file: '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: Email Contact, name: contact, widget: string, hint: 'This email is used for the contact form' }
          - {
              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")'],
              hint: 'The default website language'
            }
          # - { label: Site Email, name: siteemail, widget: string, required: false }
  - name: 'blog'
    label: 'Blog'
    folder: 'content/blog'
    create: true
    i18n: true
    format: 'frontmatter'
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    # editor:
    #   preview: true
    fields:
      - { label: 'Title', name: 'title', widget: 'string', required: true, i18n: true }
      - { label: 'Description', name: 'description', widget: 'string', required: false, i18n: true }
      - { label: 'Body', name: 'body', widget: 'markdown', required: false }
  
  - name: 'campaigns'
    label: 'campaigns'
    label_singular: 'Campaign'
    folder: 'content/campaigns'
    create: true
    i18n: true
    format: 'frontmatter'
    slug: '{{slug}}'
    preview_path: 'campaigns/{{slug}}'
    fields:
      - {
          label: 'Campaign tag',
          name: 'tags',
          widget: 'list',
          default: ['zakat'],
          min: 1,
          max: 3
        }
      - { label: 'Title', name: 'title', widget: 'string', i18n: true, required: true }
      - { label: 'Description', name: 'description', widget: 'string', i18n: true, required: false }
      - { label: 'Cover Image', name: 'cover', widget: 'image', required: false, i18n: duplicate,  allow_multiple: false }
      - { label: 'Content', name: 'body', widget: 'markdown', i18n: true, required: true }
      - {
          label: 'Gallery',
          name: 'gallery',
          widget: 'list',
          required: false,
          summary: '{{fields.image}}',
          field: { label: 'Image', name: 'image', widget: 'image' },
        }

Expected behavior
the save button should save properly and there should be no errors

Applicable Versions:

  • Netlify CMS version: 2.10.99
  • Git provider: GitHub
  • OS: windows 10
  • Browser version: chrome 89.0.4389.82 (Official Build) (64-bit), firefox 86.0.1 (64-bit)
  • Node.JS version: 12
@khawarizmus khawarizmus added the type: bug code to address defects in shipped code label Mar 15, 2021
@khawarizmus khawarizmus closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: i18n area: ui/editor type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants