Giter Club home page Giter Club logo

Comments (15)

kyoshino avatar kyoshino commented on September 25, 2024 1

It’s an open issue in Netlify/Decap CMS and on my todo list 😎

I was wondering how to solve this without breaking backward compatibility, but it’s probably not hard to do it.

  1. Allow developers to use the {{locale}} template tag in the file path file path, e.g. src/locales/{{locale}}/shared.json
  2. Sveltia CMS enables multiple files/folders mode only if {{locale}} is used
  3. Sveltia CMS will parse and generate files for all the locales while replacing {{locale}}

Let’s see if this works.

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024 1

A workaround is suggested in the Netlify/Decap CMS issue, btw. You can use a folder collection with create: false and delete: false options, create a set of files, then it looks like a file collection.

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024 1

Thank you for the workaround tip; it would work for most cases. However, in my situation, the footerData.json and header.json structures are different. :/

Actually, I'm using the same workaround for the Studio Pages YAML file:
a folder collection with the create: false and delete: false options. All the page text is stored in single yaml file.
It works perfectly for this case. I will do the same for all pages. That way, I can translate an entire page using a single well-defined YAML file, and it will look well-structured for the client.

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024 1

Done in v0.29.0 🚒

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024 1

whoah! Thanks a lot! It was the last barrier to building a functional fully i18n web personal stack. πŸ’―

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024 1

Yeah, something strange is happening. There are over 500 open issues, and most of them with bug tags concern me.
I think I have tried almost all the CMSs on the market, from closed-source Contentful to open-source Fresh Star Payload CMS. Most of them were overkill for my needs, so I narrowed my search to Git-based CMSs to avoid running a server for the CMS or being at the mercy of corporations that might pull the plug. In my humble opinion, the Keystatic CMS is great option, I liked the keystatic.cloud, but I didn't like the UX; it is too dev-centric with all the Git functions. Pages CMS is great too; I liked the UI a lot, but the i18n is non-existent and it lacks some advance features.
After some testing, I thought I would stick with the half-decent Decap until I found your CMS. This is all I need, and the i18n is perfect. In Europe, i18n is a must. I'm glad I found your CMS. πŸ‘

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024 1

Will check.

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024 1

Fixed in v0.29.1 πŸ™‡πŸΌ Two unrelated issues were involved.

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024 1

that was fast! It's now working πŸ‘

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024 1

Yeah, something strange is happening. There are over 500 open issues, and most of them with bug tags concern me.

I was checking the numbers last night. Sveltia CMS has already solved at least 90 (or 120 if you count duplicates) of these Netlify/Decap CMS issues. Will soon reach a milestone πŸ’―

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024 1

That's a crazy number for a single dev, especially considering that I constantly distract you from the 100-number goal :)

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024

Yes, I was thinking about a solution too that does not break the existing workflow, but your src/locales/{{locale}}/shared.json idea looks more logical and it's an elegant solution. {{locale}} does not break any existing logic. πŸ‘ and it's easy for the developer to follow.

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024

@kyoshino,
serious question:
how are you so productive with this project? Decap CMS has 500+ contributors, but their last commit was one month ago with a single feature. You added 4 features in the past 2 days.

from sveltia-cms.

kyoshino avatar kyoshino commented on September 25, 2024

I just want to ship a much better product than Decap CMS πŸ˜„ The i18n support is my particular concern since my own clients usually require a multilingual setup. A new client wants to have content in Japanese, English and French.

Not sure what’s happening with Decap. There are even no maintainer responses to new issues and PRs these days. Perhaps some of them have been laid off, or the company has strictly limited their time working on the project πŸ€”

Most of the contributors are from the Netlify CMS era, btw.

from sveltia-cms.

CarloBu avatar CarloBu commented on September 25, 2024

@kyoshino, I think I encountered a bug when I try to upload an image with a localized file structure. It doesn't matter whether it is an md, yaml, or json file. The image won't upload when there is a localized file structure, but I can pick the existing image from the "All Asset" though.
Additionally, I can't see my local images in the "All Asset" window.

To recreate, run this schema:

collections:
  - label: 'Test'
    name: 'test'
    create: true
    format: json
    extension: json
    i18n: duplicate
    editor:
      preview: false
    files:
      - file: 'src/content/{{locale}}/test.json'
        label: Test Data
        name: testData
        i18n: duplicate
        editor:
          preview: false
        fields:
          - label: Test Image
            name: testImage
            widget: object
            i18n: duplicate
            fields:
              - {label: Image, name: src, widget: image, i18n: duplicate}
image_upload_error_file_locale.mp4

from sveltia-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.