Skip to main content

What is i18n?

i18n is Unbound’s localization layer. It loads string tables for the user’s active Discord locale and falls back to en-US. It gives you a Messages proxy and a format function for rendering those strings. Your addon shows text in the user’s language without any locale detection code of your own.

The Messages proxy

Messages is a proxy over the loaded string tables. When you read a key, it checks three places in order:
  1. The active locale.
  2. en-US.
  3. The key itself, so a missing translation shows something readable instead of undefined.

Formatting

Use format for strings with placeholders. It resolves the key through Messages, then fills in your variables using ICU MessageFormat. Plurals, selects, and named slots all work.

Addon localizations

defineLocalizations gives your addon its own Messages/format pair over a string table you provide. It shares the active locale with core, so your strings change language along with Discord. Your keys stay separate from core’s.
Always include an en-US table. Every other locale falls back to it when a key is missing.