j40-cejst-2/client/src/intl
Vim b1adc1f69f
Add beta site banner (#802)
* Add new BetaBanner and remove legacy Alerts

- add BetaBanner component and test
- update AboutCard test
- remove AlertWrapper component, copy and tests
- remove AlertWrapper from all pages
- add BetaBanner copy and intl
- update logo and color
- add styles using USWDS tokens to globals.scss

* Add Beta pill to header

- refactor Header to use Grid and USWDS
- refactor global.scss to use Grid and USWDS
- updates snapshots

* Move styles from global to modules

- move BetaBanner styles from global to modules
- move J40Header to a folder component and module styles
- add J40Header unit test
- add a design-system.scss file that allows USWDS styles in modules
- updates snapshots

* Update en.json file

* Trigger Build

* Add initial Spanish content

- add README for translation team
- add createSpanishJson script
- add initial version of es.json
- add a spanish string variable to test translation

* Add retry and timeout config to stalled test

* Remove redundant test cases for AboutCard

- update snapshot

* Update BetaBanner description
2021-10-21 14:56:32 -07:00
..
createSpanishJson.js Add beta site banner (#802) 2021-10-21 14:56:32 -07:00
en.json Add beta site banner (#802) 2021-10-21 14:56:32 -07:00
es.json Add beta site banner (#802) 2021-10-21 14:56:32 -07:00
README.md Add beta site banner (#802) 2021-10-21 14:56:32 -07:00
testIntlExtraction.js Updates intl file with latest copy (#795) 2021-10-14 13:49:16 -07:00

Translating content to Spanish

Keys without curly brackets

Navigate to the es.json file. This JSON file is grouped into pairs of keys. Namely an english key and regular key. Below we can see the first two keys of the es.json file.

{
	"about.page.sub.header.1.text.1_english" : "On January 27, 2021, President Biden directed the Council on Environmental Quality (CEQ) to create a climate and economic justice screening tool. The purpose of the tool is to help Federal agencies identify disadvantaged communities and provide socioeconomic, environmental, and climate information and data to inform decisions that may affect these communities. The tool identifies disadvantaged communities as communities of focus through publicly available, nationally consistent, high-quality data.",
	"about.page.sub.header.1.text.1" : "El 27 de enero de 2021, President Biden directed the Council on Environmental Quality (CEQ) to create a climate and economic justice screening tool. The purpose of the tool is to help Federal agencies identify disadvantaged communities and provide socioeconomic, environmental, and climate information and data to inform decisions that may affect these communities. The tool identifies disadvantaged communities as communities of focus through publicly available, nationally consistent, high-quality data.",
}

The first key is the english key suffixed with _english. The second key has no suffix and is meant to hold the Spanish translation. These translations are WYSIWYG.

Keys with curly brackets

There are some keys with curly brackets, for example, line 176 of es.json:

{
	"download.draft.ptag.1_english" : "{downloadDraft} of communities of focus and datasets used. Last updated: {dateUpdated}.",
	"download.draft.ptag.1" : "",
}

In this case, this first step is find out what the English sentence is:

image info

The reason the {downloadDraft} and {dateUpdated} are in curly brackets is because something special happens with that text. In the former it's a link in the latter it's a variable that being used in multiple places.

Let's assume that this sentence translates to Spanish as

Descargue la lista preliminar de comunidades de interés y conjuntos de datos utilizados. Última actualización: 01/10/21.

And let's say we want Descargue la lista preliminar to be a link. Then, we would place the following as the translated content:

{
	"download.draft.ptag.1_english" : "{downloadDraft} of communities of focus and datasets used. Last updated: {dateUpdated}.",
	"download.draft.ptag.1" : "`{downloadDraftEs} de comunidades de interés y conjuntos de datos utilizados. Última actualización: {dateUpdatedEs}.`",
}

Where downloadDraftEs = Descargue la lista preliminar and dateUpdatedEs= 01/10/21

TBD: How should these curly bracket variables be communicated to the dev team?