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
.
Language files are placed inside the same resource pack under assets/itemswapper/lang
. The file en_us.json
is used for English translations.
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.