Skip to content

Per Player Locale

Leo edited this page Jan 26, 2024 · 3 revisions

The used locale is by default the players client locale.

If you want to change this behaviour, use MessageTranslator#setUseClientLocale(false)

If this behaviour is disabled, the fallback locale will be used. By default, it is 'en'. Change it with MessageTranslator#setDefaultLocale(Locale.WHATEVER)

If a supplied locale is not included in the Messages dictionary, it will try to find the next best locale. When a player chooses to play with locale de-AU and your plugin does not support the Austrian version of German, it will check if your plugin supports German ('de') next. Only if German is also not supported it will return 'en'.

This same pattern also applies to variants. Minecraft does not support variants, which is why you probably won't come across.