Skip to content

Adding a new language to the site

LizBaker edited this page Mar 14, 2022 · 6 revisions

To add a language to the docs site you’ll need to update:

This wiki assumes that smartling is ready to go

🎨 gatsby-theme-newrelic

  1. 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

  2. packages/gatsby-theme-newrelic/src/utils/config/i18n.js
    You’ll need to add the language to the SUPPORTED_LOCALES const, as well as LOCALE_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

📖 docs-website

  1. gatsby-config.js
    Add the new language to the additonalLocales array
  2. Update the theme to the version including the changes outlined in the gatsby-theme-newrelic section
  3. src/i18n/translations/{new locale}/translation.json
    Translate the English version of this file. It is responsible for docs site component text
  4. src/i18n/nav/{new locale}.json
    This is a large file with translations for the entire nav
  5. scripts/actions/utils/constants.js
    Update the LOCALE_IDS object
  6. 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

🐘 postgres

  1. Update the locales table with the new locale

Clone this wiki locally