Add intllib support and German translation

This commit is contained in:
Wuzzy 2014-06-28 19:37:37 +02:00
parent b96be89ba7
commit a8fe1d6f75
3 changed files with 203 additions and 16 deletions

View File

@ -1,3 +1,10 @@
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
pedology = {}
pedology.wetnames = {[0] = "dry", "wet", "watery", "sludgy", "muddy", "slurry" }
@ -179,7 +186,7 @@ function pedology.register_liquid(basename, description, alpha, viscosity, drown
local tile = "pedology_"..basename..".png"
local nodedef_source = {
description = description.." source",
description = S(description.." source"),
inventory_image = minetest.inventorycube(tile),
tiles = {tile},
special_tiles = {{name=tile, backface_culling=false}},
@ -204,7 +211,7 @@ function pedology.register_liquid(basename, description, alpha, viscosity, drown
minetest.register_node("pedology:"..basename.."_source", nodedef_source)
local nodedef_flowing = {
description = "flowing "..description,
description = S("flowing "..description),
inventory_image = minetest.inventorycube(tile),
tiles = {tile},
special_tiles = {{name=tile, backface_culling=false}, {name=tile, backface_culling=true}},
@ -308,7 +315,7 @@ function pedology.register_sucky(basename, description, wetness, oozing, sucky,
on_construct, after_destruct = nil
end
local nodedef = {
description = description,
description = S(description),
inventory_image = minetest.inventorycube("pedology_"..wetname..".png"),
tiles = {"pedology_"..wetname..".png"},
paramtype = "light",
@ -360,7 +367,7 @@ function pedology.register_sucky_group(basename, basedescription, lumpbasedescri
if (w==maxwet and w ~= 5) then sucky=0 else sucky=1 end
if melttable == nil then m = 0 else m = melttable[w] end
if( lumpbasedescription ~= nil) then
lumpdescription = (pedology.wetnames[w]).." "..lumpbasedescription
lumpdescription = S((pedology.wetnames[w]).." "..lumpbasedescription)
else
lumpdescription = nil
end
@ -375,7 +382,7 @@ function pedology.register_sucky_group(basename, basedescription, lumpbasedescri
itemname = "pedology:lump_"..basename.."_"..tostring(w)
drop = itemname .. " " .. tostring(dropcount)
itemdef = {
description = lumpdescription,
description = S(lumpdescription),
inventory_image = "pedology_lump_inv_"..basename.."_"..tostring(w)..".png",
wield_image = "pedology_lump_"..basename.."_"..tostring(w)..".png"
}
@ -386,7 +393,7 @@ function pedology.register_sucky_group(basename, basedescription, lumpbasedescri
else
groups = additional_groups
end
pedology.register_sucky(basename, (pedology.wetnames[w]).." "..basedescription, w, oozing, sucky, m, drop, sounds, groups)
pedology.register_sucky(basename, S((pedology.wetnames[w]).." "..basedescription), w, oozing, sucky, m, drop, sounds, groups)
-- register dripping
if(w>0 and pedology.USE_DRIPS == 1) then
minetest.register_abm({
@ -451,26 +458,26 @@ pedology.register_sucky_group("gravel_coarse", "coarse gravel", "big stone",
--[[ snow and ice ]]
minetest.register_craftitem("pedology:lump_snow", {
description = "snow ball",
description = S("snow ball"),
wield_image = "pedology_lump_snow.png",
inventory_image = "pedology_lump_snow.png",
})
minetest.register_craftitem("pedology:lump_ice_pure", {
description = "small pure ice cube",
description = S("small pure ice cube"),
wield_image = "pedology_lump_ice_pure.png",
inventory_image = "pedology_lump_ice_pure.png",
})
minetest.register_craftitem("pedology:lump_ice_white", {
description = "small white ice cube",
description = S("small white ice cube"),
wield_image = "pedology_lump_ice_white.png",
inventory_image = "pedology_lump_ice_white.png",
})
-- TODO: slushy snow is very instable snow; it should be destroyed when touched
minetest.register_node("pedology:snow_slush", {
description = "slushy snow",
description = S("slushy snow"),
tiles = { "pedology_snow_slush.png" },
sounds = { footstep = { name = "pedology_snow_soft_footstep", gain = 1 } },
is_ground_content = true,
@ -480,7 +487,7 @@ minetest.register_node("pedology:snow_slush", {
})
minetest.register_node("pedology:snow_soft", {
description = "soft snow",
description = S("soft snow"),
tiles = { "pedology_snow_soft.png" },
sounds = { footstep = { name = "pedology_snow_soft_footstep", gain = 1 } },
is_ground_content = true,
@ -490,7 +497,7 @@ minetest.register_node("pedology:snow_soft", {
})
minetest.register_node("pedology:snow", {
description = "snow",
description = S("snow"),
tiles = { "pedology_snow.png" },
sounds = { footstep = { name = "pedology_snow_footstep", gain = 0.9 } },
is_ground_content = true,
@ -500,7 +507,7 @@ minetest.register_node("pedology:snow", {
})
minetest.register_node("pedology:snow_packing", {
description = "packing snow",
description = S("packing snow"),
tiles = { "pedology_snow_packing.png" },
sounds = { footstep = { name = "pedology_snow_footstep", gain = 1 } },
is_ground_content = true,
@ -510,7 +517,7 @@ minetest.register_node("pedology:snow_packing", {
})
minetest.register_node("pedology:snow_firn", {
description = "firn",
description = S("firn"),
tiles = { "pedology_snow_firn.png" },
sounds = { footstep = { name = "pedology_ice_white_footstep", gain = 0.7 } },
is_ground_content = true,
@ -520,7 +527,7 @@ minetest.register_node("pedology:snow_firn", {
})
minetest.register_node("pedology:ice_white", {
description = "white ice",
description = S("white ice"),
tiles = { "pedology_ice_white.png" },
sounds = { footstep = { name = "pedology_ice_white_footstep", gain = 0.8 } },
is_ground_content = true,
@ -530,7 +537,7 @@ minetest.register_node("pedology:ice_white", {
})
minetest.register_node("pedology:ice_pure", {
description = "pure ice",
description = S("pure ice"),
drawtype = "glasslike",
paramtype = "light",
tiles = { "pedology_ice_pure.png" },

89
locale/de.txt Normal file
View File

@ -0,0 +1,89 @@
freshwater source = Frischwasserquelle
flowing freshwater = fließendes Frischwasser
ponding water source = stehendes Wasser (Quelle)
flowing ponding water = fließendes stehendes Wasser
dry clay = trockener Ton
wet clay = feuchter Ton
watery clay = wässriger Ton
sludgy clay = matschiger Ton
muddy clay = schlammiger Ton
slurry clay = breiiger Ton
dry clay lump = trockener Tonklumpen
wet clay lump = feuchter Tonklumpen
watery clay lump = wässriger Tonklumpen
sludgy clay lump = matschiger Tonklumpen
dry fine silt = trockener Feinschluff
wet fine silt = feuchter Feinschluff
watery fine silt = wässriger Feinschluff
sludgy fine silt = matschiger Feinschluff
muddy fine silt = schlammiger Feinschluff
slurry fine silt = breiiger Feinschluff
dry fine silt lump = trockener Feinschluffklumpen
wet fine silt lump = feuchter Feinschluffklumpen
watery fine silt lump = wässriger Feinschluffklumpen
sludgy fine silt lump = matschiger Feinschluffklumpen
dry medium silt = trockener Mittelschluff
wet medium silt = feuchter Mittelschluff
watery medium silt = wässriger Mittelschluff
sludgy medium silt = matschiger Mittelschluff
muddy medium silt = schlammiger Mittelschluff
dry medium silt lump = trockener Mittelschluffklumpen
wet medium silt lump = feuchter Mittelschluffklumpen
watery medium silt lump = wässriger Mittelschluffklumpen
sludgy medium silt lump = matschiger Mittelschluffklumpen
dry coarse silt = trockener Grobschluff
wet coarse silt = feuchter Grobschluff
watery coarse silt = wässriger Grobschluff
sludgy coarse silt = matschiger Grobschluff
dry coarse silt lump = trockener Grobschluffklumpen
wet coarse silt lump = feuchter Grobschluffklumpen
watery coarse silt lump = wässriger Grobschluffklumpen
sludgy coarse silt lump = matschiger Grobschluffklumpen
dry fine sand = trockener Feinsand
wet fine sand = feuchter Feinsand
watery fine sand = wässriger Feinsand
dry fine sand pile = trockener Feinsandhaufen
dry medium sand = trockener Mittelsand
wet medium sand = feuchter Mittelsand
dry medium sand pile = trockener Mittelsandhaufen
dry coarse sand = trockener Grobsand
dry coarse sand pile = trockener Grobsandhaufen
dry fine gravel = trockener Feinkies
wet fine gravel = feuchter Feinkies
dry pebble = trockener Kieselstein
dry medium gravel = trockener Mittelkies
wet medium gravel = feuchter Mittelkies
watery medium gravel = wässriger Mittelkies
dry medium stone = trockener mittelgroßer Stein
dry coarse gravel = trockener Grobkies
wet coarse gravel = feuchter Grobkies
watery coarse gravel = wässriger Grobkies
dry big stone = trockener großer Stein
snow ball = Schneeball
small pure ice cube = kleiner reiner Eiswürfel
small white ice cube = kleiner Weißeiswürfel
slushy snow = Schneematsch
soft snow = Neuschnee
snow = Schnee
packing snow = fester Schnee
firn = Firn
white ice = Weißeis
pure ice = reines Eis
dry fibric turf = trockener Rasentorf
wet fibric turf = feuchter Rasentorf
watery fibric turf = wässriger Rasentorf
dry fibric turf cutting = trockener Rasentorfstich
wet fibric turf cutting = feuchter Rasentorfstich
watery fibric turf cutting = wässriger Rasentorfstich
dry hemic turf = trockener Fasertorf
wet hemic turf = feuchter Fasertorf
watery hemic turf = wässriger Fasertorf
dry hemic turf cutting = trockener Fasertorfstich
wet hemic turf cutting = feuchter Fasertorfstich
watery hemic turf cutting = wässriger Fasertorfstich
dry sapric turf = trockener Pechtorf
wet sapric turf = feuchter Pechtorf
watery sapric turf = wässriger Pechtorf
dry sapric turf cutting = trockener Pechtorfstich
wet sapric turf cutting = feuchter Pechtorfstich
watery sapric turf cutting = wässriger Pechtorfstich

91
locale/template.txt Normal file
View File

@ -0,0 +1,91 @@
freshwater source
flowing freshwater
ponding water source
flowing ponding water
dry clay
wet clay
watery clay
sludgy clay
muddy clay
slurry clay
dry clay lump
wet clay lump
watery clay lump
sludgy clay lump
muddy clay lump
slurry clay lump
dry fine silt
wet fine silt
watery fine silt
sludgy fine silt
muddy fine silt
slurry fine silt
dry fine silt lump
wet fine silt lump
watery fine silt lump
sludgy fine silt lump
dry medium silt
wet medium silt
watery medium silt
sludgy medium silt
muddy medium silt
dry medium silt lump
wet medium silt lump
watery medium silt lump
sludgy medium silt lump
dry coarse silt
wet coarse silt
watery coarse silt
sludgy coarse silt
dry coarse silt lump
wet coarse silt lump
watery coarse silt lump
sludgy coarse silt lump
dry fine sand
wet fine sand
watery fine sand
dry fine sand pile
dry medium sand
wet medium sand
dry medium sand pile
dry coarse sand
dry coarse sand pile
dry fine gravel
wet fine gravel
dry pebble
dry medium gravel
wet medium gravel
watery medium gravel
dry medium stone
dry coarse gravel
wet coarse gravel
watery coarse gravel
dry big stone
snow ball
small pure ice cube
small white ice cube
slushy snow
soft snow
snow
packing snow
firn
white ice
pure ice
dry fibric turf
wet fibric turf
watery fibric turf
dry fibric turf cutting
wet fibric turf cutting
watery fibric turf cutting
dry hemic turf
wet hemic turf
watery hemic turf
dry hemic turf cutting
wet hemic turf cutting
watery hemic turf cutting
dry sapric turf
wet sapric turf
watery sapric turf
dry sapric turf cutting
wet sapric turf cutting
watery sapric turf cutting