Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.18 KB

i18n.md

File metadata and controls

31 lines (22 loc) · 1.18 KB

I18n

There are two kind of resources that are localizable.

  • Text in UI like: Map, About, Support, etc.
  • Some data of facilities: services names.

The application is configured with a list of enabled locales that are displayed to the end user.

The current locale is selected by a query string, cookie, browser accepted languages or default application locale.

Adding new localization

Let's supose we want to add a new fr locale. The following steps should be performed:

  • Create a config/locales/fr.yml with the translated content from config/locales/en.yml
  • Ensure the dataset is enhanced with the fr locale. This means that a name:fr column should be present at data/input/services.csv. Check in importing data for more information.
  • Import the dataset.
  • Enable the fr locale by changing the settings.yml or the SETTINGS__LOCALES__FR=French environment variable.
# file: config/settings.yml
# ...
default_locale: en
locales:
  en: English
  fr: Français

The config/locales/*.yml are translated to javascript thanks to i18n-js gem. So upon deployment a new version of assets will be generated with this resources.