Skip to main content

How to translate SnailyCADv4

In this guide you will learn how to use an existing locale or how to add a new custom locale.

Adding a new custom locale

To add a custom locale, there are a few steps required.

  1. Open the following directory: apps/client/locales
  2. Duplicate the en folder and rename to a correct locale code
  3. Start editing the .json files in the newly duplicated folder.
  4. Once finished, add your locale to i18n.config.mjs:
// apps/client/i18n.config.mjs
export const i18n = {
locales: [, /* the previous locales */ "YOUR_LOCALE_HERE"],
defaultLocale: "YOUR_LOCALE_HERE", // replace this with your locale
};

Using an existing locale as default locale

To use an existing locale, you need to set as default in i18n.config.mjs:

tip

Users can also set their own locale for their CAD account separately.

// apps/client/i18n.config.mjs
export const i18n = {
locales: ["en" /* other locales might be here */],
defaultLocale: "en", // replace en with the locale above to corresponds with your language
};

Restarting the client will now set the default locale to the locale you set.

Was this page helpful?