Fix modifiers with X/Y not being localized in the toolstation properly

This commit is contained in:
Bernhard Bonigl committed 2015-01-05 11:00:43 +01:00
1 parent 722ba240fa
commit 3dd9ee8591
1 file changed
+4
@@ -158,6 +158,10 @@ public final class ToolStationGuiHelper {
while (tags.hasKey(tooltip + tipNum)) {
String tipName = tags.getString(tooltip + tipNum);
String locString = "modifier.toolstation." + EnumChatFormatting.getTextWithoutFormattingCodes(tipName);
// strip out the '(X of Y)' in some for the localization strings.. sigh
int bracket = locString.indexOf(" (");
if(bracket > 0)
locString = locString.substring(0, bracket);
locString = locString.replace(" ", "");
if(StatCollector.canTranslate(locString))
tipName = tipName.replace(EnumChatFormatting.getTextWithoutFormattingCodes(tipName), StatCollector.translateToLocal(locString));