diff options
-rw-r--r-- | init.lua | 20 | ||||
-rw-r--r-- | locale/de.txt | 16 | ||||
-rw-r--r-- | locale/template.txt | 16 |
3 files changed, 26 insertions, 26 deletions
@@ -3,7 +3,7 @@ local S, F if minetest.get_modpath("intllib") then S = intllib.Getter() else - S = function(s) return s end + S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end end F = function(f) return minetest.formspec_escape(S(f)) end @@ -140,7 +140,7 @@ function doc.mark_entry_as_revealed(playername, category_id, entry_id) doc.data.players[playername].entry_textlist_needs_updating = true if minetest.get_modpath("central_message") ~= nil then local cat = doc.data.categories[category_id] - cmsg.push_message_player(minetest.get_player_by_name(playername), string.format(S("New help entry unlocked: %s > %s"), cat.def.name, entry.name)) + cmsg.push_message_player(minetest.get_player_by_name(playername), S("New help entry unlocked: @1 > @1", cat.def.name, entry.name)) end -- To avoid sound spamming, don't play sound more than once per second local last_sound = doc.data.players[playername].last_reveal_sound @@ -800,7 +800,7 @@ function doc.generate_entry_list(cid, playername) local viewedprefix = "#00FFFF" local name = edata.name if name == nil or name == "" then - name = string.format(S("Nameless entry (%s)"), eid) + name = S("Nameless entry (@1)", eid) if doc.entry_viewed(playername, cid, eid) then viewedprefix = "#FF4444" else @@ -895,7 +895,7 @@ function doc.formspec_category(id, playername) formstring = formstring .. "label[0,0.5;"..F("You haven't chosen a category yet. Please choose one in the category list first.").."]" formstring = formstring .. "button[0,1;3,1;doc_button_goto_main;"..F("Go to category list").."]" else - formstring = "label[0,0;"..minetest.formspec_escape(string.format(S("Help > %s"), doc.data.categories[id].def.name)).."]" + formstring = "label[0,0;"..minetest.formspec_escape(S("Help > @1", doc.data.categories[id].def.name)).."]" local total = doc.get_entry_count(id) if total >= 1 then local revealed = doc.get_revealed_count(playername, id) @@ -906,16 +906,16 @@ function doc.formspec_category(id, playername) formstring = formstring .. "label[0,0.5;"..F("This category has the following entries:").."]" formstring = formstring .. doc.generate_entry_list(id, playername) formstring = formstring .. "button[0,"..(doc.FORMSPEC.HEIGHT-1)..";3,1;doc_button_goto_entry;"..F("Show entry").."]" - formstring = formstring .. "label["..(doc.FORMSPEC.WIDTH-4)..","..(doc.FORMSPEC.HEIGHT-1)..";"..minetest.formspec_escape(string.format(S("Number of entries: %d"), total)).."\n" + formstring = formstring .. "label["..(doc.FORMSPEC.WIDTH-4)..","..(doc.FORMSPEC.HEIGHT-1)..";"..minetest.formspec_escape(S("Number of entries: @1", total)).."\n" local viewed = doc.get_viewed_count(playername, id) local hidden = total - revealed local new = total - viewed - hidden -- TODO/FIXME: Check if number of hidden/viewed entries is always correct if viewed < total then - formstring = formstring .. minetest.formspec_escape(string.format(S("New entries: %d"), new)) + formstring = formstring .. minetest.formspec_escape(S("New entries: @1", new)) if hidden > 0 then formstring = formstring .. "\n" - formstring = formstring .. minetest.formspec_escape(string.format(S("Hidden entries: %d"), hidden)).."]" + formstring = formstring .. minetest.formspec_escape(S("Hidden entries: @1", hidden)).."]" else formstring = formstring .. "]" end @@ -950,7 +950,7 @@ function doc.formspec_entry(category_id, entry_id, playername) formstring = formstring .. "label[0,0.5;"..F("You haven't chosen a category yet. Please choose one in the category list first.").."]" formstring = formstring .. "button[0,1;3,1;doc_button_goto_main;"..F("Go to category list").."]" elseif entry_id == nil then - formstring = "label[0,0;"..minetest.formspec_escape(string.format(S("Help > %s > (No Entry)"), doc.data.categories[category_id].def.name)) .. "]" + formstring = "label[0,0;"..minetest.formspec_escape(S("Help > @1 > (No Entry)", doc.data.categories[category_id].def.name)) .. "]" if doc.get_entry_count(category_id) >= 1 then formstring = formstring .. "label[0,0.5;"..F("You haven't chosen an entry yet. Please choose one in the entry list first.").."]" formstring = formstring .. "button[0,1.5;3,1;doc_button_goto_category;"..F("Go to entry list").."]" @@ -964,9 +964,9 @@ function doc.formspec_entry(category_id, entry_id, playername) local entry = doc.get_entry(category_id, entry_id) local ename = entry.name if ename == nil or ename == "" then - ename = string.format(S("Nameless entry (%s)"), entry_id) + ename = S("Nameless entry (@1)", entry_id) end - formstring = "label[0,0;"..minetest.formspec_escape(string.format(S("Help > %s > %s"), category.def.name, ename)).."]" + formstring = "label[0,0;"..minetest.formspec_escape(S("Help > @1 > @2", category.def.name, ename)).."]" formstring = formstring .. category.def.build_formspec(entry.data, playername) formstring = formstring .. doc.formspec_entry_navigation(category_id, entry_id) end diff --git a/locale/de.txt b/locale/de.txt index 8418f59..f61a7c6 100644 --- a/locale/de.txt +++ b/locale/de.txt @@ -14,14 +14,14 @@ Error: No help available. = Fehler: Keine Hilfe verfügbar. Go to category list = Zur Kategorienliste Go to entry list = Zur Entragsliste Help > (No Category) = Hilfe > (Keine Kategorie) -Help > %s = Hilfe > %s -Help > %s > %s = Hilfe > %s > %s -Help > %s > (No Entry) = Hilfe > %s > (Kein Eintrag) -Hidden entries: %d = Verborgene Einträge: %d -New entries: %d = Neue Einträge: %d -New help entry unlocked: %s > %s = Neuen Hilfseinträg freigeschaltet: %s > %s +Help > @1 = Hilfe > @1 +Help > @1 > @2 = Hilfe > @1 > @2 +Help > @1 > (No Entry) = Hilfe > @1 > (Kein Eintrag) +Hidden entries: @1 = Verborgene Einträge: @1 +New entries: @1 = Neue Einträge: @1 +New help entry unlocked: @1 > @2 = Neuen Hilfseinträg freigeschaltet: @1 > @2 No categories have been registered, but they are required to provide help.\nThe Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again. = Es wurden keine Kategorien registriert, aber sie werden benötigt, um die Hilfe anbieten zu können.\nDas Dokumentationssystem [doc] bringt von sich aus keine eigenen Hilfsinhalte mit, es benötigt zusätzliche Mods, um sie hinzuzufügen. Bitte stellen Sie sicher, dass solche Mods für diese Welt aktiviert sind und versuchen Sie es erneut. -Number of entries: %d = Anzahl der Einträge: %d +Number of entries: @1 = Anzahl der Einträge: @1 OK = OK Open a window providing help entries about Minetest and more = Ein Fenster mit Hilfseinträgen über Minetest und mehr öffnen Please select a category you wish to learn more about: = Bitte wählen Sie eine Kategorie, über die Sie mehr erfahren möchten, aus: @@ -37,5 +37,5 @@ This category is empty. = Diese Kategorie ist leer. This is the help. = Dies ist die Hilfe. You haven't chosen a category yet. Please choose one in the category list first. = Sie haben noch keine Kategorie gewählt. Bitte wählen Sie zuerst eine Kategorie in der Kategorienliste aus. You haven't chosen an entry yet. Please choose one in the entry list first. = Sie haben noch keinen Eintrag gewählt. Bitte wählen Sie zuerst einen Eintrag in der Eintragsliste aus. -Nameless entry (%s) = Namenloser Eintrag (%s) +Nameless entry (@1) = Namenloser Eintrag (@1) Collection of help texts = Sammlung von Hilfetexten diff --git a/locale/template.txt b/locale/template.txt index a72ea2b..2fc7421 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -13,16 +13,16 @@ Error: Access denied. = Error: No help available. = Go to category list = Go to entry list = -Help > %s = -Help > %s > %s = -Help > %s > (No Entry) = +Help > @1 = +Help > @1 > @2 = +Help > @1 > (No Entry) = Help > (No Category) = -Hidden entries: %d = -Nameless entry (%s) = -New entries: %d = -New help entry unlocked: %s > %s = +Hidden entries: @1 = +Nameless entry (@1) = +New entries: @1 = +New help entry unlocked: @1 > @2 = No categories have been registered, but they are required to provide help.\nThe Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again. = -Number of entries: %d = +Number of entries: @1 = OK = Open a window providing help entries about Minetest and more = Please select a category you wish to learn more about: = |