gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

[gatsby-source-contentful] Missing translations should not default to a fallback language #2539

Closed hirviid closed 6 years ago

hirviid commented 7 years ago

Hi!

I have setup Contentful to use multiple languages. In Contentful I've set all fallback locales to None, because we do not want everything to be displayed in all languages.

However, gatsby seems to fill in all missing translations with the default language.

The reason I believe it's a gatsby bug, is because I tested it with the contenful sdk myself, and it is returning the correct data (which is: only the translated fields, no default language). Also, in redux-state.json, I see that c2R2NoAKtgIo6oyu4omuMY8___nl indeed contains the translated fields, but the fields which should be empty have the same value as c2R2NoAKtgIo6oyu4omuMY8.

KyleAMathews commented 7 years ago

Hmm ok, didn't know you could disable the fallback. Would love a PR that adds a check for this and doesn't setup the fallback when that's set.

hirviid commented 7 years ago

Ok, I'll try to find some time to look for a fix.

anjawaldbauer commented 6 years ago

@KyleAMathews @hirviid Shouldn't this issue be closed as the fix was merged?

KyleAMathews commented 6 years ago

Indeed :-)