[gatsby-source-contentful] Customisable locale fallbacks #29872
Replies: 9 comments
-
Thanks for opening a new issue! :) I see the benefit of this, in my own projects as well.
My gut feeling agrees, can we proof this with some kind of source?
Yes you can not expect the handling of locales in Contentful to change. These project specific behaviours need to be handled by the dev. Will add it to our contentful plugin improval project but I am busy fixing other things. Any contribution, research and opinions about this feature are very welcome. |
Beta Was this translation helpful? Give feedback.
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
not stale |
Beta Was this translation helpful? Give feedback.
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
Chiming in with support for @disintegrator viewpoint on images. Images not falling back is confusing, especially with the ability to enable localisation on the image field in the content model. The expectation I had was for localisation to be managed at the content level not the asset level |
Beta Was this translation helpful? Give feedback.
-
I'll check what we can do in the plugin and will talk to the Contentful team if there are any options/plans to change this on API level. But can't give any ETA yet |
Beta Was this translation helpful? Give feedback.
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
@axe312ger shall I keep nudging this issue or just let it go stale? (Don’t mind either way) |
Beta Was this translation helpful? Give feedback.
-
We might be able to integrate this when we restructure the way nodes are created internally with the source plugin. Still no ETA possible. You might ask support if they could do sth on API level. |
Beta Was this translation helpful? Give feedback.
-
Summary
One really useful feature to have in
gatsby-source-contentful
is the ability to customize locale fallback for assets. In Contentful, the locale fallback feature applies to all content (entries and assets). This is almost never desirable and there doesn't seem to be any plans from them to make that configuration more granular. I noticed in the source plugin (based on 2.3.33) that there is a utility function used to fetch fields with a locale fallback. I'm wondering if that can be fed some plugin config option.Basic example
In the following example, assets that don't have a file set for en-gb will use the file value for en-us.
The API is purposely abstracted to support not just assets but any Contentful node type. There are use cases to customise the fallback behaviour for other content types. Another example is that we store our translation phrases as entries in Contentful and if a phrase is defined in en-gb but not en-au then we can define a fallback for ContentfulTranslation node type from en-au to en-gb.
Motivation
Why are we doing this? What use cases does it support? What is the expected outcome?
Explained in earlier sections.
Beta Was this translation helpful? Give feedback.
All reactions