decaporg / decaporg/decap-cms

i18n: multiple_files structure for file collections

Open
#5,280 10 comments 9 reactions 0 assignees View on GitHub
area: i18n type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Just getting to grips with the Beta i18n capabilities and really like the `multple_folders` and `multiple_files` structures. However, I am confused by the decision to only support a `single_file` structure for file collections. I say this reservedly as, clearly, a lot of work must have gone into providing the i18n capabilities and therefore this is in no way a critisism and, quite possibly, may be down to a misunderstanding on my part. The problem that I have though is generating pages in gatsby-node when the i18n implementation involves a mixed structure of `multiple_files` (i.e. for templated content such as blog posts, product entries etc.) and `single_file` for one off pages (i.e. index, about, contact).

I'd like to see file collections also support a `multiple_files` structure as that would allow a single `createPage` mechanism in gatsby-node to be used. Naturally, that would require a single markdown file for language-specific page, using locale as the differentiating factor i.e. index.en.md, index.de.md, index.es.md and so on.

If this isn't technically viable, please advise how to go about page generation in gatsby-node when confronted with both `multiple_files` and `single_file` collections.

Thanks in advance for your help!

Contributor guide

Open the contributing guide

Research direction

Start by reading the i18n collection structures and the Gatsby `gatsby-node` page-generation entry point, then compare how `multiple_files` and `single_file` collections are represented. Done means determining whether locale-specific files such as `index.en.md` can be supported for file collections, or documenting a clear generation approach for projects mixing both structures.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.