Skip to content

Commit

Permalink
fix names/descriptions if translations should be used
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Apr 12, 2024
1 parent a11be51 commit 340b026
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -85,11 +85,11 @@ public String getName() {
}

public Component getNameComponent() {
return (this.name.startsWith("{") && this.name.endsWith("}")) ? Component.translatable(this.name) : Component.literal(this.name);
return (this.name.startsWith("{") && this.name.endsWith("}")) ? Component.translatable(this.name.substring(1, this.name.length() - 1)) : Component.literal(this.name);
}

public Component getDescriptionComponent() {
return (this.desc.startsWith("{") && this.desc.endsWith("}")) ? Component.translatable(this.desc) : Component.literal(this.desc);
return (this.desc.startsWith("{") && this.desc.endsWith("}")) ? Component.translatable(this.desc.substring(1, this.desc.length() - 1)) : Component.literal(this.desc);
}

public TemplateInfo.Offset getOffset() {
Expand Down

0 comments on commit 340b026

Please sign in to comment.