Rituals Localization (#24)

* Rituals Localization

* Fix breaking change

* Update zh_CN.lang

Co-authored-by: Kiwi <42833050+Kiwi233@users.noreply.github.com>

Co-authored-by: Kiwi <42833050+Kiwi233@users.noreply.github.com>
This commit is contained in:
MuXiu1997andKiwi authored and GitHub committed 2022-04-28 17:30:16 +02:00
1 parent 209fed5f81
commit f2cba48db8
4 files changed
+108 -2

No files matched your search

@@ -8,6 +8,7 @@ import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import WayofTime.alchemicalWizardry.api.event.RitualRunEvent;
@@ -21,6 +22,7 @@ public class Rituals
public final int actCost;
public final RitualEffect effect;
public final String name;
public String localizedName = "";
public final MRSRenderer customRenderer;
@@ -64,6 +66,7 @@ public class Rituals
ritual.removeRitualFromList();
ritualMap.put(key, ritual);
keyList.add(key);
ritual.setRitualLocalizedName(StatCollector.translateToLocal("ritual." + key + ".name"));
return true;
}
}
@@ -79,6 +82,7 @@ public class Rituals
ritual.removeRitualFromList();
ritualMap.put(key, ritual);
keyList.add(key);
ritual.setRitualLocalizedName(StatCollector.translateToLocal("ritual." + key + ".name"));
return true;
}
}
@@ -291,6 +295,15 @@ public class Rituals
{
return this.name;
}
public void setRitualLocalizedName(String localizedName)
{
this.localizedName = localizedName;
}
public String getRitualLocalizedName()
{
return localizedName.isEmpty() ? this.name : localizedName;
}
public static String getNameOfRitual(String id)
{
@@ -305,6 +318,20 @@ public class Rituals
return "";
}
public static String getLocalizedNameOfRitual(String id)
{
if (ritualMap.containsKey(id))
{
Rituals ritual = ritualMap.get(id);
if (ritual != null)
{
return ritual.getRitualLocalizedName();
}
}
return "";
}
public static String getNextRitualKey(String key)
{
@@ -4,6 +4,7 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.I18n;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -158,7 +159,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
{
return super.getItemStackDisplayName(stack);
}
return "Ritual: " + Rituals.getNameOfRitual(ritualID);
return I18n.format("bm.string.ritualDiviner", Rituals.getLocalizedNameOfRitual(ritualID));
} else
{
return super.getItemStackDisplayName(stack);
@@ -412,7 +413,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
if (world.isRemote)
{
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack)));
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getLocalizedNameOfRitual(this.getCurrentRitual(stack)));
player.addChatComponentMessage(chatmessagecomponent);
}
}
@@ -256,6 +256,7 @@ bm.string.drain=Drain
bm.string.tier=Tier
bm.string.crafting.orb.shaped=Shaped Orb Crafting
bm.string.crafting.orb.shapeless=Shapeless Orb Crafting
bm.string.ritualDiviner=Radius: %s
text.recipe.altar=Blood Altar
text.recipe.altar.tier=Tier: %s
text.recipe.altar.bloodRequired=LP: %s
@@ -265,6 +266,44 @@ nei.recipe.meteor.cost=Cost: %s LP
nei.recipe.meteor.radius=Radius: %s
nei.recipe.meteor.chance=Chance: %s%%
#Rituals
ritual.AW001Water.name=Ritual of the Full Spring
ritual.AW002Lava.name=Serenade of the Nether
ritual.AW003GreenGrove.name=Ritual of the Green Grove
ritual.AW004Interdiction.name=Interdiction Ritual
ritual.AW005Containment.name=Ritual of Containment
ritual.AW006Binding.name=Ritual of Binding
ritual.AW007Unbinding.name=Ritual of Unbinding
ritual.AW008HighJump.name=Ritual of the High Jump
ritual.AW009Magnetism.name=Ritual of Magnetism
ritual.AW010Crusher.name=Ritual of the Crusher
ritual.AW011Speed.name=Ritual of Speed
ritual.AW012AnimalGrowth.name=Ritual of the Shepherd
ritual.AW013Suffering.name=Well of Suffering
ritual.AW014Regen.name=Ritual of Regeneration
ritual.AW015FeatheredKnife.name=Ritual of the Feathered Knife
ritual.AW016FeatheredEarth.name=Ritual of the Feathered Earth
ritual.AW017Gaia.name=Ritual of Gaia's Transformation
ritual.AW018Condor.name=Reverence of the Condor
ritual.AW019FallingTower.name=Mark of the Falling Tower
ritual.AW020BalladOfAlchemy.name=Ballad of Alchemy
ritual.AW021Expulsion.name=Aura of Expulsion
ritual.AW022Supression.name=Dome of Supression
ritual.AW023Zephyr.name=Call of the Zephyr
ritual.AW024Harvest.name=Reap of the Harvest Moon
ritual.AW025Conduit.name=Cry of the Eternal Soul
ritual.AW026Ellipsoid.name=Focus of the Ellipsoid
ritual.AW027Evaporation.name=Song of Evaporation
ritual.AW028SpawnWard.name=Ward of Sacrosanctity
ritual.AW029VeilOfEvil.name=Veil of Evil
ritual.AW030FullStomach.name=Requiem of the Satiated Stomach
ritual.AW031Convocation.name=Convocation of the Damned
ritual.AW032Symmetry.name=Symmetry of the Omega
ritual.AW033Stalling.name=Duet of the Fused Souls
ritual.AW034Crafting.name=Rhythm of the Beating Anvil
ritual.AW035PhantomHands.name=Orchestra of the Phantom Hands
ritual.AW036SphereIsland.name=Blood of the New Moon
#Entities
entity.AWWayofTime.EarthElemental.name=Earth Elemental
entity.AWWayofTime.FireElemental.name=Fire Elemental
@@ -256,6 +256,7 @@ bm.string.drain=消耗
bm.string.tier=层数
bm.string.crafting.orb.shaped=特定血宝珠合成
bm.string.crafting.orb.shapeless=不定血宝珠合成
bm.string.ritualDiviner=仪式: %s
text.recipe.altar=血之祭坛
text.recipe.altar.tier=层数: %s
text.recipe.altar.bloodRequired=LP: %s
@@ -265,6 +266,44 @@ nei.recipe.meteor.cost=消耗: %s LP
nei.recipe.meteor.radius=半径: %s
nei.recipe.meteor.chance=几率: %s%%
#Rituals
ritual.AW001Water.name=涌泉仪式
ritual.AW002Lava.name=下界夜曲
ritual.AW003GreenGrove.name=绿丛仪式
ritual.AW004Interdiction.name=禁止仪式
ritual.AW005Containment.name=牵制仪式
ritual.AW006Binding.name=绑定仪式
ritual.AW007Unbinding.name=解绑仪式
ritual.AW008HighJump.name=高跳仪式
ritual.AW009Magnetism.name=磁矿仪式
ritual.AW010Crusher.name=挖掘仪式
ritual.AW011Speed.name=速移仪式
ritual.AW012AnimalGrowth.name=牧养仪式
ritual.AW013Suffering.name=苦难之井
ritual.AW014Regen.name=重生仪式
ritual.AW015FeatheredKnife.name=羽刀仪式
ritual.AW016FeatheredEarth.name=羽地仪式
ritual.AW017Gaia.name=盖亚仪式
ritual.AW018Condor.name=崇敬之鹰
ritual.AW019FallingTower.name=陨星仪式
ritual.AW020BalladOfAlchemy.name=炼金之谣
ritual.AW021Expulsion.name=驱逐氛场
ritual.AW022Supression.name=抑液仪式
ritual.AW023Zephyr.name=和风之唤
ritual.AW024Harvest.name=满月收割
ritual.AW025Conduit.name=永魂之泣
ritual.AW026Ellipsoid.name=幽影屏障
ritual.AW027Evaporation.name=蒸发之曲
ritual.AW028SpawnWard.name=神圣庇佑
ritual.AW029VeilOfEvil.name=罪恶遮纱
ritual.AW030FullStomach.name=盛宴之歌
ritual.AW031Convocation.name=恶魔入侵
ritual.AW032Symmetry.name=欧米伽仪式
ritual.AW033Stalling.name=熔魂合奏
ritual.AW034Crafting.name=工作节律
ritual.AW035PhantomHands.name=幻手乐团
ritual.AW036SphereIsland.name=新月之血
#Entities
entity.AWWayofTime.EarthElemental.name=土之元素精灵
entity.AWWayofTime.FireElemental.name=火之元素精灵