Merge pull request #44 from agilesix/cfelix/merge-v2-20241220-2

CEQ-J40 merge v2 code - 20241220-2
This commit is contained in:
Kameron Kerger 2024-12-20 14:41:34 -08:00 committed by GitHub
commit aa88249f37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 198 additions and 100 deletions

View file

@ -37,11 +37,11 @@ GATSBY_FILE_DL_PATH_2_0_SHAPE_FILE_ZIP=downloadable/2.0-shapefile-codebook.zip
GATSBY_FILE_DL_PATH_2_0_INSTRUCT_PDF=downloadable/CEQ-CEJST-Instructions.pdf
GATSBY_FILE_DL_PATH_2_0_INSTRUCT_ES_PDF=downloadable/CEQ-CEJST-Instructions-es.pdf
GATSBY_FILE_DL_PATH_2_0_COMP_CHART_PDF=downloadable/total-comparison-chart.pdf
GATSBY_FILE_DL_PATH_2_0_TSD_PDF=downloadable/2.0-cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_2_0_TSD_PDF=downloadable/cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_2_0_TOOL_COMP_PDF=downloadable/2.0-climate-and-environmental-burden-tool-comparison.pdf
GATSBY_FILE_DL_PATH_2_0_M_23_09_SIGNED_PDF=downloadable/M-23-09_Signed_CEQ_CPO_es.pdf
GATSBY_FILE_DL_PATH_TSD_ES_PDF=downloadable/cejst-technical-support-document-es.pdf
GATSBY_FILE_DL_PATH_TSD_ES_PDF=downloadable/cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_HOW_TO_COMMUNITIES_PDF=downloadable/draft-communities-list.pdf
GATSBY_MAP_TILES_PATH=tiles

View file

@ -32,11 +32,11 @@ GATSBY_FILE_DL_PATH_2_0_SHAPE_FILE_ZIP=downloadable/2.0-shapefile-codebook.zip
GATSBY_FILE_DL_PATH_2_0_INSTRUCT_PDF=downloadable/CEQ-CEJST-Instructions.pdf
GATSBY_FILE_DL_PATH_2_0_INSTRUCT_ES_PDF=downloadable/CEQ-CEJST-Instructions-es.pdf
GATSBY_FILE_DL_PATH_2_0_COMP_CHART_PDF=downloadable/total-comparison-chart.pdf
GATSBY_FILE_DL_PATH_2_0_TSD_PDF=downloadable/2.0-cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_2_0_TSD_PDF=downloadable/cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_2_0_TOOL_COMP_PDF=downloadable/2.0-climate-and-environmental-burden-tool-comparison.pdf
GATSBY_FILE_DL_PATH_2_0_M_23_09_SIGNED_PDF=downloadable/M-23-09_Signed_CEQ_CPO_es.pdf
GATSBY_FILE_DL_PATH_TSD_ES_PDF=downloadable/cejst-technical-support-document-es.pdf
GATSBY_FILE_DL_PATH_TSD_ES_PDF=downloadable/cejst-technical-support-document.pdf
GATSBY_FILE_DL_PATH_HOW_TO_COMMUNITIES_PDF=downloadable/draft-communities-list.pdf
GATSBY_MAP_TILES_PATH=tiles

View file

@ -60,7 +60,7 @@ export const DOWNLOAD_FILES = {
LAST_UPDATED: COMMON_COPY.METH_2_0_RELEASE_DATE,
},
TSD: {
SIZE: 4.4, // MB
SIZE: 79, // KB
URL: getDownloadFileUrl(process.env.GATSBY_FILE_DL_PATH_2_0_TSD_PDF),
LAST_UPDATED: COMMON_COPY.METH_2_0_RELEASE_DATE,
},
@ -210,22 +210,22 @@ export const DOWNLOAD_LINKS = {
/>,
}}
/>,
// <FormattedMessage
// id={'download.page.download.file.4'}
// key={'download.page.download.file.4'}
// defaultMessage={`<link4>Technical support document</link4> (.pdf {tsdFileSize})`}
// description={'Navigate to the download page. This is fourth download file link'}
// values={{
// link4: COMMON_COPY.linkFn(DOWNLOAD_FILES.NARWAL.TSD.URL, false, true),
// link4es: COMMON_COPY.linkFn(DOWNLOAD_FILES.NARWAL.TSD_ES.URL, false, true),
// tsdFileSize: <FormattedNumber
// value={DOWNLOAD_FILES.NARWAL.TSD.SIZE}
// style="unit"
// unit="megabyte"
// unitDisplay="narrow"
// />,
// }}
// />,
<FormattedMessage
id={'download.page.download.file.4'}
key={'download.page.download.file.4'}
defaultMessage={`<link4>Technical support document</link4> (.pdf {tsdFileSize})`}
description={'Navigate to the download page. This is fourth download file link'}
values={{
link4: COMMON_COPY.linkFn(DOWNLOAD_FILES.NARWAL.TSD.URL, false, true),
link4es: COMMON_COPY.linkFn(DOWNLOAD_FILES.NARWAL.TSD_ES.URL, false, true),
tsdFileSize: <FormattedNumber
value={DOWNLOAD_FILES.NARWAL.TSD.SIZE}
style="unit"
unit="kilobyte"
unitDisplay="narrow"
/>,
}}
/>,
<FormattedMessage
id={'download.page.download.file.5'}
key={'download.page.download.file.5'}

View file

@ -1,25 +1,42 @@
/**
* Validates translation coverage between en.json and es.json by checking:
* - Missing/unused translation keys
* - Identical text that may need translation (excluding approved matches)
*/
const enJson = require('./en.json');
const esJson = require('./es.json');
const {identicalKeysEnEs} = require('./identicalKeysEnEs');
const enKeys = Object.keys(enJson);
const esKeys = Object.keys(esJson);
const enKeysNotInEs = enKeys.filter((key) => !esKeys.includes(key));
const esKeysNotInEn = esKeys.filter((key) => !enKeys.includes(key));
const missingKeys = enKeys.filter((key) => !esKeys.includes(key));
const unusedKeys = esKeys.filter((key) => !enKeys.includes(key));
// Check for missing/outdated keys
if (enKeysNotInEs.length > 0 || esKeysNotInEn.length > 0) {
console.log('\nKeys to be added to es.json: ');
console.log(enKeysNotInEs);
console.log('\nKeys to be removed from es.json: ');
console.log(esKeysNotInEn);
if (missingKeys.length > 0 || unusedKeys.length > 0) {
console.log('\nMISSING: These keys need to be added to es.json:');
console.log(missingKeys);
console.log('\nUNUSED: These keys in es.json are not in en.json:');
console.log(unusedKeys);
} else {
console.log('All keys from en.json appear to exist in es.json');
console.log('SUCCESS: All keys match between en.json and es.json');
}
// Check for identical translations
const identicalValues = enKeys.filter((key) => enJson[key].defaultMessage === esJson[key]);
if (identicalValues.length > 0) {
console.log('\nKeys where es.json is the same as en.json: ');
console.log(identicalValues);
const untranslatedValues = enKeys.filter((key) =>
enJson[key].defaultMessage === esJson[key] && !identicalKeysEnEs.includes(key),
);
if (untranslatedValues.length > 0) {
console.log('\nIDENTICAL: These keys have identical text in both languages');
console.log('(If any of these are intentionally identical, add them to identicalKeysEnEs.js):');
console.log(untranslatedValues);
}
// Check for keys in identicalKeysEnEs that no longer exist in either translation file
const nonexistentIdenticalKeys = identicalKeysEnEs.filter(
(key) => !enKeys.includes(key) || !esKeys.includes(key),
);
if (nonexistentIdenticalKeys.length > 0) {
console.log('\nOUTDATED MATCH: These keys in identicalKeysEnEs.js no longer exist in translations:');
console.log(nonexistentIdenticalKeys);
}

View file

@ -239,6 +239,10 @@
"defaultMessage": "<link3>Shapefile</link3> (Codebook included with shapefile {shapeFileSize} unzipped)",
"description": "Navigate to the download page. This is third download file link"
},
"download.page.download.file.4": {
"defaultMessage": "<link4>Technical support document</link4> (.pdf {tsdFileSize})",
"description": "Navigate to the download page. This is fourth download file link"
},
"download.page.download.file.5": {
"defaultMessage": "<link5>Instructions to Federal agencies on using the CEJST</link5> (.pdf {instructions})",
"description": "Navigate to the download page. This is sixth download file link"

View file

@ -0,0 +1,34 @@
/**
* Lists translation keys that are intentionally identical between English and Spanish translations.
* These keys represent content that should remain the same in both languages, such as:
* - URLs and external links
* - Standardized abbreviations
* - Words like "no" that are the same in both languages
*
* This file must be manually updated as needed.
*/
export const identicalKeysEnEs = [
'common.pages.footer.findcontact.link',
'common.pages.footer.whitehouselogoalt',
'common.pages.tsd.url',
'explore.map.page.map.layer.selector.tribal.short',
'explore.map.page.map.territoryFocus.alaska.long',
'explore.map.page.map.territoryFocus.alaska.short',
'explore.map.page.map.territoryFocus.american.samoa.short',
'explore.map.page.map.territoryFocus.commonwealth.nmp.short',
'explore.map.page.map.territoryFocus.guam.long',
'explore.map.page.map.territoryFocus.guam.short',
'explore.map.page.map.territoryFocus.hawaii.short',
'explore.map.page.map.territoryFocus.lower48.short',
'explore.map.page.map.territoryFocus.puerto_rico.long',
'explore.map.page.map.territoryFocus.puerto_rico.short',
'explore.map.page.map.territoryFocus.us.virgin.islands.short',
'explore.map.page.side.panel.exceed.burden.answer.no',
'explore.map.page.side.panel.indicator.diabetes',
'explore.map.page.side.panel.info.para.4',
'explore.map.page.side.panel.not.community.of.focus',
'methodology.page.dataset.indicator.diabetes.title.text',
];
export default identicalKeysEnEs;

View file

@ -570,6 +570,18 @@ exports[`rendering of the DatasetContainer checks if various text fields are vis
/>
(Codebook included with shapefile 356.8MB unzipped)
</p>
<p>
<a
class="usa-link usa-link--external"
data-cy=""
href="//"
rel="noreferrer"
target="_blank"
>
Technical support document
</a>
(.pdf 79kB)
</p>
<p>
<a
class="usa-link usa-link--external"

File diff suppressed because one or more lines are too long