It's about time we sorted out all these translations

This commit is contained in:
Electroblob77
2020-05-24 23:57:46 +01:00
parent d9f7d94115
commit 3e0dbb9755
12 changed files with 66 additions and 51 deletions
@@ -7,8 +7,6 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public enum Element implements IStringSerializable {
@@ -52,9 +50,8 @@ public enum Element implements IStringSerializable {
}
/** Returns the translated display name of this element, without formatting. */
@SideOnly(Side.CLIENT)
public String getDisplayName(){
return net.minecraft.client.resources.I18n.format("element." + getName());
return Wizardry.proxy.translate("element." + getName());
}
/** Returns the {@link Style} object representing the colour of this element. */
@@ -1,5 +1,6 @@
package electroblob.wizardry.constants;
import electroblob.wizardry.Wizardry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -37,6 +38,6 @@ public enum SpellType {
@SideOnly(Side.CLIENT)
public String getDisplayName(){
return net.minecraft.client.resources.I18n.format("spelltype." + unlocalisedName);
return Wizardry.proxy.translate("spelltype." + unlocalisedName);
}
}
@@ -1,11 +1,10 @@
package electroblob.wizardry.constants;
import electroblob.wizardry.Wizardry;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Random;
@@ -53,9 +52,9 @@ public enum Tier {
throw new IllegalArgumentException("No such tier with unlocalised name: " + name);
}
@SideOnly(Side.CLIENT)
/** Returns the translated display name of this tier, without formatting. */
public String getDisplayName(){
return net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
return Wizardry.proxy.translate("tier." + unlocalisedName);
}
/**
@@ -66,9 +65,9 @@ public enum Tier {
return new TextComponentTranslation("tier." + unlocalisedName);
}
@SideOnly(Side.CLIENT)
/** Returns the translated display name of this tier, with formatting. */
public String getDisplayNameWithFormatting(){
return this.getFormattingCode() + net.minecraft.client.resources.I18n.format("tier." + unlocalisedName);
return Wizardry.proxy.translate("tier." + unlocalisedName, this.colour);
}
/**