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: Add support for file collections #4483

Closed
reimertz opened this issue Oct 20, 2020 · 4 comments · Fixed by #4634
Closed

i18n: Add support for file collections #4483

reimertz opened this issue Oct 20, 2020 · 4 comments · Fixed by #4634
Assignees
Labels
area: i18n type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@reimertz
Copy link

We are currently on a forked version of the first PR of the internationalization track where we added support for list collections.

But since it was decided to rework above implementation and use another architecture, our solution became obsolete and are now stuck on that fork. 😅

So naturally, we've started looking into contributing by adding support for file collections but would like to ask @erezrokah if there was any other reason for not adding this feature except from scoping the PR?

Something else we should thing about when we add the feature?
Any pointers / ideas / etc before we go deep here would be very helpful.

@reimertz reimertz added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Oct 20, 2020
@erezrokah
Copy link
Contributor

No other reasons other then scoping down the PR and also file collections it would need some discussion on how to configure and implement it since at the moment a file collection points to specific files, so I'm not sure how we need to structure the output.

I would start by describing your use case and we can move forward from there.

@gewfy
Copy link

gewfy commented Oct 21, 2020

Hi
Thank you for replying! I can fill in here (colleague with @reimertz).

Aside from pure editorial content we also use netlify cms for handling translations of all UI strings in the app. So basically we have a schema UI with one file per category / screen / component of the app. In total it's 74 files with separate schemas for every file. One option would of course be to move them to individual collections, but that would be a quite messy left nav. Another would be to combine them into one or a couple of collections, but then the edit view would be quite massive and the versioning / branching not working as efficiently.

So what we need is basically the way file collections work today - but with i18n support.

I'm working on getting to know netlify-cms to implement this for us and contribute back to the awesome work you're doing with this project. But please let me know if this would be something that you could prioritize or collaborate on.

Thank you!

@iansinnott
Copy link
Contributor

I'm seeing some unexpected behavior and I'm wondering if I'm missing something or if there might be a bug.

It seems that the i18n: duplicate setting does not work in file collections. Here's the relevant portion of my config:

    - name: 'config_2'
      label: 'Config 2'
      i18n:
          structure: single_file
      editor:
          preview: false
      files:
          - label: 'Blarg (en|zh)'
            name: 'navigation_en_zh'
            file: 'data/navigation.yaml'
            i18n: true
            fields:
                - label: 'Navigation Items'
                  name: 'items'
                  widget: 'list'
                  i18n: true
                  fields:
                      - { label: Name, name: name, widget: string, i18n: true }
                      - { label: Topic, name: topic, widget: string, i18n: true }
                      - { label: Link, name: link, widget: string, i18n: duplicate } # <--- This... 

P.S. Thanks for shipping this everyone! Even without duplicate this is a big improvement to the i18n support.

@erezrokah
Copy link
Contributor

Hi @iansinnott, see https://www.netlifycms.org/docs/beta-features/#limitations for list widget limitations and also #4386

vladdu pushed a commit to vladdu/netlify-cms that referenced this issue Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: i18n type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants