Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/discordplace/discord.place/llms.txt

Use this file to discover all available pages before exploring further.

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:
LanguageCodeFile
Englishenen.json
Turkishtrtr.json
Azerbaijaniazaz.json
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
{
  "home": {
    "title": "Tout ce qui concerne Discord",
    "subtitle": "..."
  }
}
2

Register the locale in config.js

Add the new locale to the availableLocales array in client/config.js:
client/config.js
availableLocales: [
  // ...existing locales
  {
    name: 'French',
    code: 'fr',
    dateFnsKey: 'fr',
    flag: 'πŸ‡«πŸ‡·',
    countryCode: 'fr'
  }
],
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
import en from '@/locales/en.json';
import tr from '@/locales/tr.json';
import az from '@/locales/az.json';
import fr from '@/locales/fr.json'; // add this
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:
const localeContents = {
  en,
  tr,
  az,
  fr, // add this
};
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):
{
  "home": {
    "title": "All things related to Discord",
    "subtitle": "A place for all things that related to Discord..."
  },
  "common": {
    "save": "Save",
    "cancel": "Cancel"
  }
}
Server locale example (server/src/locales/en.json):
{
  "time": {
    "seconds": "seconds",
    "minutes": "minutes",
    "hours": "hours",
    "days": "days"
  },
  "commands": {
    "shared": {
      "errors": {
        "missing_permissions": "You don't have permission to use this command."
      }
    }
  }
}
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.

Build docs developers (and LLMs) love