diff --git a/init.lua b/init.lua index 93c94e9..d861c7c 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ - digilines = {} +digilines.S = minetest.get_translator("digilines") -- Backwards compatibility code. -- We define a proxy table whose methods can be called with the diff --git a/inventory.lua b/inventory.lua index 9412e99..3fa975c 100644 --- a/inventory.lua +++ b/inventory.lua @@ -1,3 +1,5 @@ +local S = digilines.S + local pipeworks_enabled = minetest.get_modpath("pipeworks") ~= nil -- Sends a message onto the Digilines network. @@ -146,7 +148,7 @@ end minetest.register_alias("digilines_inventory:chest", "digilines:chest") minetest.register_node("digilines:chest", { - description = "Digiline Chest", + description = S("Digiline Chest"), tiles = { "default_chest_top.png"..tubeconn, "default_chest_top.png"..tubeconn, @@ -161,14 +163,14 @@ minetest.register_node("digilines:chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Digiline Chest") + meta:set_string("infotext", S("Digiline Chest")) meta:set_string("formspec", "size[8,10]".. ((default and default.gui_bg) or "").. ((default and default.gui_bg_img) or "").. ((default and default.gui_slots) or "").. - "label[0,0;Digiline Chest]".. + "label[0,0;" .. S("Digiline Chest") .. "]" .. "list[current_name;main;0,1;8,4;]".. - "field[2,5.5;5,1;channel;Channel;${channel}]".. + "field[2,5.5;5,1;channel;" .. S("Channel") .. ";${channel}]".. ((default and default.get_hotbar_bg) and default.get_hotbar_bg(0,6) or "").. "list[current_player;main;0,6;8,4;]".. "listring[]") diff --git a/lcd.lua b/lcd.lua index cbff46b..5a1d3a0 100644 --- a/lcd.lua +++ b/lcd.lua @@ -1,3 +1,5 @@ +local S = digilines.S + --* parts are currently not possible because you cannot set the pitch of an entity from lua -- Font: 04.jp.org @@ -270,7 +272,7 @@ local lcd_box = { minetest.register_alias("digilines_lcd:lcd", "digilines:lcd") minetest.register_node("digilines:lcd", { drawtype = "nodebox", - description = "Digiline LCD", + description = S("Digiline LCD"), inventory_image = "lcd_lcd.png", wield_image = "lcd_lcd.png", tiles = {"lcd_anyside.png"}, diff --git a/lightsensor.lua b/lightsensor.lua index 9382fbd..41fa6e0 100644 --- a/lightsensor.lua +++ b/lightsensor.lua @@ -1,3 +1,5 @@ +local S = digilines.S + local GET_COMMAND = "GET" local lsensor_nodebox = @@ -31,7 +33,7 @@ end minetest.register_alias("digilines_lightsensor:lightsensor", "digilines:lightsensor") minetest.register_node("digilines:lightsensor", { - description = "Digiline Lightsensor", + description = S("Digiline Lightsensor"), drawtype = "nodebox", tiles = {"digilines_lightsensor.png"}, diff --git a/locale/digilines.zh_TW.tr b/locale/digilines.zh_TW.tr new file mode 100644 index 0000000..6e10ae7 --- /dev/null +++ b/locale/digilines.zh_TW.tr @@ -0,0 +1,17 @@ +# textdomain: digilines + +### inventory.lua ### +Digiline Chest=訊纜儲物箱 +Channel=頻道 + +### lcd.lua ### +Digiline LCD=訊纜 LCD + +### lightsensor.lua ### +Digiline Lightsensor=訊纜光感應器 + +### rtc.lua ### +Digiline Real Time Clock (RTC)=訊纜實時時鐘 + +### wire_std.lua ### +Digiline=訊纜 diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..b840f23 --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,17 @@ +# textdomain: digilines + +### inventory.lua ### +Digiline Chest= +Channel= + +### lcd.lua ### +Digiline LCD= + +### lightsensor.lua ### +Digiline Lightsensor= + +### rtc.lua ### +Digiline Real Time Clock (RTC)= + +### wire_std.lua ### +Digiline= diff --git a/rtc.lua b/rtc.lua index 89d3c2f..3414ed6 100644 --- a/rtc.lua +++ b/rtc.lua @@ -1,3 +1,5 @@ +local S = digilines.S + local GET_COMMAND = "GET" local rtc_nodebox = @@ -26,7 +28,7 @@ end minetest.register_alias("digilines_rtc:rtc", "digilines:rtc") minetest.register_node("digilines:rtc", { - description = "Digiline Real Time Clock (RTC)", + description = S("Digiline Real Time Clock (RTC)"), drawtype = "nodebox", tiles = {"digilines_rtc.png"}, diff --git a/wire_std.lua b/wire_std.lua index acb45ea..7b371c0 100644 --- a/wire_std.lua +++ b/wire_std.lua @@ -1,3 +1,5 @@ +local S = digilines.S + -- naming scheme: wire:(xp)(zp)(xm)(zm)_on/off -- The conditions in brackets define whether there is a digiline at that place or not -- 1 = there is one; 0 = there is none @@ -36,7 +38,7 @@ for zmy=0, 1 do if nodeid == "00000000" then groups = {dig_immediate = 3} - wiredesc = "Digiline" + wiredesc = S("Digiline") else groups = {dig_immediate = 3, not_in_creative_inventory = 1} end