Locales & Translations

Translate your platform's interface into the languages your users speak.

How Locales Work

A locale is one language of your platform's interface: a name, a code, and the text of every label, message, and email your platform shows in that language. Each piece of text is a phrase.

Visitors switch languages from the language menu in your platform's header, and their browser remembers the choice. Locale changes reach your platform in the next version you create and download.

Managing Locales in the Web App

Open your project's Settings, then the Internationalization tab. Locale changes save when you click Save in the locale form, not with the settings page's own Save button.

Add a Locale

  1. Under Add New Locale, open Select Locale.
  2. Pick a language with ready-made phrases, such as Français (fr), or pick Create Custom Locale for any other language. Languages already in your project aren't listed.
  3. For a custom locale, enter a Name such as Spanish and a Code such as es.
  4. Turn on Default Locale to make it the language visitors see first.
  5. Fill in the Locale Strings. An empty field shows the English text it falls back to.
  6. Click Save.

Edit or Delete a Locale

Existing Locales lists each locale's name and code, with a check mark next to the default.

Managing Locales from the CLI

devour sync writes your locales into a locales/ folder next to your config file, one file per language:

my-project/
├── devour.json
└── locales/
    ├── en.json
    └── fr.json

Each file holds the locale's name, its code, whether it's the default, and its phrases:

{
  "name": "Français",
  "code": "fr",
  "isDefault": false,
  "phrases": {
    "login": "Se connecter",
    "register": "Créer un compte",
    "email": "Adresse courriel"
  }
}

Add or Translate a Language

  1. Copy a file, for example locales/en.json to locales/es.json.
  2. Change name and code, translate the phrases, and set isDefault to true if it should be the default.
  3. Apply your config:
devour setup --config devour.json

Before it changes anything, setup prints the locales it will create, update, and delete. A phrase missing from a file keeps its current text. In a new locale, it uses the ready-made phrase for that language, which is English for a custom language.

Remove a Language

Delete its file from locales/ and run devour setup --config devour.json. setup asks you to confirm the deletion. Pass --yes to confirm without a prompt, for example when an agent drives the CLI. The default locale is never deleted this way, and an empty or missing locales/ folder leaves your locales untouched.

Keep Local Edits Across a Sync

setup refuses to run when the project changed on the server since your last devour sync, so a missing file never deletes a locale by accident. To refresh without losing your edits:

devour stash
devour sync
devour stash pop
devour setup --config devour.json

Next Steps