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

Making this work with Contentful Example: Missing Message error #7

Closed
mccrodp opened this issue Feb 6, 2018 · 1 comment
Closed

Comments

@mccrodp
Copy link

mccrodp commented Feb 6, 2018

Hey, firstly, many thanks for this repo, so helpful (using this to migrate a personal project from Elm). Have it almost working, just some misunderstanding of the way the layouts are working.

I guess this works on something to do with: useLangKeyLayout: true in the gatsby.config.js file, right? Then you have your en.js layout, etc.

I've followed the Contentful example here: https://github.com/gatsbyjs/gatsby/blob/master/examples/using-contentful/src/layouts/index.js

I have tried to integrate the 2 concepts, but due the the way the layouts are perhaps, I get the below error:

[React Intl] Missing message: "selectLanguage" for locale: "en"
[React Intl] Cannot format message: "selectLanguage", using message id as fallback.

screen shot 2018-02-06 at 20 50 34

My add-menu branch here shows how this is setups (simple enough at the moment). https://github.com/ahimsayoga/ahimsayogajp/blob/add-menu/src/layouts/index.js

The only real difference is the content is dynamic from Contentful and it uses
gatsby.node.js to import content: https://github.com/ahimsayoga/ahimsayogajp/blob/add-menu/gatsby-node.js#L12
It points to a template general.js: https://github.com/ahimsayoga/ahimsayogajp/blob/add-menu/src/templates/general.js

I'm not exactly sure if I should be importing this intl functionality to the template, or if I need to wire up the layout files for this Contentful scenario, or both. New enough to practical application of React also, so my knowledge can be lacking a bit also. Cheers!

@mccrodp mccrodp changed the title Making this work with Contentful Example Making this work with Contentful Example: Missing Message error Feb 6, 2018
@mccrodp
Copy link
Author

mccrodp commented Feb 10, 2018

Issue moved to angeloocana/gatsby-plugin-i18n #31 via ZenHub

@mccrodp mccrodp closed this as completed Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant