Make mod localizable
This commit is contained in:
parent
6779ca702c
commit
36c81aa7df
@ -1,4 +1,11 @@
|
||||
-- This is inspired by the landrush mod by Bremaweb
|
||||
-- intllib support
|
||||
local S
|
||||
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
|
||||
|
||||
areas.hud = {}
|
||||
|
||||
@ -8,8 +15,8 @@ minetest.register_globalstep(function(dtime)
|
||||
local pos = vector.round(player:getpos())
|
||||
local areaStrings = {}
|
||||
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
||||
table.insert(areaStrings, ("You are now in: %s")
|
||||
:format(area.name))
|
||||
table.insert(areaStrings, (S("You are here: %s"))
|
||||
:format(S(area.name)))
|
||||
end
|
||||
local areaString = table.concat(areaStrings, "\n")
|
||||
local hud = areas.hud[name]
|
||||
|
25
mods/areas/locale/de.txt
Normal file
25
mods/areas/locale/de.txt
Normal file
@ -0,0 +1,25 @@
|
||||
# hud.lua
|
||||
You are here: %s = Sie befinden sich hier: %s
|
||||
|
||||
# Section names
|
||||
Start room = Startraum
|
||||
Jumping section = Sprungabschnitt
|
||||
Pointing section = Zeigeabschnitt
|
||||
Using section = Benutzen-Abschnitt
|
||||
Inventory and Chests section = Abschnitt »Inventar und Truhen«
|
||||
Comestibles section = Abschnitt »Essbare Gegenstände«
|
||||
Crafting and Tools section = Abschnitt »Fertigung und Werkzeuge«
|
||||
Smelting section = Verhüttungsabschnitt
|
||||
Swimming section = Schwimmabschnitt
|
||||
Diving section = Tauchabschnitt
|
||||
Waterfall section = Wasserfallabschnitt
|
||||
Viscosity section = Zähflüssigkeitsabschnitt
|
||||
Health and Damage section = Abschnitt »Gesundheit und Schaden«
|
||||
Climbing section = Kletterabschnitt
|
||||
Mining section = Abbauabschnitt
|
||||
Special Blocks section = Abschnitt »Besondere Blöcke«
|
||||
Tutorial Mine = Tutorialmine
|
||||
Building section = Bauabschnitt
|
||||
Sneaking section = Schleichabschnitt
|
||||
Good-Bye room = Abschiedsraum
|
||||
|
24
mods/areas/locale/template.txt
Normal file
24
mods/areas/locale/template.txt
Normal file
@ -0,0 +1,24 @@
|
||||
# hud.lua
|
||||
You are here: %s
|
||||
|
||||
# Section names
|
||||
Start room
|
||||
Jumping section
|
||||
Pointing section
|
||||
Using section
|
||||
Inventory and Chests section
|
||||
Comestibles section
|
||||
Crafting and Tools section
|
||||
Smelting section
|
||||
Swimming section
|
||||
Diving section
|
||||
Waterfall section
|
||||
Viscosity section
|
||||
Health and Damage section
|
||||
Climbing section
|
||||
Mining section
|
||||
Special Blocks section
|
||||
Tutorial Mine
|
||||
Building section
|
||||
Sneaking section
|
||||
Good-Bye room
|
Loading…
x
Reference in New Issue
Block a user