Skip to content
Allay

WikiAllay plugin

Languages

Each player reads Allay in their own language. English, Russian, Spanish, Portuguese, and German come bundled. Allay itself answers in the language of the question.

#How a player gets their language

  1. Their own choice. A language picked with /allay language <code> or in the /allay window comes first. It stays in players.json until they pick auto.
  2. ip: the country of the player's IP address. locales.countries maps languages to country codes: Russia, Belarus, and Kazakhstan get Russian; Spain and Latin America get Spanish; Brazil and Portugal get Portuguese; Germany, Austria, and Switzerland get German.
  3. client: the language set in the player's game, when a file in lang/ matches it.
  4. The default: locales.default, English out of the box. The console reads it too.

locales.sources sets the order of steps 2 and 3, or drops one. /allay locale <player> shows an operator which step decided.

#The country database

The lookup needs no account and sends no address anywhere.

  • On the first start, the plugin downloads DB-IP's free country database (about 4 MB) into plugins/Allay/geoip/.
  • It refreshes it every 30 days (geoip.refresh_days).
  • Players who connect through a proxy or a relay show up with its address, so they get the relay's country.

#Change a text

Everything a player reads lives in plugins/Allay/lang/<language>.yml: status verbs, tool lines, buttons, windows, errors.

  1. Edit the line in each language you use.
  2. Run /allay reload.

A key missing from a file comes from the default language, then from English. An empty string turns a message off. Texts take {name} placeholders and {papi:…} tags, see Integrations.

#Add a language

  1. Copy lang/en.yml to, say, lang/it.yml.
  2. Translate it.
  3. Add it: [ IT, SM, VA ] to locales.countries.
  4. Run /allay reload.

Next: Integrations