Skip to main content
Table of contents

Publishing

Add support for a new translation in Whitehall

Useful links: - List of ISO 639-1 codes - Rails Translation Manager - Internationalisation guide

1. Update GOV.UK Content Schemas

Example PR

In GOV.UK Content Schemas:

  1. Edit formats/shared/definitions/locale.jsonnet to include the new locale
  2. Run rake to generate all the schemas

2. Update Content Store

Example PR

In Content Store:

  • Add the locale key to config/application.rb

3. Update Publishing API

Example PR

In Publishing API:

  • Add the locale key to config/application.rb

4. Update Government Frontend

Example PR

In Government Frontend:

  1. Add the new locale to config/application.rb and config/locales/en.yml
  2. Run rake translation:regenerate to regenerate all translations from the EN locale
  3. Run rake translation:import[locale,path] to import a specific locale CSV to YAML within the app. You can also use rake translation:import:all[directory] to import all locales but there’s no timeline for how frequently this is done, so you can expect many translation values to be missing in non EN locales.
  4. In config/locales/<new_locale>.yml add the language translation under the language_names key

5. Update Whitehall

Example PR

In Whitehall:

  1. Add the new locale to lib/whitehall.rb and config/locales/en.yml
  2. Run rake translation:regenerate to regenerate all translations from the EN locale
  3. Run rake translation:import[locale,path] to import a specific locale CSV to YAML within the app. You can also use rake translation:import:all[directory] to import all locales but there’s no timeline for how frequently this is done, so you can expect many translation values to be missing in non EN locales.
  4. In config/locales/<new_locale>.yml add the language translation under the language_names key
This page was last reviewed on 20 June 2019. It needs to be reviewed again on 20 December 2019 by the page owner #govuk-2ndline .
This page was set to be reviewed before 20 December 2019 by the page owner #govuk-2ndline. This might mean the content is out of date.