Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 986 Bytes

7. Language Files.md

File metadata and controls

21 lines (14 loc) · 986 Bytes

Language Files

Language files provide translations for translation keys used in palette and list files. While it's technically possible to use a direct string like "My Custom Palette" instead of a translation key, it is not recommended. Translation keys should follow a format like text.itemswapper.palette.colored_items.glass.

File Location

Language files are placed inside the same resource pack under assets/itemswapper/lang. The file en_us.json is used for English translations.

File Format

The language file is a simple JSON object with key-value pairs, where the key is the translation key and the value is the translated text. For example:

{
  "text.itemswapper.palette.colored_items.glass": "Colored Glass",
  "text.itemswapper.palette.colored_items.concrete": "Colored Concrete",
  "text.itemswapper.list.tools.pickaxes": "Pickaxes"
}

In this example, three translation keys are defined for colored glass, colored concrete, and pickaxes.