Last active
April 6, 2020 11:09
-
-
Save theodesp/7434354e15784ad1bf8fbcdb24582441 to your computer and use it in GitHub Desktop.
This file contains 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 withI18nextPhraseApp from '../i18n/with18next'; | |
import Layout from '../components/layout'; | |
const SecondPage = () => ( | |
<Translation> | |
{t => ( | |
<Layout> | |
<h1>{t('Hi from the second page')}</h1> | |
<p>{t('Welcome to page 2')}</p> | |
<Link to="/">{t('Go back to the homepage')}</Link> | |
</Layout> | |
)} | |
</Translation> | |
); | |
export default withI18nextPhraseApp()(SecondPage); | |
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