Updates intl file with latest copy (#795)

* Extract 404 page copy to intl

* Move all copy to data copy folder and add tests

- Add test:intl-extraction script
- Fix certain defaultMessages not appearing
- update snapshot
This commit is contained in:
Vim 2021-10-14 13:49:16 -07:00 committed by GitHub
commit d1511287b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 199 additions and 140 deletions

View file

@ -1,6 +1,5 @@
import React from 'react';
import {Button, Grid} from '@trussworks/react-uswds';
import {useIntl} from 'gatsby-plugin-intl';
import * as styles from './downloadPacket.module.scss';
import * as METHODOLOGY_COPY from '../../data/copy/methodology';
@ -9,29 +8,29 @@ import * as METHODOLOGY_COPY from '../../data/copy/methodology';
import downloadIcon from '/node_modules/uswds/dist/img/usa-icons/file_download.svg';
const DownloadPacket = () => {
const intl = useIntl();
return (
<Grid>
<div className={styles.downloadBoxContainer}>
<div className={styles.downloadBox}>
<div className={styles.downloadBoxTextBox}>
<div className={styles.downloadBoxTitle}>
{intl.formatMessage(METHODOLOGY_COPY.DOWNLOAD_PACKAGE.TITLE)}
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.TITLE}
</div>
<div className={styles.downloadBoxText}>
{intl.formatMessage(METHODOLOGY_COPY.DOWNLOAD_PACKAGE.DESCRIPTION)}
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.DESCRIPTION}
{' '}
<span>
{intl.formatMessage(METHODOLOGY_COPY.DOWNLOAD_PACKAGE.LAST_UPDATED)}
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.LAST_UPDATED}
</span>
</div>
<div className={styles.downloadBoxButtonContainer}>
<a data-cy={'download-link'} href={METHODOLOGY_COPY.DOWNLOAD_ZIP_URL}>
<Button className={styles.downloadBoxButton} type="button">
<div><img src={downloadIcon} alt={'download icon for download package'}/> </div>
<div>
<img src={downloadIcon} alt={'download icon for download package'}/>
</div>
<div className={styles.downloadPacketText}>
{intl.formatMessage(METHODOLOGY_COPY.DOWNLOAD_PACKAGE.BUTTON_TEXT)}
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.BUTTON_TEXT}
</div>
</Button>
</a>

View file

@ -1,7 +1,9 @@
import {useIntl} from 'gatsby-plugin-intl';
import React, {MouseEventHandler} from 'react';
import {_useMapControl as useMapControl} from 'react-map-gl';
import * as styles from './territoryFocusControl.module.scss';
import * as EXPLORE_COPY from '../data/copy/explore';
interface ITerritoryFocusControl {
onClickTerritoryFocusButton: MouseEventHandler<HTMLButtonElement>;
@ -17,68 +19,20 @@ const TerritoryFocusControl = ({onClickTerritoryFocusButton}: ITerritoryFocusCon
const territories = [
{
short: intl.formatMessage(
{
id: 'map.territoryFocus.lower48.short',
defaultMessage: '48',
description: 'The abbreviated name indicating the bounds of the Lower 48 states',
},
),
long: intl.formatMessage(
{
id: 'map.territoryFocus.lower48.long',
defaultMessage: 'Lower 48',
description: 'The longer name indicating the bounds of the Lower 48 states',
},
),
short: intl.formatMessage(EXPLORE_COPY.MAP.LOWER48_SHORT),
long: intl.formatMessage(EXPLORE_COPY.MAP.LOWER48_LONG),
},
{
short: intl.formatMessage(
{
id: 'map.territoryFocus.alaska.short',
defaultMessage: 'AK',
description: 'The abbreviated indicating the bounds of Alaska',
},
),
long: intl.formatMessage(
{
id: 'map.territoryFocus.alaska.long',
defaultMessage: 'Alaska',
description: 'The full name indicating the bounds of Alaska',
},
),
short: intl.formatMessage(EXPLORE_COPY.MAP.ALASKA_SHORT),
long: intl.formatMessage(EXPLORE_COPY.MAP.ALASKA_LONG),
},
{
short: intl.formatMessage(
{
id: 'map.territoryFocus.hawaii.short',
defaultMessage: 'HI',
description: 'The abbreviated name indicating the bounds of Hawaii',
},
),
long: intl.formatMessage(
{
id: 'map.territoryFocus.hawaii.long',
defaultMessage: 'Hawaii',
description: 'The longer name indicating the bounds of Hawaii',
},
),
short: intl.formatMessage(EXPLORE_COPY.MAP.HAWAII_SHORT),
long: intl.formatMessage(EXPLORE_COPY.MAP.HAWAII_LONG),
},
{
short: intl.formatMessage(
{
id: 'map.territoryFocus.puerto_rico.short',
defaultMessage: 'PR',
description: 'The abbreviated name indicating the bounds of Puerto Rico',
},
),
long: intl.formatMessage(
{
id: 'map.territoryFocus.puerto_rico.long',
defaultMessage: 'Puerto Rico',
description: 'The full name indicating the bounds of Puerto Rico',
},
),
short: intl.formatMessage(EXPLORE_COPY.MAP.PR_SHORT),
long: intl.formatMessage(EXPLORE_COPY.MAP.PR_LONG),
},
];
// the offset for this array should map the territories variable