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
- Their own choice. A language picked with
/allay language <code>or in the/allaywindow comes first. It stays inplayers.jsonuntil they pickauto. ip: the country of the player's IP address.locales.countriesmaps 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.client: the language set in the player's game, when a file inlang/matches it.- 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.
- Edit the line in each language you use.
- 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
- Copy
lang/en.ymlto, say,lang/it.yml. - Translate it.
- Add
it: [ IT, SM, VA ]tolocales.countries. - Run
/allay reload.
Next: Integrations