gatsby-plugin-i18n | Multi language routes for Gatsby | Frontend Framework library
kandi X-RAY | gatsby-plugin-i18n Summary
kandi X-RAY | gatsby-plugin-i18n Summary
Multi language routes for Gatsby
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-plugin-i18n
gatsby-plugin-i18n Key Features
gatsby-plugin-i18n Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-plugin-i18n
QUESTION
I am totally stuck.
Have a setup of GatsbyJS 1 with gatsby-next and React 16 + latest Firebase 5.5.7
In develop mode everything works fine, but when I try to make a build I always get:
WebpackError: _firebase2.default.initializeApp is not a function
I have already tried all of the following kinds if imports, and all of them result in this error:
import firebase from 'firebase';
// const firebase = require('firebase/app')
// import * as firebase from 'firebase';
var config = {
...
};
firebase.initializeApp(config);
I have tried updating to the latest versions of all libraries. The only one I can't really update at the moment due to lots of migrations is GatsbyJS 2.0
Here is my package.json:
"dependencies": {
"@material-ui/core": "^3.2.2",
"@material-ui/icons": "^3.0.1",
"aws-sdk": "^2.345.0",
"cookieconsent": "^3.0.6",
"firebase": "^5.5.7",
"firebaseui": "^3.4.1",
"fsevents": "^1.2.4",
"gatsby": "^1.9.279",
"gatsby-link": "^1.6.46",
"gatsby-plugin-google-analytics": "^1.0.20",
"gatsby-plugin-i18n": "^0.4.1",
"gatsby-plugin-react-helmet": "^1.0.8",
"gatsby-plugin-react-next": "^1.0.11",
"material-ui-chip-input": "^1.0.0-beta.8",
"paypal-checkout": "^4.0.228",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-firebaseui": "^3.1.2",
"react-intl": "^2.4.0",
"reactstrap": "^6.5.0"
},
For some time project was running fine on some older versions of libraries.
...ANSWER
Answered 2018-Nov-03 at 14:38Long story short, Firebase now includes Fetch polyfill that references self
internally, so it doesn't work with gatsby.
Workaround would be to not load firebase using null-loader, but then you can't reference anything firebase-related during your build time, including properties for authentication providers
Issue seems to be limited to Gatsby v1 with Firebase 5.0.+
Rolling back to older version of Firebase is not possible due to an issue with pre-gyp and node version conflicts.
Posted a bug on: https://github.com/gatsbyjs/gatsby/issues/9681
QUESTION
In my case I am trying to create SEO ready content from Contentful pulled into Gatsby. I've tried to integrate the community i18n plugin with the Contentful example here: https://github.com/mccrodp/gatsby-contentful-i18n/pull/1
I've seen the more general questions relating to i18n in Gatsby and the blog post Building i18n with Gatsby which does not use the community plugin, nor provide a linked repository example. However, I cannot understand how to integrate the community plugin gatsby-starter-default-i18n with dynamic content via a CMS, such as the Using Contentful Example.
I guess it boils down to how to manage layouts dynamically together with templates and the gatsby.node.js
file, rather than the static example we have at the moment that does not use templates. An issue was raised here previously, on i18n plugin repo working with gatsby-source-contentful, but it seems inactive at the moment.
Any help greatly appreciated. I don't need to use the community plugin, just a SEO ready solution for indexed, dynamic i18n content paths. Thanks!
...ANSWER
Answered 2018-Feb-20 at 09:16This involves using node_locale
in createPages
fn in gatsby.node.js
to set the locale based paths. Then you can use this in combination with dynamic sources. For example, I have created starter repos for markdownRemark and Contentful:
QUESTION
I am developping a static blog using Gatsby.
It use gatsby-transformer-remark
and gatsby-plugin-i18n
plugin to support multiple languages.
I am managing the articles in the GitHub repository as follows.
- /blog
- /2017
- /06
- 01-foo.en.md
- 01-foo.zh.md
- /09
- 01-bar.en.md
- 01-bar.zh.md
- /06
- /2017
And links between the articles is necessary. Therefore, in order not to become a dead link when looking at GitHub with a Web browser, we set up a link as follows.
...ANSWER
Answered 2018-Feb-19 at 10:36You can create a plugin for gatsby-transformer-remark
plugins/gatsby-remark-relative-linker/index.js
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-plugin-i18n
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page