Skip to content

Localization

Lortseam edited this page Sep 3, 2023 · 8 revisions

CompleteConfig will automatically register translation keys for your groups, subgroups and entries. The structure of these keys is as follows:

Element Key
Group config.modid.group
Subgroup config.modid.group.subgroup
Entry config.modid.group.entry

Description

Element Key
Group config.modid.group.description
Entry config.modid.group.entry.description

Use \n for multi-line translations.

Miscellaneous

Type Key Example
Screen title config.modid.title
config.modid.branch.title
"config.mymod.title": "My Mod's Config Screen"
Boolean value config.modid.group.entry.true
config.modid.group.entry.false
"config.mymod.someGroup.someBoolean.true": "Enabled"
"config.mymod.someGroup.someBoolean.false": "Disabled"
Slider value config.modid.group.entry.value "config.mymod.someGroup.someSlider": "Value: %d"

Custom translation keys

If you don't want to use the default translation keys for a specific entry, you can also set custom ones.

Example
@ConfigEntry(nameKey = "myNameKey", descriptionKey = "myDescriptionKey")
@ConfigEntry.BoundedInteger(min = 1, max = 10)
@ConfigEntry.Slider(valueKey = "myValueKey")
private int sampleSetting = 1;

This will lead to the following keys:

Element Key
Name config.modid.myNameKey
Description config.modid.myDescriptionKey
Value config.modid.myValueKey

Clone this wiki locally