From 1a486bb38e640a710a8178fabdac24809e9e6266 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Fri, 24 Oct 2014 12:03:50 +0200 Subject: [PATCH] Fix localization not working in ToolForge --- src/main/java/tconstruct/tools/gui/ToolForgeGui.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/tools/gui/ToolForgeGui.java b/src/main/java/tconstruct/tools/gui/ToolForgeGui.java index 8229f140..0891860b 100644 --- a/src/main/java/tconstruct/tools/gui/ToolForgeGui.java +++ b/src/main/java/tconstruct/tools/gui/ToolForgeGui.java @@ -57,7 +57,15 @@ public class ToolForgeGui extends ToolStationGui iconX = b.element.iconsX; iconY = b.element.iconsY; title = "\u00A7n" + b.element.title; - body = b.element.body; + body = StatCollector.translateToLocal(b.element.body); + if(body != null) { + int i; + // for some really weird reason replaceAll doesn't find "\\n", but indexOf does. We have to replace manually. + while((i = body.indexOf("\\n")) >= 0) + { + body = body.substring(0, i) + '\n' + body.substring(i+2); + } + } } @Override