Skip to content

Localization

You can use standard localization tools for custom objects. To do this, create (or use an existing one) the data/locale/ folder.

You can create different localizations by creating simple .toml files:

data/locale/ru.toml
[Abilki]
abilka1 = 'This ability deals {c=green} {Fireball.damage} {/c} damage!'
data/locale/en.toml
[Abilki]
abilka1 = 'This ability deals {c=green} {Fireball.damage} {/c} damage!'

To insert, use the following construct in .ini files:

{l=CATEGORY.FIELD}

For example:

data/abilities/test.ini
[aBMN]
_parent = "Agyb"
-- Tooltip - Normal - Extended
Ubertip = "{l=Abilki.abilka1}"

Now look at your project.json; it has a language field. It stores the name of the file with your localization, without the .toml. By default, it's en. So, you can name your file anus.toml and use it without any problem. This is very convenient if you have to make, for example, 18+ and censored versions of a map, which seem to have the same language, but are written differently.

Important!

If you don't have the required locale, don't worry! The descriptions will remain as you originally set them, so all fields in the format {l=CATEGORY.FIELD} will also be displayed in the game.

Localization Generation

kuniwar supports auto-generating a localization file based on your objects:

$ kw localegen # Generates localization based on files from map/table/
$ kw localegen -c # Generates localization based on files from data/

$ kw localegen -i
or # Automatically inserts localized fields instead of text
$ kw localegen -ci

$ kw localegen -j # Generates a vJASS file with localization so you can use localization in triggers. Doesn't work with other keys