Skip to main content
discord.place supports multiple languages across both the Next.js client and the Discord bot server. Translations are stored as JSON files and wired up through a small amount of configuration.

Currently supported locales

The client (client/locales/) currently ships with these language files:English is the default locale.

Adding a new language

1

Create the locale JSON file

Add a new JSON file to client/locales/ named after the language code, e.g. fr.json for French. Use an existing file like en.json as a reference for all the keys that need to be translated.The JSON structure is a nested object where keys are translation identifiers and values are the translated strings:
client/locales/fr.json
2

Register the locale in config.js

Add the new locale to the availableLocales array in client/config.js:
client/config.js
The dateFnsKey must match the locale key used by the date-fns library.
3

Import the locale file in the language store

Open client/stores/language/index.js and add an import for your new locale file alongside the existing ones:
client/stores/language/index.js
4

Add the locale to localeContents

In the same file (client/stores/language/index.js), add your new locale to the localeContents object inside the t() function:
The client will now serve your new language to users who select it in the language picker.
If you want to change the default locale, set default: true on the desired locale object in client/config.js (and remove it from the current default). You must also update the DEFAULT_LOCALE_CODE environment variable in .github/workflows/validate-locale-files.yml β€” otherwise the locale validation GitHub Actions workflow will report errors on every push.

Locale file structure

Both the client and server use JSON files with a nested key structure. Top-level keys group related strings by feature area. Client locale example (client/locales/en.json):
Server locale example (server/src/locales/en.json):
Some strings support interpolation placeholders using curly braces, e.g. "An error occurred: {errorMessage}".

Contributing translations

If you’d like to contribute a new translation or improve an existing one, see the Contributing Translations guide.