summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua17
-rw-r--r--locale/de.txt1
-rw-r--r--locale/template.txt1
3 files changed, 16 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 5df207e..04f6c4e 100644
--- a/init.lua
+++ b/init.lua
@@ -550,11 +550,19 @@ function doc.generate_entry_list(cid, playername)
-- Colorize entries based on viewed status
-- Not viewed: Cyan
local viewedprefix = "#00FFFF"
- if doc.entry_viewed(playername, cid, eid) then
+ local name = edata.name
+ if name == nil or name == "" then
+ name = S("(Nameless entry)")
+ if doc.entry_viewed(playername, cid, eid) then
+ viewedprefix = "#FF4444"
+ else
+ viewedprefix = "#FF0000"
+ end
+ elseif doc.entry_viewed(playername, cid, eid) then
-- Viewed: White
viewedprefix = "#FFFFFF"
end
- entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(edata.name) .. ","
+ entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(name) .. ","
counter = counter + 1
end
end
@@ -706,7 +714,10 @@ function doc.formspec_entry(category_id, entry_id)
local category = doc.data.categories[category_id]
local entry = doc.get_entry(category_id, entry_id)
-
+ local name = entry.name
+ if name == nil or name == "" then
+ name = S("(Nameless entry)")
+ end
formstring = "label[0,0;"..minetest.formspec_escape(string.format(S("Help > %s > %s"), category.def.name, entry.name)).."]"
formstring = formstring .. category.def.build_formspec(entry.data)
formstring = formstring .. doc.formspec_entry_navigation(category_id, entry_id)
diff --git a/locale/de.txt b/locale/de.txt
index 519577f..73d9717 100644
--- a/locale/de.txt
+++ b/locale/de.txt
@@ -31,3 +31,4 @@ This category is empty. = Diese Kategorie ist leer.
This is the Documentation System, Version %s. = Dies ist das Dokumentationssystem, Version %s.
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) = (Namenloser Eintrag)
diff --git a/locale/template.txt b/locale/template.txt
index 38df2cb..15fed74 100644
--- a/locale/template.txt
+++ b/locale/template.txt
@@ -31,3 +31,4 @@ This category is empty. =
This is the Documentation System, Version %s. =
You haven't chosen a category yet. Please choose one in the category list first. =
You haven't chosen an entry yet. Please choose one in the entry list first. =
+(Nameless entry) =