Last active
April 6, 2020 11:01
-
-
Save theodesp/555bd51df4ce9df1838c5b34b9fa4e0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { graphql } from 'gatsby'; | |
import { Translation } from 'react-i18next'; | |
import { Link } from '@wapps/gatsby-plugin-i18next'; | |
import { withI18next } from 'gatsby-plugin-i18next'; | |
import Layout from '../components/layout'; | |
const IndexPage = () => ( | |
<Translation> | |
{t => ( | |
<Layout> | |
<h1>{t('Hi people')}</h1> | |
<p>{t('Welcome to your new Gatsby site.')}</p> | |
<p>{t('Now go build something great.')}</p> | |
<Link to="/page-2/">{t('Go to page 2')}</Link> | |
</Layout> | |
)} | |
</Translation> | |
); | |
export default withI18next()(IndexPage); | |
export const query = graphql` | |
query($lng: String!) { | |
locales: allLocale(filter: { lng: { eq: $lng }, ns: { eq: "messages" } }) { | |
...LocaleFragment | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment