Skip to content

Commit

Permalink
Merge pull request #86 from Tisawesomeness/fix/lang-fail
Browse files Browse the repository at this point in the history
Fix missing keys in en language when updating from old plugin version
  • Loading branch information
Jsinco authored Jan 13, 2025
2 parents 903e281 + 7afe288 commit a17d52c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ public void updateTranslationFiles() {

Lang fallback = loadFromResources(tempHead, Translation.EN);
for (Translation trans : Translation.values()) {
if (trans == Translation.EN) {
continue;
}

String langFilePathStr = "languages/" + trans.getFilename();
Path langFilePath = dataFolder.toPath().resolve(langFilePathStr);

Lang langFromFile = tempHead.createConfig(Lang.class, langFilePath);
Lang langFromResources = loadFromResources(tempHead, trans);

langFromFile.updateMissingValuesFrom(langFromResources);
langFromFile.updateMissingValuesFrom(fallback);
if (trans != Translation.EN) {
langFromFile.updateMissingValuesFrom(fallback);
}
langFromFile.save();
}
}
Expand Down

0 comments on commit a17d52c

Please sign in to comment.