-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Adding a new language to the site
Clinton edited this page Aug 28, 2024
·
6 revisions
You'll also need to collaborate with the language team and our translation vendor to make sure it's ready to receive requests.
-
packages/gatsby-theme-newrelic/src/i18n/translations/{new locale}.json
This file can be generated by having the en version translated into the desired language. It is responsible for much of the text in theme components -
packages/gatsby-theme-newrelic/src/utils/config/i18n.js
You’ll need to add the language to theSUPPORTED_LOCALES
const, as well asLOCALE_CONFIGS
.
If you’d like to update the demo you’ll need to add the new language to the additionalLocales
array in the demo Gatsby-config file
-
gatsby-config.js
Add the new language to the additonalLocales array - Update the theme to the version including the changes outlined in the gatsby-theme-newrelic section
-
src/i18n/translations/{new locale}/translation.json
Translate the English version of this file. It is responsible for docs site component text -
src/i18n/nav/{new locale}.json
This is a large file with translations for the entire nav -
scripts/actions/utils/constants.js
Update the LOCALE_IDS object -
scripts/actions/utils/docs-content-tools/i18n-exclusions.yml
Add the new language and any exclusions. Make sure to update both the excludePath and excludeType
- Update the locales table with the new locale
- This is a table just for locale foreign keys. If we don't include the new locale the others tables will fail to relate. We may streamline this later but at the moment it is manual
- Make sure the sites have an environment variable set to production