Skip to content

Language File Format

Kalobi edited this page Sep 11, 2022 · 6 revisions

Lönn uses a custom file format for its language files, which convert between internal and human-readable names and text. The file ending is .lang and the default language file is en_gb.lang. Any Lönn plugin exposing text to the user should create such a file in the lang subdirectory.

Each line is a separate entry. Empty lines and lines beginning with a # are ignored. Lines are parsed as key-value pairs, with the key being any text in front of the first = sign encountered, and the value being any text after that sign.

# Bird Path
triggers.birdPathTrigger.placements.name.bird_path=Bird Path

# Complete Area (Everest)
triggers.everest/completeAreaTrigger.placements.name.complete_area=Complete Area

Entries always follow a certain pattern of keywords, separated by dots, that Lönn uses to look up the entry. For entity and trigger plugins, the first part should be entities or triggers, respectively. Following that comes the full internal name of the entity or trigger. After that, there are a number of entries available:

  • placements.name can be added for each specified placement. It is followed by the placement name defined in the plugin. The value of this entry is the text that will show up in the placement list. Setting this is required for the placement to appear in a human-readable way.
  • placements.description can be added for each specified placement. It is followed by the placement name defined in the plugin. The value of this entry is the text that will show up in a tooltip when you hover over the placement in the placement list.
  • attributes.name can be added for each data attribute of the entity or trigger. The value of this entry is the text that will be displayed in the entity's or trigger's properties window. If this entry isn't present for a certain attribute, a best guess will be made to make the attribute name human-readable.
  • attributes.description can be added for each data attribute of the entity or trigger. The value of this entry is the text that will show up in a tooltip when you hover over the attribute name in the entity's or trigger's properties window.
# Switch Gate
entities.switchGate.placements.name.block=Switch Gate (Stone)
entities.switchGate.placements.name.mirror=Switch Gate (Mirror)
entities.switchGate.placements.name.temple=Switch Gate (Temple)
entities.switchGate.placements.name.stars=Switch Gate (Moon)
entities.switchGate.attributes.description.persistent=Will stay open once activated, even if the player dies.
entities.switchGate.attributes.description.sprite=Changes the visual appearance of the switch gate.

If you write your own tool, scene, window, or form, you may use custom entry formats specific to your needs.

To make your mod name appear in the names of your placements, you have to set your mod name.

# makes [Test Mod] appear after every placement from TestMod
mods.TestMod.name=Test Mod