From 8ffc8e9323723b8b96b6a0495ac9be8d0d701f9b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 6 Aug 2016 16:34:16 +0200 Subject: [PATCH] Fix translation strings for recipe alternations --- locale/de.txt | 5 ++--- locale/template.txt | 5 ++--- register.lua | 9 ++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/locale/de.txt b/locale/de.txt index 56bdda2..346ff40 100644 --- a/locale/de.txt +++ b/locale/de.txt @@ -46,11 +46,10 @@ cooking = Kochen alloy cooking = Legierung Kochen Copy to craft grid: = Ins Fertigungsraster kopieren: All = Alles -Recipe %s of %s = Rezept %s von %s Alternate = Alternative Crafting Grid = Fertigungsraster -Recipe = Rezept -Usage = Verwendung +Recipe %d of %d = Rezept %d von %d +Usage %d of %d = Verwendung %d von %d No recipes = Keine Rezepte No usages = Keine Verwendungen Result = Ergebnis diff --git a/locale/template.txt b/locale/template.txt index 77b8907..4f1eb2e 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -48,11 +48,10 @@ cooking = alloy cooking = Copy to craft grid: = All = -Recipe %s of %s = Alternate = Crafting Grid = -Recipe = -Usage = +Recipe %d of %d = +Usage %d of %d = No recipes = No usages = Result = diff --git a/register.lua b/register.lua index fdc39a3..8cc9123 100644 --- a/register.lua +++ b/register.lua @@ -195,8 +195,8 @@ local function stack_image_button(x, y, w, h, buttonname_prefix, item) end local recipe_text = { - recipe = "Recipe", - usage = "Usage", + recipe = "Recipe %d of %d", + usage = "Usage %d of %d", } local no_recipe_text = { recipe = "No recipes", @@ -310,9 +310,8 @@ unified_inventory.register_page("craftguide", { end if alternates and alternates > 1 then - formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"..S(recipe_text[dir]).." " - ..tostring(alternate).." of " - ..tostring(alternates).."]" + formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";" + ..string.format(S(recipe_text[dir]), alternate, alternates).."]" .."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. S("Alternate") .. "]" end return {formspec = formspec}