Skip to content

Commit

Permalink
fix translation
Browse files Browse the repository at this point in the history
  • Loading branch information
goumo committed Jan 14, 2025
1 parent 7e7398f commit d7806d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/main/java/com/teammoeg/frostedheart/content/tips/Tip.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ public Builder fromJson(JsonObject json) {
if (json.has("id")) {
String s = json.get("id").getAsString();
if (s.isBlank()) {
error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.no_id").component());
error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.no_id").component());
id = "exception";
return this;
}
id = s;
} else {
error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.no_id").component());
error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.no_id").component());
id = "exception";
return this;
}
Expand All @@ -403,7 +403,7 @@ public Builder fromJson(JsonObject json) {
}
}
if (this.contents.isEmpty()) {
error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.empty").component());
error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.empty").component());
return this;
}

Expand All @@ -414,7 +414,7 @@ public Builder fromJson(JsonObject json) {
if (image != null) {
image(image);
} else {
error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.invalid_image", location).component());
error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.invalid_image", location).component());
return this;
}
}
Expand Down Expand Up @@ -464,18 +464,18 @@ private void imageSize(ResourceLocation location) {
}
} catch (IOException e) {
LOGGER.error("Invalid texture resource location {}", location, e);
error(ErrorType.LOAD, e, Lang.tips("error.invalid_image").component());
error(ErrorType.LOAD, e, Lang.tips("error.load.invalid_image").component());
}
}
this.image = null;
error(ErrorType.LOAD, Lang.tips("error.invalid_image").component());
error(ErrorType.LOAD, Lang.tips("error.load.invalid_image").component());
}

private int getColorOrElse(JsonObject json, String name, int defColor) {
try {
return Integer.parseUnsignedInt(json.get(name).getAsString(), 16);
} catch (NumberFormatException e) {
line(Lang.tips("error.invalid_digit", name).component());
line(Lang.tips("error.load.invalid_digit", name).component());
return defColor;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Tip getTip(String id) {
if (tip != null) {
return tip;
}
return Tip.builder(id).error(Tip.ErrorType.OTHER, Lang.str(id), Lang.tips("error.tip_not_exists").component()).build();
return Tip.builder(id).error(Tip.ErrorType.OTHER, Lang.str(id), Lang.tips("error.load.tip_not_exists").component()).build();
}

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ public void loadFromFile() {
}

private void displayException(Tip.ErrorType type, String id, Exception e) {
Tip exception = Tip.builder("exception").error(type, e, Lang.str(id)).build();
Tip exception = Tip.builder("exception").error(type, e, Lang.str("ID: " + id)).build();
display.force(exception);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private class RenderContext {

void update(Tip tip) {
BGColor = FHColorHelper.setAlpha(tip.getBackgroundColor(), (isGuiOpened() ? 0.8F : 0.5F));
fontColor = tip.getFontColor();
fontColor = FHColorHelper.setAlpha(tip.getFontColor(), 1.0F);

// 跟随视角晃动
Minecraft MC = ClientUtils.mc();
Expand Down

0 comments on commit d7806d6

Please sign in to comment.