Skip to content

Commit

Permalink
Fix language fallbacks for rules not being available early
Browse files Browse the repository at this point in the history
  • Loading branch information
altrisi authored Jul 7, 2022
1 parent d571d61 commit 5a4ceb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/carpet/api/settings/SettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ public boolean locked() {
*/
public void parseSettingsClass(Class<?> settingsClass)
{
// In the current translation system languages are not loaded this early. Ensure they are loaded
Translations.updateLanguage();
boolean warned = settingsClass == CarpetSettings.class; // don't warn for ourselves

nextRule: for (Field field : settingsClass.getDeclaredFields())
Expand Down Expand Up @@ -212,6 +210,10 @@ public void parseSettingsClass(Class<?> settingsClass)
CarpetRule<?> parsed = ParsedRule.of(field, this);
rules.put(parsed.name(), parsed);
}
// In the current translation system languages are not loaded this early. Ensure they are loaded
// after we've added fallbacks, else early systems such as the rule printer won't function for
// legacy rules given the validator (that triggers adding fallbacks normally) won't have ran
Translations.updateLanguage();
}

/**
Expand Down

0 comments on commit 5a4ceb6

Please sign in to comment.