diff --git a/init.lua b/init.lua index a0ea69c..c036e51 100644 --- a/init.lua +++ b/init.lua @@ -1,13 +1,17 @@ digilines = {} digilines.S = minetest.get_translator("digilines") +-- formspec escape translation +digilines.FS = function (...) + return minetest.formspec_escape(digilines.S(...)) +end + digilines.mcl = minetest.get_modpath("mcl_core") -- sounds check if minetest.get_modpath("default") then digilines.sounds = default end if digilines.mcl then digilines.sounds = mcl_sounds end - -- Backwards compatibility code. -- We define a proxy table whose methods can be called with the -- `foo:bar` notation, and it will redirect the call to the diff --git a/lcd.lua b/lcd.lua index 1f5f33f..0d2fa47 100644 --- a/lcd.lua +++ b/lcd.lua @@ -1,4 +1,5 @@ local S = digilines.S +local FS = digilines.FS --* parts are currently not possible because you cannot set the pitch of an entity from lua @@ -186,7 +187,7 @@ local lcds = { } local reset_meta = function(pos) - minetest.get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]") + minetest.get_meta(pos):set_string("formspec", "field[channel;"..FS("Channel")..";${channel}]") end local clearscreen = function(pos) diff --git a/lightsensor.lua b/lightsensor.lua index b39871c..cc9df09 100644 --- a/lightsensor.lua +++ b/lightsensor.lua @@ -1,4 +1,5 @@ local S = digilines.S +local FS = digilines.FS local GET_COMMAND = "GET" @@ -53,7 +54,7 @@ minetest.register_node("digilines:lightsensor", { }, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec", "field[channel;Channel;${channel}]") + meta:set_string("formspec", "field[channel;"..FS("Channel")..";${channel}]") end, on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name() diff --git a/locale/diglines.ru.tr b/locale/diglines.ru.tr new file mode 100644 index 0000000..6e804e3 --- /dev/null +++ b/locale/diglines.ru.tr @@ -0,0 +1,23 @@ +# textdomain: digilines + + +### inventory.lua ### + +Channel=Канал +Digiline Chest=Диджилайн-сундук + +### lcd.lua ### + +Digiline LCD=Диджилайн LCD + +### lightsensor.lua ### + +Digiline Lightsensor=Сенсор света диджилайн + +### rtc.lua ### + +Digiline Real Time Clock (RTC)=Часы реального времени диджилайн (RTC) + +### wire_std.lua ### + +Digiline=Диджилайн diff --git a/rtc.lua b/rtc.lua index 07add3e..1a910de 100644 --- a/rtc.lua +++ b/rtc.lua @@ -1,4 +1,5 @@ local S = digilines.S +local FS = digilines.FS local GET_COMMAND = "GET" @@ -52,7 +53,7 @@ minetest.register_node("digilines:rtc", { }, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec", "field[channel;Channel;${channel}]") + meta:set_string("formspec", "field[channel;"..FS("Channel")..";${channel}]") end, on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name()