Skip to content

Commit 217eec8

Browse files
committed
add missing files
1 parent 1c27e01 commit 217eec8

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

example/gatsby-config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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: {

example/src/pages/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// i18next-extract-mark-ns-start index
2+
13
import React from 'react';
24
import {Link, Trans, useTranslation} from 'gatsby-plugin-react-i18next';
3-
import {Link as GatsbyLink} from 'gatsby';
5+
import {graphql, Link as GatsbyLink} from 'gatsby';
46
import Layout from '../components/layout';
57
import Image from '../components/image';
68
import SEO from '../components/seo';
@@ -37,3 +39,17 @@ const IndexPage = () => {
3739
};
3840

3941
export 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+
`;

0 commit comments

Comments
 (0)