Skip to content

Instantly share code, notes, and snippets.

@theodesp
Last active April 6, 2020 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theodesp/7434354e15784ad1bf8fbcdb24582441 to your computer and use it in GitHub Desktop.
Save theodesp/7434354e15784ad1bf8fbcdb24582441 to your computer and use it in GitHub Desktop.
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