Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
add tier translations
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Aug 31, 2022
1 parent a2c3e5b commit 912a28c
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 143 deletions.
2 changes: 1 addition & 1 deletion java/squeek/wthitharvestability/TooltipHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static void tooltipEvent(ItemTooltipEvent event) {
Item item = event.getItemStack().getItem();
if (item instanceof DiggerItem && enableHarvestTooltip) {
String harvestName = StringHelper.getHarvestLevelName(((DiggerItem) item).getTier());
event.getToolTip().add(new TranslatableComponent("wailaharvestability.harvestlevel").append(" " + harvestName));
event.getToolTip().add(new TranslatableComponent("waila.h12y.harvestlevel").append(" " + harvestName));
}
}

Expand Down
14 changes: 7 additions & 7 deletions java/squeek/wthitharvestability/WailaHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void getHarvestability(List<Component> stringList, Player player, BlockSt
}

if (BlockHelper.isAdventureModeAndBlockIsUnbreakable(player, pos) || BlockHelper.isBlockUnbreakable(player.level, pos, state)) {
Component unbreakableString = new TextComponent(ColorHelper.getBooleanColor(false)).append(config.getString(HARVESTABLE_FALSE_STRING)).append(" ").append(!minimalLayout ? new TranslatableComponent("wailaharvestability.harvestable").withStyle(ChatFormatting.RESET) : new TextComponent(""));
Component unbreakableString = new TextComponent(ColorHelper.getBooleanColor(false)).append(config.getString(HARVESTABLE_FALSE_STRING)).append(" ").append(!minimalLayout ? new TranslatableComponent("waila.h12y.harvestable").withStyle(ChatFormatting.RESET) : new TextComponent(""));
stringList.add(unbreakableString);
return;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ public void getHarvestability(List<Component> stringList, Player player, BlockSt
if (hideWhileHarvestable && isCurrentlyHarvestable)
return;

String currentlyHarvestable = showCurrentlyHarvestable ? ColorHelper.getBooleanColor(isCurrentlyHarvestable) + config.getString(isCurrentlyHarvestable ? HARVESTABLE_TRUE_STRING : HARVESTABLE_FALSE_STRING) + " " + (!minimalLayout ? ChatFormatting.RESET + I18n.get("wailaharvestability.currentlyharvestable") : "") : "";
String currentlyHarvestable = showCurrentlyHarvestable ? ColorHelper.getBooleanColor(isCurrentlyHarvestable) + config.getString(isCurrentlyHarvestable ? HARVESTABLE_TRUE_STRING : HARVESTABLE_FALSE_STRING) + " " + (!minimalLayout ? ChatFormatting.RESET + I18n.get("waila.h12y.currentlyharvestable") : "") : "";

if (!currentlyHarvestable.isEmpty() || !shearability.isEmpty()) {
String separator = (!shearability.isEmpty() ? " " : "");
Expand All @@ -141,12 +141,12 @@ public void getHarvestability(List<Component> stringList, Player player, BlockSt
if (harvestTier != null && showEffectiveTool) {
String effectiveToolClass = effectiveTool.toolClass();
String effectiveToolString;
if (I18n.exists("wailaharvestability.toolclass." + effectiveToolClass)) {
effectiveToolString = I18n.get("wailaharvestability.toolclass." + effectiveToolClass);
if (I18n.exists("waila.h12y.toolclass." + effectiveToolClass)) {
effectiveToolString = I18n.get("waila.h12y.toolclass." + effectiveToolClass);
} else {
effectiveToolString = effectiveToolClass.substring(0, 1).toUpperCase() + effectiveToolClass.substring(1);
}
stringList.add(new TranslatableComponent(!minimalLayout ? "wailaharvestability.effectivetool" : "").append(" ").append(ColorHelper.getBooleanColor(isEffective && (!isHoldingTinkersTool || canHarvest), isHoldingTinkersTool && isEffective && !canHarvest) + effectiveToolString));
stringList.add(new TranslatableComponent(!minimalLayout ? "waila.h12y.effectivetool" : "").append(" ").append(ColorHelper.getBooleanColor(isEffective && (!isHoldingTinkersTool || canHarvest), isHoldingTinkersTool && isEffective && !canHarvest) + effectiveToolString));
}
if (harvestTier != null && (showHarvestLevel || showHarvestLevelNum)) {
String harvestLevelString = "";
Expand All @@ -157,11 +157,11 @@ public void getHarvestability(List<Component> stringList, Player player, BlockSt
showHarvestLevelNum = showHarvestLevelNum && (!showHarvestLevel || !harvestLevelName.equals(harvestLevelNum));

if (showHarvestLevel)
harvestLevelString = harvestLevelName + (showHarvestLevelNum ? "(" + harvestLevelNum + ")" : "");
harvestLevelString = harvestLevelName + (showHarvestLevelNum ? " (" + harvestLevelNum + ")" : "");
else if (showHarvestLevelNum)
harvestLevelString = harvestLevelNum;

stringList.add(new TranslatableComponent(!minimalLayout ? "wailaharvestability.harvestlevel" : "").append(" ").append(ColorHelper.getBooleanColor(isAboveMinHarvestLevel && canHarvest) + harvestLevelString));
stringList.add(new TranslatableComponent(!minimalLayout ? "waila.h12y.harvestlevel" : "").append(" ").append(ColorHelper.getBooleanColor(isAboveMinHarvestLevel && canHarvest) + harvestLevelString));
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion java/squeek/wthitharvestability/helpers/StringHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import java.util.List;
import java.util.function.Function;
import net.minecraft.ChatFormatting;
import net.minecraft.Util;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.item.Tier;
import net.minecraftforge.common.TierSortingRegistry;

public class StringHelper {

Expand All @@ -19,7 +21,7 @@ public static String getHarvestLevelName(Tier tier) {
if (name != null) return name;
}

String unlocalized = "wailaharvestability.harvestlevel." + (tier.getLevel() + 1);
String unlocalized = Util.makeDescriptionId("waila.h12y.tier", TierSortingRegistry.getName(tier));

if (I18n.exists(unlocalized))
return I18n.get(unlocalized);
Expand Down
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/cs_cz.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Krumpáč",
"wailaharvestability.toolclass.shovel": "Lopata",
"wailaharvestability.toolclass.axe": "Sekera",
"wailaharvestability.toolclass.chisel": "Dláto",
"wailaharvestability.toolclass.scoop": "Síťka",
"wailaharvestability.toolclass.crowbar": "Páčidlo",
"wailaharvestability.toolclass.sword": "Meč",
"waila.h12y.toolclass.pickaxe": "Krumpáč",
"waila.h12y.toolclass.shovel": "Lopata",
"waila.h12y.toolclass.axe": "Sekera",
"waila.h12y.toolclass.chisel": "Dláto",
"waila.h12y.toolclass.scoop": "Síťka",
"waila.h12y.toolclass.crowbar": "Páčidlo",
"waila.h12y.toolclass.sword": "Meč",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Efektivní nástroj :",
"wailaharvestability.harvestlevel": "Úroveň získatelnosti :",
"wailaharvestability.currentlyharvestable": "Momentálně získatelné",
"wailaharvestability.harvestable": "Získatelné"
"waila.h12y.effectivetool": "Efektivní nástroj :",
"waila.h12y.harvestlevel": "Úroveň získatelnosti :",
"waila.h12y.currentlyharvestable": "Momentálně získatelné",
"waila.h12y.harvestable": "Získatelné"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Spitzhacke",
"wailaharvestability.toolclass.shovel": "Schaufel",
"wailaharvestability.toolclass.axe": "Axt",
"wailaharvestability.toolclass.chisel": "Meißel",
"wailaharvestability.toolclass.scoop": "Kescher",
"wailaharvestability.toolclass.crowbar": "Brecheisen",
"wailaharvestability.toolclass.sword": "Schwert",
"waila.h12y.toolclass.pickaxe": "Spitzhacke",
"waila.h12y.toolclass.shovel": "Schaufel",
"waila.h12y.toolclass.axe": "Axt",
"waila.h12y.toolclass.chisel": "Meißel",
"waila.h12y.toolclass.scoop": "Kescher",
"waila.h12y.toolclass.crowbar": "Brecheisen",
"waila.h12y.toolclass.sword": "Schwert",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Effektives Werkzeug :",
"wailaharvestability.harvestlevel": "Abbau-Level :",
"wailaharvestability.currentlyharvestable": "Aktuell abbaubar",
"wailaharvestability.harvestable": "Abbaubar"
"waila.h12y.effectivetool": "Effektives Werkzeug :",
"waila.h12y.harvestlevel": "Abbau-Level :",
"waila.h12y.currentlyharvestable": "Aktuell abbaubar",
"waila.h12y.harvestable": "Abbaubar"
}
34 changes: 21 additions & 13 deletions resources/assets/wailaharvestability/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Pickaxe",
"wailaharvestability.toolclass.shovel": "Shovel",
"wailaharvestability.toolclass.axe": "Axe",
"wailaharvestability.toolclass.chisel": "Chisel",
"wailaharvestability.toolclass.scoop": "Scoop",
"wailaharvestability.toolclass.crowbar": "Crowbar",
"wailaharvestability.toolclass.sword": "Sword",
"wailaharvestability.toolclass.hoe": "Hoe",
"waila.h12y.toolclass.pickaxe": "Pickaxe",
"waila.h12y.toolclass.shovel": "Shovel",
"waila.h12y.toolclass.axe": "Axe",
"waila.h12y.toolclass.chisel": "Chisel",
"waila.h12y.toolclass.scoop": "Scoop",
"waila.h12y.toolclass.crowbar": "Crowbar",
"waila.h12y.toolclass.sword": "Sword",
"waila.h12y.toolclass.hoe": "Hoe",

"_comment": "tier",
"waila.h12y.tier.minecraft.wood": "Wood",
"waila.h12y.tier.minecraft.gold": "Gold",
"waila.h12y.tier.minecraft.stone": "Stone",
"waila.h12y.tier.minecraft.iron": "Iron",
"waila.h12y.tier.minecraft.diamond": "Diamond",
"waila.h12y.tier.minecraft.netherite": "Netherite",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Effective Tool:",
"wailaharvestability.harvestlevel": "Harvest Level:",
"wailaharvestability.currentlyharvestable": "Currently Harvestable",
"wailaharvestability.harvestable": "Harvestable",
"waila.h12y.effectivetool": "Effective Tool:",
"waila.h12y.harvestlevel": "Harvest Level:",
"waila.h12y.currentlyharvestable": "Currently Harvestable",
"waila.h12y.harvestable": "Harvestable",

"_comment": "options",
"config.waila.plugin_harvestability" : "Harvestability",
Expand All @@ -26,7 +34,7 @@
"config.waila.plugin_harvestability.level.enabled": "Show Harvest Level",
"config.waila.plugin_harvestability.level.item": "Show Item Harvest Level",
"config.waila.plugin_harvestability.level.sneak": "Sneak Only",
"config.waila.plugin_harvestability.level_num": "Harvest Level",
"config.waila.plugin_harvestability.level_num": "Harvest Level Number",
"config.waila.plugin_harvestability.level_num.enabled": "Show Harvest Level Number",
"config.waila.plugin_harvestability.level_num.sneak": "Sneak Only",
"config.waila.plugin_harvestability.effective_tool": "Effective Tool",
Expand Down
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/es_es.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "Tools",
"wailaharvestability.toolclass.pickaxe": "Pico",
"wailaharvestability.toolclass.shovel": "Pala",
"wailaharvestability.toolclass.axe": "Hacha",
"wailaharvestability.toolclass.chisel": "Cincel",
"wailaharvestability.toolclass.scoop": "Espátula",
"wailaharvestability.toolclass.crowbar": "Palanca",
"wailaharvestability.toolclass.sword": "Espada",
"waila.h12y.toolclass.pickaxe": "Pico",
"waila.h12y.toolclass.shovel": "Pala",
"waila.h12y.toolclass.axe": "Hacha",
"waila.h12y.toolclass.chisel": "Cincel",
"waila.h12y.toolclass.scoop": "Espátula",
"waila.h12y.toolclass.crowbar": "Palanca",
"waila.h12y.toolclass.sword": "Espada",

"_comment": "Tooltips",
"wailaharvestability.effectivetool": "Herramienta más eficaz",
"wailaharvestability.harvestlevel": "Nivel de dureza",
"wailaharvestability.currentlyharvestable": "Disponible para extraer",
"wailaharvestability.harvestable": "Dureza"
"waila.h12y.effectivetool": "Herramienta más eficaz",
"waila.h12y.harvestlevel": "Nivel de dureza",
"waila.h12y.currentlyharvestable": "Disponible para extraer",
"waila.h12y.harvestable": "Dureza"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/fr_fr.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Pioche",
"wailaharvestability.toolclass.shovel": "Pelle",
"wailaharvestability.toolclass.axe": "Hache",
"wailaharvestability.toolclass.chisel": "Burin",
"wailaharvestability.toolclass.scoop": "Epuisette",
"wailaharvestability.toolclass.crowbar": "Pied-de-biche",
"wailaharvestability.toolclass.sword": "Épée",
"waila.h12y.toolclass.pickaxe": "Pioche",
"waila.h12y.toolclass.shovel": "Pelle",
"waila.h12y.toolclass.axe": "Hache",
"waila.h12y.toolclass.chisel": "Burin",
"waila.h12y.toolclass.scoop": "Epuisette",
"waila.h12y.toolclass.crowbar": "Pied-de-biche",
"waila.h12y.toolclass.sword": "Épée",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Outil efficace :",
"wailaharvestability.harvestlevel": "Niveau de récolte :",
"wailaharvestability.currentlyharvestable": "actuellement récoltable",
"wailaharvestability.harvestable": "récoltable"
"waila.h12y.effectivetool": "Outil efficace :",
"waila.h12y.harvestlevel": "Niveau de récolte :",
"waila.h12y.currentlyharvestable": "actuellement récoltable",
"waila.h12y.harvestable": "récoltable"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/it_it.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Piccone",
"wailaharvestability.toolclass.shovel": "Pala",
"wailaharvestability.toolclass.axe": "Ascia",
"wailaharvestability.toolclass.chisel": "Scalpello",
"wailaharvestability.toolclass.scoop": "Retino",
"wailaharvestability.toolclass.crowbar": "Piede di porco",
"wailaharvestability.toolclass.sword": "Spada",
"waila.h12y.toolclass.pickaxe": "Piccone",
"waila.h12y.toolclass.shovel": "Pala",
"waila.h12y.toolclass.axe": "Ascia",
"waila.h12y.toolclass.chisel": "Scalpello",
"waila.h12y.toolclass.scoop": "Retino",
"waila.h12y.toolclass.crowbar": "Piede di porco",
"waila.h12y.toolclass.sword": "Spada",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Attrezzo richiesto :",
"wailaharvestability.harvestlevel": "Livello richiesto :",
"wailaharvestability.currentlyharvestable": "Può essere raccolto",
"wailaharvestability.harvestable": "Può essere raccolto"
"waila.h12y.effectivetool": "Attrezzo richiesto :",
"waila.h12y.harvestlevel": "Livello richiesto :",
"waila.h12y.currentlyharvestable": "Può essere raccolto",
"waila.h12y.harvestable": "Può essere raccolto"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/ja_jp.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "つるはし",
"wailaharvestability.toolclass.shovel": "シャベル",
"wailaharvestability.toolclass.axe": "",
"wailaharvestability.toolclass.chisel": "Chisel",
"wailaharvestability.toolclass.scoop": "虫取り網",
"wailaharvestability.toolclass.crowbar": "バール",
"wailaharvestability.toolclass.sword": "",
"waila.h12y.toolclass.pickaxe": "つるはし",
"waila.h12y.toolclass.shovel": "シャベル",
"waila.h12y.toolclass.axe": "",
"waila.h12y.toolclass.chisel": "Chisel",
"waila.h12y.toolclass.scoop": "虫取り網",
"waila.h12y.toolclass.crowbar": "バール",
"waila.h12y.toolclass.sword": "",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "効率的な道具 :",
"wailaharvestability.harvestlevel": "採掘レベル :",
"wailaharvestability.currentlyharvestable": "現在採掘可能",
"wailaharvestability.harvestable": "採掘可能"
"waila.h12y.effectivetool": "効率的な道具 :",
"waila.h12y.harvestlevel": "採掘レベル :",
"waila.h12y.currentlyharvestable": "現在採掘可能",
"waila.h12y.harvestable": "採掘可能"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/ko_kr.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "곡괭이",
"wailaharvestability.toolclass.shovel": "",
"wailaharvestability.toolclass.axe": "도끼",
"wailaharvestability.toolclass.chisel": "",
"wailaharvestability.toolclass.scoop": "뜰채",
"wailaharvestability.toolclass.crowbar": "크로우 바",
"wailaharvestability.toolclass.sword": "",
"waila.h12y.toolclass.pickaxe": "곡괭이",
"waila.h12y.toolclass.shovel": "",
"waila.h12y.toolclass.axe": "도끼",
"waila.h12y.toolclass.chisel": "",
"waila.h12y.toolclass.scoop": "뜰채",
"waila.h12y.toolclass.crowbar": "크로우 바",
"waila.h12y.toolclass.sword": "",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "사용가능 도구 :",
"wailaharvestability.harvestlevel": "회수 레벨 :",
"wailaharvestability.currentlyharvestable": "회수가능한 아이템",
"wailaharvestability.harvestable": "회수가능"
"waila.h12y.effectivetool": "사용가능 도구 :",
"waila.h12y.harvestlevel": "회수 레벨 :",
"waila.h12y.currentlyharvestable": "회수가능한 아이템",
"waila.h12y.harvestable": "회수가능"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/pt_pt.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Picareta",
"wailaharvestability.toolclass.shovel": "",
"wailaharvestability.toolclass.axe": "Machado",
"wailaharvestability.toolclass.chisel": "Cinzel",
"wailaharvestability.toolclass.scoop": "Rede de Insetos",
"wailaharvestability.toolclass.crowbar": "Pé-de-Cabra",
"wailaharvestability.toolclass.sword": "Espada",
"waila.h12y.toolclass.pickaxe": "Picareta",
"waila.h12y.toolclass.shovel": "",
"waila.h12y.toolclass.axe": "Machado",
"waila.h12y.toolclass.chisel": "Cinzel",
"waila.h12y.toolclass.scoop": "Rede de Insetos",
"waila.h12y.toolclass.crowbar": "Pé-de-Cabra",
"waila.h12y.toolclass.sword": "Espada",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Ferramenta Efetiva :",
"wailaharvestability.harvestlevel": "Nível de Mineração :",
"wailaharvestability.currentlyharvestable": "Atualmente Minerável",
"wailaharvestability.harvestable": "Minerável"
"waila.h12y.effectivetool": "Ferramenta Efetiva :",
"waila.h12y.harvestlevel": "Nível de Mineração :",
"waila.h12y.currentlyharvestable": "Atualmente Minerável",
"waila.h12y.harvestable": "Minerável"
}
22 changes: 11 additions & 11 deletions resources/assets/wailaharvestability/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"_comment": "tools",
"wailaharvestability.toolclass.pickaxe": "Кирка",
"wailaharvestability.toolclass.shovel": "Лопата",
"wailaharvestability.toolclass.axe": "Топор",
"wailaharvestability.toolclass.chisel": "Стамеска",
"wailaharvestability.toolclass.scoop": "Сачок",
"wailaharvestability.toolclass.crowbar": "Монтировка",
"wailaharvestability.toolclass.sword": "Меч",
"waila.h12y.toolclass.pickaxe": "Кирка",
"waila.h12y.toolclass.shovel": "Лопата",
"waila.h12y.toolclass.axe": "Топор",
"waila.h12y.toolclass.chisel": "Стамеска",
"waila.h12y.toolclass.scoop": "Сачок",
"waila.h12y.toolclass.crowbar": "Монтировка",
"waila.h12y.toolclass.sword": "Меч",

"_comment": "tooltips",
"wailaharvestability.effectivetool": "Эффективный инструмент :",
"wailaharvestability.harvestlevel": "Уровень добычи :",
"wailaharvestability.currentlyharvestable": "Можно добыть",
"wailaharvestability.harvestable": "Можно добыть"
"waila.h12y.effectivetool": "Эффективный инструмент :",
"waila.h12y.harvestlevel": "Уровень добычи :",
"waila.h12y.currentlyharvestable": "Можно добыть",
"waila.h12y.harvestable": "Можно добыть"
}
Loading

0 comments on commit 912a28c

Please sign in to comment.