Skip to content

Commit 9768e7f

Browse files
committed
fix: adjust lang path for enum list translations
closes #16
1 parent 1884b53 commit 9768e7f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
- (fix) Config field titles are now left aligned, rather than center aligned (#17)
1+
- (fix) Config field titles are now left aligned, rather than center aligned (#17)
2+
- (fix) Adjust lang path for enum list translations (#16)

common/src/client/java/io/github/jamalam360/jamlib/client/config/gui/entry/EnumConfigEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void onChange() {
4545
}
4646

4747
private Component getComponent() {
48-
String translationKey = ConfigScreen.createTranslationKey(this.configManager.getModId(), this.configManager.getConfigName(), field.getName() + "." + this.getFieldValue().name().toLowerCase());
48+
String translationKey = ConfigScreen.createTranslationKey(this.configManager.getModId(), this.configManager.getConfigName(), field.getBackingField().getName() + "." + this.getFieldValue().name().toLowerCase());
4949

5050
if (I18n.exists(translationKey)) {
5151
return Component.translatable(translationKey);

testmod-common/src/main/resources/assets/testmod/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"config.testmod.first_config.tooltip": "Tooltip for the first config. It goes onto multiple lines as it is quite a long tooltip.",
66
"config.testmod.second_config.tooltip": "Tooltip for the second config",
77
"config.testmod.first_config.testBoolean": "Test boolean (it has quite a long name, so the text should scroll)",
8+
"config.testmod.first_config.listOfEnums.second": "Translated Enum Name",
89
"config.testmod.first_config.testBoolean.tooltip": "Tooltip for the test config boolean",
910
"config.testmod.first_config.testEnum.first": "Translated (First)",
1011
"config.testmod.i_dont_like_4": "4 is NOT allowed"

0 commit comments

Comments
 (0)