Skip to content

Translation Files

BoBkiNN edited this page Feb 17, 2026 · 2 revisions

🌍 Translation files

On this page you can found how to use different built-in translation formats.

Default Gson (.json) and Properties (.properties) sources parses data differently,
but most of them are just key-value pairs.
Here is detailed descriptions of this formats:

Properties

Simplest translation source. Each key correspond to one basic translation, so no plurals allowed.
One file correspond to one language.
Builtin implementation is PropertiesSource

Example file en.properties:

item.apple=Apple
command.success=Success!

Json

Json source can contain both simple string-string pair and more complex translation entries.
With this you can:

  • Specify plural translations
  • Attach context overrides

One file correspond to one language.

Example file en.json:

{
  // plain string-string pair
  "hello": "Hello",
  "bye": "Goodbye",
  // complex formats. type field is used to determine type of translation
  "long": { // same as "long": "Long"
    "type": "basic", // basic type
    "text": "Long"
  },
  // plurality support
  "pl": {
    "type": "plural",
    "one": "1",
    "other": "25",
    "few": "3"
  },
  // translation which count context is always 1, so it always returns plural for one count
  "always_1": {
    "type": "plural",
    "one": "1",
    "other": "25",
    "few": "3",
    // we can specify context overrides using "ctx" object
    "ctx": {
      // currently you can override only count
      // override count context. It is used for pluralization.
      "count": 1
    }
  }
}

Clone this wiki locally