Addresses part of #16, (#71)

Integrate gatsby-plugin-intl for internationalization
Replaces static text with `intl.formatMessage` call and Links with `gatsby-plugin-intl` equivalent
Note: `npm install` now requires `--force` to install the latest `gatsby-plugin-intl` as it doesn't explicitly support gatsby3.0
This commit is contained in:
Nat Hillard 2021-05-21 13:05:27 -04:00 committed by GitHub
commit a579cb13bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 2475 additions and 1290 deletions

View file

@ -1,17 +1,21 @@
import React from 'react';
import { GovBanner, Header, Title, PrimaryNav } from '@trussworks/react-uswds';
import { Link } from "gatsby";
import { useIntl, Link } from "gatsby-plugin-intl"
const headerLinks = [
<Link to="/">Home</Link>
];
const J40Header = () => {
const intl = useIntl()
const title = intl.formatMessage({ id: "71L0pp", defaultMessage:"Justice40", description:"Title of the project" });
return (
<>
<GovBanner />
<Header>
<Title>Justice 40</Title>
<Title>
{title}
</Title>
<PrimaryNav items={headerLinks}/>
</Header>
</>