File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ module.exports = {
1616 path : `${ __dirname } /src/images`
1717 }
1818 } ,
19+ {
20+ resolve : `gatsby-source-filesystem` ,
21+ options : {
22+ path : `${ __dirname } /locales` ,
23+ name : `locale`
24+ }
25+ } ,
1926 `gatsby-transformer-sharp` ,
2027 `gatsby-plugin-sharp` ,
2128 {
@@ -31,15 +38,14 @@ module.exports = {
3138 }
3239 } ,
3340 {
34- // including a plugin from outside the plugins folder needs the path to it
3541 resolve : `gatsby-plugin-react-i18next` ,
3642 options : {
3743 languages,
3844 defaultLanguage,
39- path : `${ __dirname } /locales` ,
4045 siteUrl : 'https://kind-lichterman-5edcb4.netlify.app' ,
4146 i18nextOptions : {
42- debug : true ,
47+ defaultNS : 'common' ,
48+ //debug: true,
4349 lowerCaseLng : true ,
4450 saveMissing : false ,
4551 interpolation : {
Original file line number Diff line number Diff line change 1+ // i18next-extract-mark-ns-start index
2+
13import React from 'react' ;
24import { Link , Trans , useTranslation } from 'gatsby-plugin-react-i18next' ;
3- import { Link as GatsbyLink } from 'gatsby' ;
5+ import { graphql , Link as GatsbyLink } from 'gatsby' ;
46import Layout from '../components/layout' ;
57import Image from '../components/image' ;
68import SEO from '../components/seo' ;
@@ -37,3 +39,17 @@ const IndexPage = () => {
3739} ;
3840
3941export default IndexPage ;
42+
43+ export const query = graphql `
44+ query($language: String!) {
45+ locales: allLocale(filter: {ns: {in: ["common", "index"]}, language: {eq: $language}}) {
46+ edges {
47+ node {
48+ ns
49+ data
50+ language
51+ }
52+ }
53+ }
54+ }
55+ ` ;
You can’t perform that action at this time.
0 commit comments