Skip to content

Languages

DynaDev edited this page Aug 12, 2026 · 1 revision

Languages

TownyAlerts uses external YAML language packs stored in:

plugins/TownyAlerts/languages/

Included languages

TownyAlerts ships with:

en-us.yml
es-cl.yml
  • en-us.yml — American English
  • es-cl.yml — Latin American Spanish

The Spanish translation is intended to be understandable across Latin America and does not depend on Chilean slang.

Select a language

In config.yml:

language: "en"

The default is English.

Built-in aliases:

en -> en-us
es -> es-cl

Case-insensitive locale names

These are equivalent:

en
EN
En
eN

These are also equivalent:

es-cl
ES-CL
Es-Cl
es-CL

Underscores are normalized to hyphens:

es_CL -> es-cl
en_US -> en-us

Exact and generic resolution

If you configure:

language: "fr-ca"

TownyAlerts first looks for:

fr-ca.yml

If that file does not exist but fr.yml exists, it can fall back to the base language.

If no matching language exists, TownyAlerts falls back to:

en-us.yml

Missing translation keys

en-us.yml is the base language.

If a custom language file is missing a key, only that key falls back to English. The rest of the selected translation continues to work.

This makes it possible to use incomplete community language packs safely.

Create a custom language

Copy an existing file from:

plugins/TownyAlerts/languages/

and rename it.

Examples:

fr.yml
fr-ca.yml
es-mx.yml
en-uk.yml
de.yml
pt-br.yml

Then translate the values while preserving the YAML keys.

Example:

new-day:
  title: "Towny daily collection completed"
  town-upkeep: "Town upkeep"
  nation-upkeep: "Nation upkeep"

A French translation might become:

new-day:
  title: "Collecte quotidienne de Towny terminée"
  town-upkeep: "Entretien des villes"
  nation-upkeep: "Entretien des nations"

Do not change keys

Change:

title: "..."

Do not change:

new-day:

or:

title:

unless the plugin version specifically documents a schema change.

Reload translations

After adding or editing a language file:

/townyalerts reload

Security

Language files are treated as data only.

TownyAlerts does not execute:

  • Commands from language YAML
  • Scripts
  • Expressions
  • Includes
  • Arbitrary code

Language path traversal and unsafe symlink escapes are rejected.

Clone this wiki locally