Cookifed handles many locales by default. Any string that needs translation must use the proper dynamic value.

The source language for locales is English. Whenever writing new code, you should write that translation, but not any other one.

We manage all other translations through our Weblate project. If you wish to give a hand in internationalization, you can chime in there.

In JavaScript

Find the JavaScript locales in app/javascript/app/locales.

We use react-intl under the hood.

When adding a new translation, add it to en.json only.

In Ruby

Find the Ruby locales in config/locales.

We use the Rails i18n API under the hood.

When adding a new translation, add it to the English file that matches the root of the key, if it exists. For example, activerecord keys go into activerecord.en.yml.

Every other key goes into en.yml.

Setting up new locales

To create a new locale, you should:

  • Switch to a new branch.
  • Create a new locale file in config/locales/<LOCALE CODE>.yml.
  • Add one translation (just one. Weblate will handle the others) to the file.
  • Commit the change, and open a Pull Request.

Once merged, weblate will pick up the new locale, and make it translatable.