Add translation support
parent
1468528d85
commit
57f067f8c1
9
init.lua
9
init.lua
|
@ -2,6 +2,9 @@ if not minetest.settings:get_bool("enable_weather") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local translator = minetest.get_translator
|
||||||
|
local S = translator and translator("weather_lite") or function(s) return s end
|
||||||
|
|
||||||
local vadd, vmultiply, vround = vector.add, vector.multiply, vector.round
|
local vadd, vmultiply, vround = vector.add, vector.multiply, vector.round
|
||||||
local random = math.random
|
local random = math.random
|
||||||
local snow_covers = minetest.settings:get_bool("weather_snow_covers") ~= false
|
local snow_covers = minetest.settings:get_bool("weather_snow_covers") ~= false
|
||||||
|
@ -226,18 +229,18 @@ minetest.register_privilege("weather", {
|
||||||
|
|
||||||
minetest.register_chatcommand("weather", {
|
minetest.register_chatcommand("weather", {
|
||||||
params = "<weather>",
|
params = "<weather>",
|
||||||
description = "Set weather type",
|
description = S("Setting the weather type"),
|
||||||
privs = {weather = true},
|
privs = {weather = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param and (weather.registered[param] or param == "none") then
|
if param and (weather.registered[param] or param == "none") then
|
||||||
weather.set(param)
|
weather.set(param)
|
||||||
minetest.chat_send_player(name, "Set weather type: " .. param)
|
minetest.chat_send_player(name, S("Set weather type:") .. " " .. param)
|
||||||
else
|
else
|
||||||
local types = "none"
|
local types = "none"
|
||||||
for w, _ in pairs(weather.registered) do
|
for w, _ in pairs(weather.registered) do
|
||||||
types = types .. ", " .. w
|
types = types .. ", " .. w
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(name, "Avalible weather types: " .. types)
|
minetest.chat_send_player(name, S("Avalible weather types:") .. " " .. types)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# textdomain: weather_lite
|
||||||
|
Setting the weather type=Установка тип погоды
|
||||||
|
Set weather type:=Установлен тип погоды:
|
||||||
|
Avalible weather types:=Доступные типы погоды:
|
Loading…
Reference in New Issue