Skip to content

Commit

Permalink
Fixed name translation (Resolves #14)
Browse files Browse the repository at this point in the history
  • Loading branch information
T145 committed May 21, 2020
1 parent 170baf0 commit 51d0a95
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import net.minecraft.block.BlockMobSpawner;
import net.minecraft.block.BlockTNT;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -30,6 +29,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
Expand Down Expand Up @@ -323,7 +323,7 @@ public String getName() {
if (hasCustomName()) {
return getCustomNameTag();
} else {
return I18n.format(String.format("item.metaltransport:metal_minecart.%s.name", getCartType().getName()));
return I18n.translateToLocal(String.format("item.metaltransport:metal_minecart.%s.name", getCartType().getName()));
}
}

Expand All @@ -332,7 +332,7 @@ public ITextComponent getDisplayName() {
TextComponentString name = (TextComponentString) super.getDisplayName();

if (this.hasDisplayBlock()) {
return name.appendText(I18n.format("%s", "com.metaltransport.info.with")).appendText(this.getDisplayStack().getDisplayName());
return name.appendText(I18n.translateToLocalFormatted("%s", "com.metaltransport.info.with")).appendText(this.getDisplayStack().getDisplayName());
}

return name;
Expand Down

0 comments on commit 51d0a95

Please sign in to comment.