convert translatable textfiles to gettext complatible po files, including pot template

forced group prefix removed
some cache buildup rewrites
This commit is contained in:
Alexander Weber 2017-04-17 00:51:39 +02:00
parent 1037c5fa17
commit 6c0ad582d8
12 changed files with 875 additions and 321 deletions

View File

@ -8,7 +8,7 @@ smart_inventory.armor_mod = minetest.get_modpath("3d_armor")
smart_inventory.doc_items_mod = minetest.get_modpath("doc_items")
-- load libs
smart_inventory.txt = dofile(modpath.."/txt/classify_txt.lua")
smart_inventory.txt = dofile(modpath.."/libs/simple_po_reader.lua")
smart_inventory.smartfs = dofile(modpath.."/libs/smartfs.lua")
smart_inventory.smartfs_elements = dofile(modpath.."/libs/smartfs-elements.lua")

View File

@ -112,12 +112,12 @@ function crecipes.new(recipe)
local retitems
for groupname in string.gmatch(recipe_item:sub(7), '([^,]+)') do
if not retitems then --first entry
if cache.cgroups["group:"..groupname] then
retitems = table.copy(cache.cgroups["group:"..groupname].items)
if cache.cgroups[groupname] then
retitems = table.copy(cache.cgroups[groupname].items)
else
groupname = groupname:gsub("_", ":")
if cache.cgroups["group:"..groupname] then
retitems = table.copy(cache.cgroups["group:"..groupname].items)
if cache.cgroups[groupname] then
retitems = table.copy(cache.cgroups[groupname].items)
else
minetest.log("[smartfs_inventory] unknown group description in recipe: "..recipe_item.." / "..groupname.." for result "..self.out_item.name)
end
@ -126,8 +126,8 @@ function crecipes.new(recipe)
for itemname, itemdef in pairs(retitems) do
local item_in_group = false
for _, item_group in pairs(cache.citems[itemname].cgroups) do
if item_group.name == "group:"..groupname or
item_group.name == "group:"..groupname:gsub("_", ":")
if item_group.name == groupname or
item_group.name == groupname:gsub("_", ":")
then
item_in_group = true
break
@ -230,43 +230,61 @@ function crecipes.new(recipe)
return self
end
-----------------------------------------------------
-- Add an Item to the cache
-----------------------------------------------------
function cache.add_item(itemdef)
local entry = {
name = itemdef.name,
in_output_recipe = {},
in_craft_recipe = {},
cgroups = {}
}
cache.citems[itemdef.name] = entry
end
-----------------------------------------------------
-- Add a item to cache group
-----------------------------------------------------
function cache.add_to_cache_group(group_name, itemdef, flt, parent, parent_value)
function cache.assign_to_group(group_name, itemdef, flt)
-- check and build filter chain
local abs_group
local parent_ref
if parent then
parent_ref = cache.cgroups[parent]
if parent_ref then
parent_ref.childs[group_name] = parent_value
local parent_stringpos
for rel_group in group_name:gmatch("[^:]+") do
-- get parent relation and absolute path
if abs_group then
parent_ref = cache.cgroups[abs_group]
parent_stringpos = string.len(abs_group)+2
abs_group = abs_group..":"..rel_group
else
abs_group = rel_group
end
-- check if group is new, create it
if not cache.cgroups[abs_group] then
if parent_ref then
parent_ref.childs[abs_group] = string.sub(group_name, parent_stringpos)
end
local group = {
name = abs_group,
items = {},
parent = parent_ref,
childs = {},
}
group.group_desc = flt:get_description(group)
group.keyword = flt:get_keyword(group)
cache.cgroups[abs_group] = group
end
-- set relation
cache.cgroups[abs_group].items[itemdef.name] = itemdef
cache.citems[itemdef.name].cgroups[abs_group] = cache.cgroups[abs_group]
end
if not cache.cgroups[group_name] then
local group = {
name = group_name,
items = {},
parent = parent_ref,
childs = {},
}
group.group_desc = flt:get_description(group)
group.keyword = flt:get_keyword(group)
cache.cgroups[group_name] = group
end
cache.cgroups[group_name].items[itemdef.name] = itemdef
if not cache.citems[itemdef.name] then
local entry = {
name = itemdef.name,
in_output_recipe = {},
in_craft_recipe = {},
cgroups = {}
}
cache.citems[itemdef.name] = entry
end
cache.citems[itemdef.name].cgroups[group_name] = cache.cgroups[group_name]
end
-----------------------------------------------------
@ -312,31 +330,26 @@ local function fill_cache()
-- build groups and items cache
if def.description and def.description ~= "" and
(not def.groups.not_in_creative_inventory or shape_filter:check_item_by_def(_def_)) then
-- extended registred filters
cache.add_item(def)
for _, flt in pairs(filter.registered_filter) do
local filter_result = flt:check_item_by_def(_def_)
if filter_result then
if filter_result == true then
cache.add_to_cache_group(flt.name, def, flt)
cache.assign_to_group(flt.name, def, flt)
else
if type(filter_result) ~= "table" then
filter_result = {[filter_result] = true}
if tonumber(filter_result) ~= nil then
filter_result = {[flt.name..":"..filter_result] = true}
else
filter_result = {[filter_result] = true}
end
end
for key, val in pairs(filter_result) do
local filter_entry = tostring(key)
if val ~= true then
filter_entry = filter_entry..":"..tostring(val)
end
local filtername = flt.name
cache.add_to_cache_group(filtername, def, flt)
local parent = filtername
filter_entry:gsub("[^:]+", function(z)
local parentvalue = string.sub(flt.name..":"..filter_entry, string.len(filtername)+2)
filtername = filtername..":"..z
cache.add_to_cache_group(filtername, def, flt, parent, parentvalue)
parent = filtername
end)
cache.assign_to_group(filter_entry, def, flt)
end
end
end
@ -363,14 +376,14 @@ local function fill_recipe_cache()
table.insert(cache.citems[recipe_obj.out_item.name].in_output_recipe, recipe)
cache.crecipes[recipe] = recipe_obj
if recipe_obj.recipe_type ~= "normal" then
cache.add_to_cache_group("recipetype:"..recipe_obj.recipe_type, recipe_obj.out_item, filter.get("recipetype"))
cache.assign_to_group("recipetype:"..recipe_obj.recipe_type, recipe_obj.out_item, filter.get("recipetype"))
end
for _, entry in pairs(recipe_obj._items) do
for itemname, itemdef in pairs(entry.items) do
if cache.citems[itemname] then -- in case of"not_in_inventory" the item is not in citems
table.insert(cache.citems[itemname].in_craft_recipe, recipe)
end
cache.add_to_cache_group("ingredient:"..itemname, recipe_obj.out_item, filter.get("ingredient"))
cache.assign_to_group("ingredient:"..itemname, recipe_obj.out_item, filter.get("ingredient"))
end
end
end

View File

@ -1,6 +1,5 @@
local txt = smart_inventory.txt
local txt_usage = minetest.setting_get("smart_inventory_friendly_group_names") or true
--------------------------------------------------------------
-- Filter class
--------------------------------------------------------------
@ -18,32 +17,22 @@ function filter_class:check_item_by_def(def)
end
function filter_class:_get_description(group)
local ret_desc
if txt[group.name] then
ret_desc = txt[group.name].label
elseif group.parent and group.parent.childs[group.name] and txt[group.parent.name] then
ret_desc = txt[group.parent.name].label.." "..group.parent.childs[group.name]
else
ret_desc = group.name
end
if txt_usage then
return ret_desc
if txt_usage == true then
if txt[group.name] then
return txt[group.name]
elseif group.parent and group.parent.childs[group.name] and txt[group.parent.name] then
return txt[group.parent.name].." "..group.parent.childs[group.name]
else
return group.name
end
else
return group.name
end
end
filter_class.get_description = filter_class._get_description
function filter_class:_get_keyword(group)
-- parent exists - return the top-level information only
if group.parent and group.parent.childs[group.name] and tonumber(group.parent.childs[group.name]) == nil then
return group.parent.childs[group.name]
end
end
function filter_class:_get_keyword_groupname(group) -- a variant for get_keyword, can be assigned in filter definition
if txt_usage then
if txt_usage == true then
return group.name.." "..group.group_desc
else
return group.name
@ -148,46 +137,48 @@ filter.register_filter({
end
return ret
end,
get_keyword = function(self, group)
local keyword = self:_get_keyword(group)
if txt_usage and keyword and txt[group.name] then
return keyword.." "..group.group_desc
else
return keyword
end
end
})
filter.register_filter({
name = "type",
check_item_by_def = function(self, def)
return def.type
return self.name..":"..def.type
end,
get_keyword = function(self, group)
if group.name ~= self.name then
return group.parent.childs[group.name]
end
end
})
filter.register_filter({
name = "mod",
check_item_by_def = function(self, def)
return def.mod_origin
return self.name..":"..def.mod_origin
end,
get_keyword = function(self, group)
if group.name ~= self.name then
return group.parent.childs[group.name]
end
end
})
filter.register_filter({
name = "transluc",
name = "translucent",
check_item_by_def = function(self, def)
return def.sunlight_propagates
if def.sunlight_propagates ~= 0 then
return def.sunlight_propagates
end
end,
get_keyword = filter_class._get_keyword_groupname
})
filter.register_filter({
name = "light",
check_item_by_def = function(self, def)
if def.light_source and def.light_source ~= 0 then
if def.light_source ~= 0 then
return def.light_source
end
end,
get_keyword = filter_class._get_keyword_groupname
})
filter.register_filter({
@ -199,7 +190,6 @@ filter.register_filter({
return true
end
end,
get_keyword = filter_class._get_keyword_groupname
})
--[[ does it sense to filter them? I cannot define the human readable groups for them
@ -230,7 +220,6 @@ filter.register_filter({
end
end
end,
get_keyword = filter_class._get_keyword_groupname
})
filter.register_filter({
@ -243,7 +232,6 @@ filter.register_filter({
end
end
end,
get_keyword = filter_class._get_keyword_groupname
})
filter.register_filter({
@ -256,7 +244,6 @@ filter.register_filter({
end
end
end,
get_keyword = filter_class._get_keyword_groupname
})
filter.register_filter({
@ -267,13 +254,15 @@ filter.register_filter({
end
local rettab = {}
for k, v in pairs(def.tool_capabilities) do
if type(v) ~= "table" then
rettab[k] = v
if type(v) ~= "table" and v ~= 0 then
rettab["tool:"..k] = v
end
end
if def.tool_capabilities.damage_groups then
for k, v in pairs(def.tool_capabilities.damage_groups) do
rettab["damage:"..k] = v
if v ~= 0 then
rettab["damage:"..k] = v
end
end
end
--[[ disabled, I cannot find right human readable interpretation for this
@ -290,7 +279,7 @@ filter.register_filter({
return rettab
end,
get_keyword = function(self, group)
if group.name == "max_drop_level" or group.name == "full_punch_interval" or group.name == "damage" then
if group.name == "tool" or group.name == "damage" then
return nil
else
return self:_get_keyword(group)
@ -303,13 +292,17 @@ filter.register_filter({
check_item_by_def = function(self, def)
return def.armor_groups
end,
get_keyword = filter_class._get_keyword_groupname
})
-- Group assignment done in cache framework internally
filter.register_filter({
name = "recipetype",
check_item_by_def = function(self, def) end,
get_keyword = function(self, group)
if group.name ~= self.name then
return group.parent.childs[group.name]
end
end
})
-- Group assignment done in cache framework internally
@ -318,20 +311,21 @@ filter.register_filter({
check_item_by_def = function(self, def) end,
get_description = function(self, group)
local itemname = group.name:sub(12)
if txt["ingredient"] and txt["ingredient"].label and
if txt["ingredient"] and
minetest.registered_items[itemname] and minetest.registered_items[itemname].description then
return txt["ingredient"].label .." "..minetest.registered_items[itemname].description
return txt["ingredient"] .." "..minetest.registered_items[itemname].description
else
return group.name
end
end,
get_keyword = function(self, group)
local itemname = group.name:sub(12)
if minetest.registered_items[itemname] then
return minetest.registered_items[itemname].description
if group.name ~= self.name then
local itemname = group.name:sub(12)
if minetest.registered_items[itemname] then
return minetest.registered_items[itemname].description
end
end
end
})
----------------

41
libs/simple_po_reader.lua Normal file
View File

@ -0,0 +1,41 @@
local txt_usage = minetest.setting_get("smart_inventory_friendly_group_names") or true
if txt_usage ~= true then
return {}
end
local modpath = minetest.get_modpath(minetest.get_current_modname()).."/locale"
local LANG = minetest.setting_get("language")
if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
if not (LANG and (LANG ~= "")) then LANG = "en" end
local pofile = modpath.."/groups_"..LANG:sub(1,2)..".po"
local f=io.open(pofile,"r")
--fallback to en
if not f then
pofile = modpath.."/groups_en.po"
f=io.open(pofile,"r")
end
local texttab = {}
local msgid
local msgstr
for line in f:lines() do
if line:sub(1,5) == 'msgid' then -- msgid ""
msgid = line:sub(8, line:len()-1)
elseif line:sub(1,6) == 'msgstr' then -- msgstr ""
msgstr = line:sub(9, line:len()-1)
end
if msgid and msgstr then
if msgid ~= "" and msgstr ~= "" then
texttab[msgid] = msgstr
end
msgid = nil
msgstr = nil
end
end
io.close(f)
return texttab

252
locale/groups_de.po Normal file
View File

@ -0,0 +1,252 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.5\n"
msgid "slab"
msgstr "Platte"
msgid "armor:shield"
msgstr "Schild"
msgid "physics:jump"
msgstr "Sprunghöhe"
msgid "dig_immediate"
msgstr "Schnell abbaubar"
msgid "coal"
msgstr "Kohle"
msgid "flammable"
msgstr "Brennbar"
msgid "disable_jump"
msgstr "Klebrig"
msgid "physics:gravity"
msgstr "Erdanziehung"
msgid "cracky"
msgstr "Knackig"
msgid "level"
msgstr "Wertvoll"
msgid "dig_immediate:3"
msgstr "Sofort abbaubar"
msgid "door"
msgstr "Tür"
msgid "armor:state"
msgstr "Rüstungsstatus"
msgid "tool:full_punch_interval"
msgstr "Verwendungsinterval"
msgid "soil"
msgstr "Erde"
msgid "choppy"
msgstr "Abgehackt"
msgid "armor:heal"
msgstr "Heilen"
msgid "snappy"
msgstr "Schnittig"
msgid "shape"
msgstr "Geformt"
msgid "oddly_breakable_by_hand"
msgstr "Ohne Werkzeug abbaubar"
msgid "wood"
msgstr "Holz"
msgid "attached_node"
msgstr "Verbundbar"
msgid "armor:use"
msgstr "Abnutzung bei Schaden"
msgid "tool:max_drop_level"
msgstr "Max drop Level"
msgid "physics:speed"
msgstr "Geschwindigkeit"
msgid "armor:legs"
msgstr "Beinschutz"
msgid "food"
msgstr "Nahrung"
msgid "damage:choppy"
msgstr "Abgehackt"
msgid "slope"
msgstr "Neigung"
msgid "soil:2"
msgstr "Trockener Ackerboden"
msgid "soil:1"
msgstr "Ackerboden"
msgid "all"
msgstr "Alles"
msgid "armor:fire"
msgstr "Feuerschutz"
msgid "translucent"
msgstr "Lichtdurchläßig"
msgid "leavedecay"
msgstr "Verwelkbar"
msgid "armor:feet"
msgstr "Stiefel"
msgid "sand"
msgstr "Sand"
msgid "damage:snappy"
msgstr "Schnittverletzung"
msgid "damage:fleshy"
msgstr "Fleischverletzung"
msgid "armor"
msgstr "Rüstung"
msgid "stair"
msgstr "Treppe"
msgid "customnode"
msgstr "Dekorativer Block"
msgid "water_bucket"
msgstr "Eimer"
msgid "connect_to_raillike"
msgstr "Schienenartig"
msgid "falling_node"
msgstr "Fallend"
msgid "mod"
msgstr "Mod"
msgid "type:node"
msgstr "Block"
msgid "soil:3"
msgstr "Nasser Ackerboden"
msgid "bouncy"
msgstr "Federnd"
msgid "stone"
msgstr "Stein"
msgid "dye"
msgstr "Farbstoff"
msgid "micro"
msgstr "Mikro"
msgid "other"
msgstr "Weitere"
msgid "armor:torso"
msgstr "Körperschutz"
msgid "wool"
msgstr "Wolle"
msgid "type:tool"
msgstr "Werkzeug"
msgid "vessel"
msgstr "Behälter"
msgid "fleshy"
msgstr "Fleischig"
msgid "light"
msgstr "Lichtquelle"
msgid "panel"
msgstr "Paneel"
msgid "leaves"
msgstr "Laub"
msgid "armor:level"
msgstr "Level der Rüstung"
msgid "recipetype:cooking"
msgstr "Gekocht"
msgid "type:craft"
msgstr "Gegenstand"
msgid "ingredient"
msgstr "Erzeugt aus"
msgid "carpet"
msgstr "Teppich"
msgid "wall"
msgstr "Mauer"
msgid "fence"
msgstr "Zaun"
msgid "stick"
msgstr "Stock"
msgid "armor:head"
msgstr "Kopfschutz"
msgid "flora"
msgstr "Flora"
msgid "tree"
msgstr "Baum"
msgid "explody"
msgstr "Explosiv"
msgid "armor:water"
msgstr "Wasserschutz"
msgid "crumbly"
msgstr "Brüchig"
#~ msgid "radiation"
#~ msgstr "Schutz gegen Radioaktivität"
#~ msgid "tool:damage:choppy"
#~ msgstr "Hack-Schaden"
#~ msgid "transluc"
#~ msgstr "Lichtdurchlässig"
#~ msgid "tool:damage:snappy"
#~ msgstr "Schnitt-Schaden"
#~ msgid "tool:damage:fleshy"
#~ msgstr "Wund-Schaden"

237
locale/groups_en.po Normal file
View File

@ -0,0 +1,237 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"X-Generator: Poedit 1.8.5\n"
msgid "slab"
msgstr "Slab"
msgid "armor:shield"
msgstr "Shield"
msgid "physics:jump"
msgstr "Jump high"
msgid "dig_immediate"
msgstr "Fast diggable"
msgid "coal"
msgstr "Coal"
msgid "flammable"
msgstr "Flammable"
msgid "disable_jump"
msgstr "Sticky"
msgid "physics:gravity"
msgstr "Gravity"
msgid "cracky"
msgstr "Cracky"
msgid "level"
msgstr "Valuable"
msgid "dig_immediate:3"
msgstr "Immediate diggable"
msgid "door"
msgstr "Door"
msgid "armor:state"
msgstr "Armor state"
msgid "tool:full_punch_interval"
msgstr "Punch interval"
msgid "soil"
msgstr "Soil"
msgid "choppy"
msgstr "Choppy"
msgid "armor:heal"
msgstr "Heal"
msgid "snappy"
msgstr "Snappy"
msgid "shape"
msgstr "Shape"
msgid "oddly_breakable_by_hand"
msgstr "Oddly breakable"
msgid "wood"
msgstr "Wood"
msgid "attached_node"
msgstr "Attachable"
msgid "armor:use"
msgstr "Wear on damage"
msgid "tool:max_drop_level"
msgstr "Max drop level"
msgid "physics:speed"
msgstr "Walking speed"
msgid "armor:legs"
msgstr "Legs protection"
msgid "food"
msgstr "Food"
msgid "damage:choppy"
msgstr "Choppy damage"
msgid "slope"
msgstr "Slope"
msgid "soil:2"
msgstr "Dry farming soil"
msgid "soil:1"
msgstr "Basic soil"
msgid "all"
msgstr "All items"
msgid "armor:fire"
msgstr "Fire protection"
msgid "translucent"
msgstr "Translucent"
msgid "leavedecay"
msgstr "Decayable"
msgid "armor:feet"
msgstr "Feet protection"
msgid "sand"
msgstr "Sand"
msgid "damage:snappy"
msgstr "Snappy damage"
msgid "damage:fleshy"
msgstr "Fleshy damage"
msgid "armor"
msgstr "Armor"
msgid "stair"
msgstr "Stair"
msgid "customnode"
msgstr "Decorative node"
msgid "water_bucket"
msgstr "Bucket"
msgid "connect_to_raillike"
msgstr "Rail-like"
msgid "falling_node"
msgstr "Falling"
msgid "mod"
msgstr "Mod"
msgid "type:node"
msgstr "Node"
msgid "soil:3"
msgstr "Wet farming"
msgid "bouncy"
msgstr "Bouncy"
msgid "stone"
msgstr "Stone"
msgid "dye"
msgstr "Dye"
msgid "micro"
msgstr "Micro"
msgid "other"
msgstr "Other items"
msgid "armor:torso"
msgstr "Torso protection"
msgid "wool"
msgstr "Wool"
msgid "type:tool"
msgstr "Tool"
msgid "vessel"
msgstr "Vessel"
msgid "fleshy"
msgstr "Fleshy"
msgid "light"
msgstr "Light source"
msgid "panel"
msgstr "Panel"
msgid "leaves"
msgstr "Leaves"
msgid "armor:level"
msgstr "Armor level"
msgid "recipetype:cooking"
msgstr "Cooking result"
msgid "type:craft"
msgstr "Item"
msgid "ingredient"
msgstr "Crafted with"
msgid "carpet"
msgstr "Carpet"
msgid "wall"
msgstr "Wall"
msgid "fence"
msgstr "Fence"
msgid "stick"
msgstr "Stick"
msgid "armor:head"
msgstr "Head protection"
msgid "flora"
msgstr "Flora"
msgid "tree"
msgstr "Tree"
msgid "explody"
msgstr "Explosive"
msgid "armor:water"
msgstr "Water protection"
msgid "crumbly"
msgstr "Crumbly"

225
locale/groups_template.pot Normal file
View File

@ -0,0 +1,225 @@
msgid "slab"
msgstr ""
msgid "armor:shield"
msgstr ""
msgid "physics:jump"
msgstr ""
msgid "dig_immediate"
msgstr ""
msgid "coal"
msgstr ""
msgid "flammable"
msgstr ""
msgid "disable_jump"
msgstr ""
msgid "physics:gravity"
msgstr ""
msgid "cracky"
msgstr ""
msgid "level"
msgstr ""
msgid "dig_immediate:3"
msgstr ""
msgid "door"
msgstr ""
msgid "armor:state"
msgstr ""
msgid "tool:full_punch_interval"
msgstr ""
msgid "soil"
msgstr ""
msgid "choppy"
msgstr ""
msgid "armor:heal"
msgstr ""
msgid "snappy"
msgstr ""
msgid "shape"
msgstr ""
msgid "oddly_breakable_by_hand"
msgstr ""
msgid "wood"
msgstr ""
msgid "attached_node"
msgstr ""
msgid "armor:use"
msgstr ""
msgid "tool:max_drop_level"
msgstr ""
msgid "physics:speed"
msgstr ""
msgid "armor:legs"
msgstr ""
msgid "food"
msgstr ""
msgid "damage:choppy"
msgstr ""
msgid "slope"
msgstr ""
msgid "soil:2"
msgstr ""
msgid "soil:1"
msgstr ""
msgid "all"
msgstr ""
msgid "armor:fire"
msgstr ""
msgid "translucent"
msgstr ""
msgid "leavedecay"
msgstr ""
msgid "armor:feet"
msgstr ""
msgid "sand"
msgstr ""
msgid "damage:snappy"
msgstr ""
msgid "damage:fleshy"
msgstr ""
msgid "armor"
msgstr ""
msgid "stair"
msgstr ""
msgid "customnode"
msgstr ""
msgid "water_bucket"
msgstr ""
msgid "connect_to_raillike"
msgstr ""
msgid "falling_node"
msgstr ""
msgid "mod"
msgstr ""
msgid "type:node"
msgstr ""
msgid "soil:3"
msgstr ""
msgid "bouncy"
msgstr ""
msgid "stone"
msgstr ""
msgid "dye"
msgstr ""
msgid "micro"
msgstr ""
msgid "other"
msgstr ""
msgid "armor:torso"
msgstr ""
msgid "wool"
msgstr ""
msgid "type:tool"
msgstr ""
msgid "vessel"
msgstr ""
msgid "fleshy"
msgstr ""
msgid "light"
msgstr ""
msgid "panel"
msgstr ""
msgid "leaves"
msgstr ""
msgid "armor:level"
msgstr ""
msgid "recipetype:cooking"
msgstr ""
msgid "type:craft"
msgstr ""
msgid "ingredient"
msgstr ""
msgid "carpet"
msgstr ""
msgid "wall"
msgstr ""
msgid "fence"
msgstr ""
msgid "stick"
msgstr ""
msgid "armor:head"
msgstr ""
msgid "flora"
msgstr ""
msgid "tree"
msgstr ""
msgid "explody"
msgstr ""
msgid "armor:water"
msgstr ""
msgid "crumbly"
msgstr ""

View File

@ -11,7 +11,7 @@ local creative = minetest.setting_getbool("creative_mode")
local armor_type = {}
if smart_inventory.armor_mod then
for _,v in ipairs(armor.elements) do
armor_type["group:armor:"..v] = true
armor_type["armor:"..v] = true
end
end
@ -86,7 +86,7 @@ local function update_page(state)
if k == "groups" then
for gn, gv in pairs(v) do
if txt["armor:"..gn] then
grouptext = txt["armor:"..gn].label
grouptext = txt["armor:"..gn]
else
grouptext = "armor:"..gn
end
@ -103,19 +103,19 @@ local function update_page(state)
end
end
if is_physics then
if txt["group:physics:"..k] then
grouptext = txt["group:physics:"..k].label
if txt["physics:"..k] then
grouptext = txt["physics:"..k]
else
grouptext = "group:physics:"..k
grouptext = "physics:"..k
end
if grouptext and v ~= 1 then
a_list:addItem(grouptext..": "..v)
end
else
if txt["group:armor:"..k] then
grouptext = txt["group:armor:"..k].label
if txt["armor:"..k] then
grouptext = txt["armor:"..k]
else
grouptext = "group:armor:"..k
grouptext = "armor:"..k
end
if grouptext and v ~= 0 then
if k == "state" then

View File

@ -1,97 +0,0 @@
return {
-- armor group
["armor:fleshy"] = { label = "Körperschutz" },
["armor:radiation"] = { label = "Schutz gegen Radioaktivität" },
["group:armor"] = { label = "Rüstung" },
["group:armor:state"] = { label = "Rüstungsstatus" },
["group:armor:level"] = { label = "Level der Rüstung" },
["group:physics:jump"] = { label = "Sprunghöhe" },
["group:physics:speed"] = { label = "Geschwindigkeit" },
["group:physics:gravity"] = { label = "Erdanziehung" },
["group:armor:heal"] = { label = "Heilen" },
["group:armor:water"] = { label = "Wasserschutz" },
["group:armor:fire"] = { label = "Feuerschutz" },
["group:armor:head"] = { label = "Kopfschutz" },
["group:armor:torso"] = { label = "Körperschutz" },
["group:armor:legs"] = { label = "Beinschutz" },
["group:armor:feet"] = { label = "Stiefel" },
["group:armor:shield"] = { label = "Schild" },
["group:armor:use"] = { label = "Abnutzung bei Schaden" },
-- http://dev.minetest.net/Groups
-- http://dev.minetest.net/Groups/Custom_groups
["group:level"] = { label = "Wertvoll" },
["group:oddly_breakable_by_hand"] = { label = "Ohne Werkzeug abbaubar" },
["group:dig_immediate"] = { label = "Schnell abbaubar" },
["group:dig_immediate:3"] = { label = "Sofort abbaubar" },
["group:disable_jump"] = { label = "Klebrig" },
["group:bouncy"] = { label = "Federnd" },
["group:falling_node"] = { label = "Fallend" },
["group:attached_node"] = { label = "Verbundbar" },
["group:connect_to_raillike"] = { label = "Schienenartig" },
["group:crumbly"] = { label = "Brüchig" },
["group:cracky"] = { label = "Knackig" },
["group:snappy"] = { label = "Schnittig" },
["group:choppy"] = { label = "Abgehackt" },
["group:explody"] = { label = "Explosiv" },
["group:flammable"] = { label = "Brennbar" },
["group:not_in_creative_inventory"] = { label = "Versteckt" },
["group:tree"] = { label = "Baum" },
["group:flora"] = { label = "Flora" },
["group:soil"] = { label = "Erde" },
["group:soil:1"] = { label = "Ackerboden" },
["group:soil:2"] = { label = "Trockener Ackerboden" },
["group:soil:3"] = { label = "Nasser Ackerboden" },
["group:sand"] = { label = "Sand" },
["group:stone"] = { label = "Stein" },
["group:wood"] = { label = "Holz" },
["group:wool"] = { label = "Wolle" },
["group:leaves"] = { label = "Blätter" },
["group:leavedecay"] = { label = "Verwelkbar" },
["group:stick"] = { label = "Stock" },
["group:coal"] = {label = "Kohle" },
["group:water_bucket"] = {label = "Eimer"},
["group:dye"] = {label = "Farbstoff"},
["group:food"] = {label = "Nahrung"},
["group:stair"] = {label = "Treppe"},
["group:door"] = {label = "Tür"},
["group:fence"] = {label = "Zaun"},
["group:slab"] = {label = "Platte"},
["group:wall"] = {label = "Mauer"},
["group:carpet"] = {label = "Teppich"},
["group:micro"] = {label = "Mikro"},
["group:panel"] = {label = "Paneel"},
["group:slope"] = {label = "Neigung"},
["group:customnode"] = {label = "Dekorativer Block"},
["type:tool"] = { label = "Werkzeug" },
["type:node"] = { label = "Block" },
["type:craft"] = { label = "Gegenstand" },
["recipetype:cooking"] = { label = "Kochbar" },
["mod"] = { label = "Mod" },
["transluc"] = { label = "Lichtdurchlässig" },
["vessel"] = { label = "Behälter" },
["food"] = { label = "Nahrung" },
["shape"] = { label = "Geformt"},
["light"] = { label = "Lichtquelle"},
["ingredient"] = { label = "Erzeugt aus"},
["tool:full_punch_interval"] = { label = "Verwendungsinterval" },
["tool:max_drop_level"] = { label = "Max drop Level" },
-- ["tool:groupcaps:fleshy"] = { label = "??" },
-- ["tool:groupcaps:snappy"] = { label = "??" },
-- ["tool:groupcaps:choppy"] = { label = "??" },
["tool:damage:fleshy"] = { label = "Wund-Schaden" },
["tool:damage:snappy"] = { label = "Schnitt-Schaden" },
["tool:damage:choppy"] = { label = "Hack-Schaden" },
["all"] = {label = "Alles" },
["other"] = {label = "Weitere" },
}

View File

@ -1,97 +0,0 @@
return {
-- armor group
["armor:fleshy"] = { label = "Fleshy protection" },
["armor:radiation"] = { label = "Radiation protection" },
["group:armor"] = { label = "Armor" },
["group:armor:state"] = { label = "Armor state" },
["group:armor:level"] = { label = "Armor level" },
["group:physics:jump"] = { label = "Jump high" },
["group:physics:speed"] = { label = "Walking speed" },
["group:physics:gravity"] = { label = "Gravity" },
["group:armor:heal"] = { label = "Heal" },
["group:armor:water"] = { label = "Water protection" },
["group:armor:fire"] = { label = "Fire protection" },
["group:armor:head"] = { label = "Head protection" },
["group:armor:torso"] = { label = "Torso protection" },
["group:armor:legs"] = { label = "Legs protection" },
["group:armor:feet"] = { label = "Feet protection" },
["group:armor:shield"] = { label = "Shield" },
["group:armor:use"] = { label = "Wear on damage" },
-- http://dev.minetest.net/Groups
-- http://dev.minetest.net/Groups/Custom_groups
["group:level"] = { label = "Valuable" },
["group:oddly_breakable_by_hand"] = { label = "Oddly breakable" },
["group:dig_immediate"] = { label = "Fast diggable" },
["group:dig_immediate:3"] = { label = "Immediate diggable" },
["group:disable_jump"] = { label = "Sticky" },
["group:bouncy"] = { label = "Bouncy" },
["group:falling_node"] = { label = "Falling" },
["group:attached_node"] = { label = "Attachable" },
["group:connect_to_raillike"] = { label = "Rail-like" },
["group:crumbly"] = { label = "Crumbly" },
["group:cracky"] = { label = "Cracky" },
["group:snappy"] = { label = "Snappy" },
["group:choppy"] = { label = "Choppy" },
["group:explody"] = { label = "Explosive" },
["group:flammable"] = { label = "Flammable" },
["group:not_in_creative_inventory"] = { label = "Hidden" },
["group:tree"] = { label = "Tree" },
["group:flora"] = { label = "Flora" },
["group:soil"] = { label = "Soil" },
["group:soil:1"] = { label = "Basic soil" },
["group:soil:2"] = { label = "Dry farming soil" },
["group:soil:3"] = { label = "Wet farming" },
["group:sand"] = { label = "Sand" },
["group:stone"] = { label = "Stone" },
["group:wood"] = { label = "Wood" },
["group:wool"] = { label = "Wool" },
["group:leaves"] = { label = "Leaves" },
["group:leavedecay"] = { label = "Decayable" },
["group:stick"] = { label = "Stick" },
["group:coal"] = {label = "Coal" },
["group:water_bucket"] = {label = "Bucket"},
["group:dye"] = {label = "Dye"},
["group:food"] = {label = "Food"},
["group:stair"] = {label = "Stair"},
["group:door"] = {label = "Door"},
["group:fence"] = {label = "Fence"},
["group:slab"] = {label = "Slab"},
["group:wall"] = {label = "Wall"},
["group:carpet"] = {label = "Carpet"},
["group:micro"] = {label = "Micro"},
["group:panel"] = {label = "Panel"},
["group:slope"] = {label = "Slope"},
["group:customnode"] = {label = "Decorative node"},
["type:tool"] = { label = "Tools" },
["type:node"] = { label = "Nodes" },
["type:craft"] = { label = "Craft Items" },
["recipetype:cooking"] = { label = "Cookable" },
["mod"] = { label = "Mod" },
["transluc"] = { label = "Translucent" },
["vessel"] = { label = "Vessel" },
["food"] = { label = "Food" },
["shape"] = { label = "Shaped"},
["light"] = { label = "Light source"},
["ingredient"] = { label = "Crafted with"},
["tool:full_punch_interval"] = { label = "Punch interval" },
["tool:max_drop_level"] = { label = "Max drop level" },
-- ["tool:groupcaps:fleshy"] = { label = "??" },
-- ["tool:groupcaps:snappy"] = { label = "??" },
-- ["tool:groupcaps:choppy"] = { label = "??" },
["tool:damage:fleshy"] = { label = "Fleshy damage" },
["tool:damage:snappy"] = { label = "Snappy damage" },
["tool:damage:choppy"] = { label = "Choppy damage" },
["all"] = {label = "All items" },
["other"] = {label = "Other items" },
}

View File

@ -1,14 +0,0 @@
local modpath = minetest.get_modpath(minetest.get_current_modname()).."/txt"
local LANG = minetest.setting_get("language")
if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
if not (LANG and (LANG ~= "")) then LANG = "en" end
local txtfile = modpath.."/classify_description_"..LANG:sub(1,2)..".lua"
-- build up caches
local f=io.open(txtfile,"r")
if f~=nil then
io.close(f)
return dofile(txtfile)
else
return dofile(modpath.."/classify_description_en.lua")
end

View File

@ -283,12 +283,12 @@ function ui_tools.get_list_grouped(itemtable)
-- default groups
outtab.all = {}
outtab.all.name = "all"
outtab.all.group_desc = txt[outtab.all.name].label
outtab.all.group_desc = txt[outtab.all.name] or "all"
outtab.all.items = itemtable
outtab.other = {}
outtab.other.name = "other"
outtab.other.group_desc = txt[outtab.other.name].label
outtab.other.group_desc = txt[outtab.other.name] or "other"
outtab.other.items = other
return outtab