diff --git a/assets/mods/basegame/locales/en/dnt.json b/assets/mods/basegame/locales/en/dnt.json new file mode 100644 index 000000000..d59635a00 --- /dev/null +++ b/assets/mods/basegame/locales/en/dnt.json @@ -0,0 +1,3 @@ +{ + "NULSTR": "" +} \ No newline at end of file diff --git a/assets/mods/basegame/locales/en/items.json b/assets/mods/basegame/locales/en/items.json index 7b44871e3..7d2ce5110 100644 --- a/assets/mods/basegame/locales/en/items.json +++ b/assets/mods/basegame/locales/en/items.json @@ -1,10 +1,9 @@ { "ITEM_ALLOYING_FURNACE": "Alloying Furnace", "ITEM_BRICK_SINGULAR": "Brick", /* always singular */ - "ITEM_BUCKET_IRON": "Iron Bucket", - "ITEM_BUCKET_IRON_WITH": "Iron Bucket with %1$s", - "ITEM_BUCKET_WOODEN": "Wooden Bucket", - "ITEM_BUCKET_WOODEN_WITH": "Wooden Bucket with %1$s", + "ITEM_BUCKET_IRON": "Iron Bucket %1$s", + "ITEM_BUCKET_WOODEN": "Wooden Bucket %1$s", + "ITEM_BUCKET_TEMPLATE": "with %1$s", "ITEM_CALENDAR": "Calendar", "ITEM_CHARCOAL": "Charcoal", "ITEM_CHERRY_BOMB": "Bomb", diff --git a/assets/mods/basegame/locales/koKR/items.json b/assets/mods/basegame/locales/koKR/items.json index b790d70cd..0cf512dd4 100644 --- a/assets/mods/basegame/locales/koKR/items.json +++ b/assets/mods/basegame/locales/koKR/items.json @@ -1,10 +1,9 @@ { "ITEM_ALLOYING_FURNACE": "합금 화로", "ITEM_BRICK_SINGULAR": "벽돌", /* always singular */ - "ITEM_BUCKET_IRON": "철 양동이", - "ITEM_BUCKET_IRON_WITH": "%1$s 담은 철 양동이", - "ITEM_BUCKET_WOODEN": "나무 양동이", - "ITEM_BUCKET_WOODEN_WITH": "%1$s 담은 나무 양동이", + "ITEM_BUCKET_IRON": "%1$s 철 양동이", + "ITEM_BUCKET_WOODEN": "%1$s 나무 양동이", + "ITEM_BUCKET_TEMPLATE": "%1$s 담은", "ITEM_CALENDAR": "달력", "ITEM_CHARCOAL": "목탄", "ITEM_CHERRY_BOMB": "폭탄", diff --git a/src/net/torvald/terrarum/langpack/Lang.kt b/src/net/torvald/terrarum/langpack/Lang.kt index e1bb8ce03..c49b0e8ec 100644 --- a/src/net/torvald/terrarum/langpack/Lang.kt +++ b/src/net/torvald/terrarum/langpack/Lang.kt @@ -92,7 +92,7 @@ object Lang { */ //println(json.entrySet()) JsonFetcher.forEachSiblings(json) { key, value -> - langpack.put("${key}_$lang", value.asString()) + langpack.put("${key}_$lang", value.asString().trim()) } } @@ -119,7 +119,7 @@ object Lang { JsonFetcher.forEachSiblings(json.get("resources").get("data")) { _, entry -> langpack.put( "${entry.getString("n")}_$lang", - entry.getString("s") + entry.getString("s").trim() ) } @@ -154,7 +154,7 @@ object Lang { sb.append(getstr(args[0])) args.subList(1, args.size).forEach { - val oldstr = sb.toString() + val oldstr = sb.toString().trim() sb.clear() formatter.format(getstr(it), oldstr) } @@ -162,9 +162,9 @@ object Lang { if (decodeCache[App.GAME_LOCALE] == null) { decodeCache[App.GAME_LOCALE] = HashMap() } - decodeCache[App.GAME_LOCALE]!!["$key+$capitalise"] = sb.toString() + decodeCache[App.GAME_LOCALE]!!["$key+$capitalise"] = sb.toString().trim() - return sb.toString() + return sb.toString().trim() } } @@ -175,9 +175,9 @@ object Lang { arguments.forEachIndexed { index, it0 -> val it = if (capitalise) it0.toString().capitalize() else it0.toString() - raw = raw.replace("{${index}}", it) + raw = raw.replace("{${index}}", it.trim()) } - return raw + return raw.trim() } /** @@ -200,7 +200,7 @@ object Lang { capCache[locale] = HashMap() if (!capCache[locale]!!.containsKey(key)) { - capCache[locale]!![key] = TitlecaseConverter(ret, locale) + capCache[locale]!![key] = TitlecaseConverter(ret, locale).trim() } return capCache[locale]!![key]!! @@ -251,7 +251,7 @@ object Lang { ret = ret.replace(matched0, resolved) } - return ret + return ret.trim() } private fun String.getEndTag() = this.split("_").last() diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt index e3d71d6ac..a3e9162c3 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt @@ -39,9 +39,9 @@ open class ItemFluidStoragePrototype(originalID: ItemID, sheetX: Int, sheetY: In @Transient private val fluid = if (sheetX == 0) null else "fluid@$module:$sheetX" override var originalName = if (fluid != null) - "${FluidCodex[fluid].nameKey}>>=${keyInLang}_WITH" + "${FluidCodex[fluid].nameKey}>>=ITEM_BUCKET_TEMPLATE>>=$keyInLang" else - keyInLang + "NULSTR>>=$keyInLang" init { itemImage = CommonResourcePool.getAsItemSheet(sheetName).get(sheetX,sheetY)