From e8ee40a141807857503d1368d9154a6f60b8ab63 Mon Sep 17 00:00:00 2001 From: isaiah658 Date: Mon, 18 Jun 2018 11:40:19 -0500 Subject: Add drawer controller translations (#20) Added "Drawer Controller", "Current State: ", "Running", "Jammed", and "Stopped" to the translation files to be translated. While testing out the drawer controller translations, I noticed that in certain cases the entity infotext wasn't being translated. This fixes that. --- locale/be.po | 38 +++++++++++++++++++++++++++++--------- locale/cs.po | 34 +++++++++++++++++++++++++++------- locale/de.po | 34 +++++++++++++++++++++++++++------- locale/es.po | 34 +++++++++++++++++++++++++++------- locale/fr.po | 34 +++++++++++++++++++++++++++------- locale/id.po | 38 +++++++++++++++++++++++++++++--------- locale/it.po | 34 +++++++++++++++++++++++++++------- locale/ms.po | 38 +++++++++++++++++++++++++++++--------- locale/nl.po | 34 +++++++++++++++++++++++++++------- locale/pl.po | 34 +++++++++++++++++++++++++++------- locale/ru.po | 38 +++++++++++++++++++++++++++++--------- locale/template.pot | 30 +++++++++++++++++++++++++----- locale/tr.po | 34 +++++++++++++++++++++++++++------- lua/api.lua | 2 +- lua/controller.lua | 28 ++++++++++++++++------------ 15 files changed, 374 insertions(+), 110 deletions(-) diff --git a/locale/be.po b/locale/be.po index c7ff613..8702ab5 100644 --- a/locale/be.po +++ b/locale/be.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-06-03 21:34+0000\n" "Last-Translator: Viktar Vauchkevich \n" "Language-Team: Belarusian =2 && n%10<=" -"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 2.15-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% поўны)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% поўны)" + #: lua/visual.lua msgid "Empty" msgstr "Пустая" @@ -40,13 +48,25 @@ msgstr "@1 шуфляды (1x2)" msgid "@1 Drawers (2x2)" msgstr "@1 шуфляды (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% поўны)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% поўны)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/cs.po b/locale/cs.po index fd12442..b1aaee5 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-06-21 18:49+0000\n" "Last-Translator: Jakub Vaněk \n" "Language-Team: Czech =2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 2.15-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (z @2 % plný)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (z @3 % plný)" + #: lua/visual.lua msgid "Empty" msgstr "Prázdný" @@ -39,13 +47,25 @@ msgstr "Šuplíky @1 (1x2)" msgid "@1 Drawers (2x2)" msgstr "Šuplíky @1 (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (z @2 % plný)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (z @3 % plný)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/de.po b/locale/de.po index 23b73e4..6f710b2 100644 --- a/locale/de.po +++ b/locale/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-10-23 23:46+0000\n" "Last-Translator: Wuzzy \n" "Language-Team: German \n" "Language-Team: Spanish \n" "Language-Team: French 1;\n" "X-Generator: Weblate 2.17\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% plein)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% plein)" + #: lua/visual.lua msgid "Empty" msgstr "Vide" @@ -39,13 +47,25 @@ msgstr "Tiroirs (1x2) @1" msgid "@1 Drawers (2x2)" msgstr "Tiroirs (2x2) @1" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% plein)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% plein)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/id.po b/locale/id.po index 94ea4f9..dbf680c 100644 --- a/locale/id.po +++ b/locale/id.po @@ -7,12 +7,12 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2018-05-20 16:38+0000\n" "Last-Translator: Muhammad Rifqi Priyo Susanto " "\n" -"Language-Team: Indonesian \n" +"Language-Team: Indonesian \n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,6 +20,14 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 3.0-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% penuh)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% penuh)" + #: lua/visual.lua msgid "Empty" msgstr "Kosong" @@ -40,13 +48,25 @@ msgstr "@1 Laci (1x2)" msgid "@1 Drawers (2x2)" msgstr "@1 Laci (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% penuh)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% penuh)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/it.po b/locale/it.po index e459a87..c71f1f2 100644 --- a/locale/it.po +++ b/locale/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-09-28 16:09+0000\n" "Last-Translator: Hamlet \n" "Language-Team: Italian " -"\n" +"Last-Translator: Muhammad Nur Hidayat Yasuyoshi \n" "Language-Team: Malay \n" "Language: ms\n" @@ -20,6 +20,14 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 2.16-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% penuh)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% penuh)" + #: lua/visual.lua msgid "Empty" msgstr "Kosong" @@ -40,13 +48,25 @@ msgstr "Laci @1 (1x2)" msgid "@1 Drawers (2x2)" msgstr "Laci @1 (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% penuh)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% penuh)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/nl.po b/locale/nl.po index fc93b67..d27801c 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-09-19 19:45+0000\n" "Last-Translator: Oscar \n" "Language-Team: Dutch \n" "Language-Team: Polish =20) ? 1 : 2;\n" "X-Generator: Weblate 2.15-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% napełnione)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% napełnione)" + #: lua/visual.lua msgid "Empty" msgstr "Pusta" @@ -40,13 +48,25 @@ msgstr "@1 Szuflady (1x2)" msgid "@1 Drawers (2x2)" msgstr "@1 Szuflady (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% napełnione)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% napełnione)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/ru.po b/locale/ru.po index e367590..7af4583 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-09-04 21:55+0000\n" "Last-Translator: pitchblack \n" "Language-Team: Russian =2 && n%10<=" -"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 2.17-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (@2% полон)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (@3% полон)" + #: lua/visual.lua msgid "Empty" msgstr "Пусто" @@ -40,13 +48,25 @@ msgstr "@1 Ящики (1x2)" msgid "@1 Drawers (2x2)" msgstr "@1 Ящики (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (@2% полон)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (@3% полон)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/locale/template.pot b/locale/template.pot index e265169..ada429b 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-16 09:14+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,14 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "" + #: lua/visual.lua msgid "Empty" msgstr "" @@ -37,12 +45,24 @@ msgstr "" msgid "@1 Drawers (2x2)" msgstr "" -#: lua/helpers.lua -msgid "@1 (@2% full)" +#: lua/controller.lua +msgid "Current State: " msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" msgstr "" #: init.lua diff --git a/locale/tr.po b/locale/tr.po index 658dc22..7e14532 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-03 17:04+0200\n" +"POT-Creation-Date: 2018-06-17 11:36-0500\n" "PO-Revision-Date: 2017-06-04 14:23+0000\n" "Last-Translator: monolifed \n" "Language-Team: Turkish 1;\n" "X-Generator: Weblate 2.15-dev\n" +#: lua/helpers.lua +msgid "@1 (@2% full)" +msgstr "@1 (%@2 dolu)" + +#: lua/helpers.lua +msgid "@1 @2 (@3% full)" +msgstr "@1 @2 (%@3 dolu)" + #: lua/visual.lua msgid "Empty" msgstr "Boş" @@ -39,13 +47,25 @@ msgstr "@1 Çekmece (1x2)" msgid "@1 Drawers (2x2)" msgstr "@1 Çekmece (2x2)" -#: lua/helpers.lua -msgid "@1 (@2% full)" -msgstr "@1 (%@2 dolu)" +#: lua/controller.lua +msgid "Current State: " +msgstr "" -#: lua/helpers.lua -msgid "@1 @2 (@3% full)" -msgstr "@1 @2 (%@3 dolu)" +#: lua/controller.lua +msgid "Stopped" +msgstr "" + +#: lua/controller.lua +msgid "Running" +msgstr "" + +#: lua/controller.lua +msgid "Jammed" +msgstr "" + +#: lua/controller.lua +msgid "Drawer Controller" +msgstr "" #: init.lua msgid "Acacia Wood" diff --git a/lua/api.lua b/lua/api.lua index d12a17c..6c87f94 100755 --- a/lua/api.lua +++ b/lua/api.lua @@ -67,7 +67,7 @@ function drawers.drawer_on_construct(pos) meta:set_int("count"..vid, 0) meta:set_int("max_count"..vid, base_stack_max * stack_max_factor) meta:set_int("base_stack_max"..vid, base_stack_max) - meta:set_string("entity_infotext"..vid, drawers.gen_info_text("Empty", 0, + meta:set_string("entity_infotext"..vid, drawers.gen_info_text(S("Empty"), 0, stack_max_factor, base_stack_max)) meta:set_int("stack_max_factor"..vid, stack_max_factor) diff --git a/lua/controller.lua b/lua/controller.lua index 315ae5c..6582c78 100644 --- a/lua/controller.lua +++ b/lua/controller.lua @@ -39,6 +39,10 @@ needing to scan all the drawers to deposit an item in certain situations. The table is only updated on an as needed basis, not by a specific time/interval. Controllers that have no items will not continue scanning drawers. ]]-- +-- Load support for intllib. +local MP = core.get_modpath(core.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + local function controller_can_dig(pos, player) local meta = core.get_meta(pos); local inv = meta:get_inventory() @@ -74,7 +78,7 @@ local function controller_formspec(pos, meta_current_state) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[0,0;Current State: " .. meta_current_state .. "]" .. + "label[0,0;" .. S("Current State: ") .. meta_current_state .. "]" .. "list[current_name;src;3.5,1.75;1,1;]".. "list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,5.5;8,3;8]".. @@ -217,7 +221,7 @@ local function controller_node_timer(pos, elapsed) clear it each time ]]-- if meta_current_state == "jammed" and meta_jammed_item_name == src_name and meta_times_ran_while_jammed >= 8 then meta:set_string("current_state", "stopped") - meta:set_string("formspec", controller_formspec(pos, "Stopped")) + meta:set_string("formspec", controller_formspec(pos, S("Stopped"))) return true end @@ -229,14 +233,14 @@ local function controller_node_timer(pos, elapsed) -- If current state is stopped, and the item that jammed it is not the same item in the src inv slot, we set the current state to running and clear the jam counter if meta_current_state == "stopped" and meta_jammed_item_name ~= src_name then meta:set_string("current_state", "running") - meta:set_string("formspec", controller_formspec(pos, "Running")) + meta:set_string("formspec", controller_formspec(pos, S("Running"))) meta:set_float("times_ran_while_jammed", 0) end -- If no item is in the controller, nothing is searched and current_state is set to running and no jams if inv:is_empty("src") then meta:set_string("current_state", "running") - meta:set_string("formspec", controller_formspec(pos, "Running")) + meta:set_string("formspec", controller_formspec(pos, S("Running"))) meta:set_float("times_ran_while_jammed", 0) return true end @@ -244,7 +248,7 @@ local function controller_node_timer(pos, elapsed) -- If a non stackable item is in the controller, such as a written book, set the current_state to stopped because they are not allowed in drawers if src:get_stack_max() == 1 then meta:set_string("current_state", "stopped") - meta:set_string("formspec", controller_formspec(pos, "Stopped")) + meta:set_string("formspec", controller_formspec(pos, S("Stopped"))) meta:set_string("jammed_item_name", src_name) meta:set_float("times_ran_while_jammed", 1) return true @@ -295,11 +299,11 @@ local function controller_node_timer(pos, elapsed) inv:set_stack("src", 1, leftover) -- Set the controller metadata meta:set_string("current_state", "running") - meta:set_string("formspec", controller_formspec(pos, "Running")) + meta:set_string("formspec", controller_formspec(pos, S("Running"))) meta:set_float("times_ran_while_jammed", 0) else meta:set_string("current_state", "jammed") - meta:set_string("formspec", controller_formspec(pos, "Jammed")) + meta:set_string("formspec", controller_formspec(pos, S("Jammed"))) meta:set_string("jammed_item_name", src_name) meta:set_float("times_ran_while_jammed", meta_times_ran_while_jammed + 1) end @@ -317,18 +321,18 @@ local function controller_node_timer(pos, elapsed) drawers_table_index[src_name] = {drawer_pos_x = indexed_drawer_pos.x, drawer_pos_y = indexed_drawer_pos.y, drawer_pos_z = indexed_drawer_pos.z, visualid = visualid} -- Set the controller metadata meta:set_string("current_state", "running") - meta:set_string("formspec", controller_formspec(pos, "Running")) + meta:set_string("formspec", controller_formspec(pos, S("Running"))) meta:set_float("times_ran_while_jammed", 0) meta:set_string("drawers_table_index", core.serialize(drawers_table_index)) else meta:set_string("current_state", "jammed") - meta:set_string("formspec", controller_formspec(pos, "Jammed")) + meta:set_string("formspec", controller_formspec(pos, S("Jammed"))) meta:set_string("jammed_item_name", src_name) meta:set_float("times_ran_while_jammed", meta_times_ran_while_jammed + 1) end else meta:set_string("current_state", "jammed") - meta:set_string("formspec", controller_formspec(pos, "Jammed")) + meta:set_string("formspec", controller_formspec(pos, S("Jammed"))) meta:set_string("jammed_item_name", src_name) meta:set_float("times_ran_while_jammed", meta_times_ran_while_jammed + 1) end @@ -338,7 +342,7 @@ end -- Set the controller definition using a table to allow for pipeworks and potentially other mod support local controller_def = {} -controller_def.description = 'Drawer Controller' +controller_def.description = S("Drawer Controller") controller_def.tiles = {"drawer_controller_top_bottom.png", "drawer_controller_top_bottom.png", "drawer_controller_side.png", "drawer_controller_side.png", "drawer_controller_side.png", "drawer_controller_side.png"} controller_def.can_dig = controller_can_dig controller_def.groups = {cracky = 3, level = 2} @@ -350,7 +354,7 @@ controller_def.on_construct = function(pos) meta:set_float("times_ran_while_jammed", 0) meta:set_string("jammed_item_name", "") meta:set_string("drawers_table_index", "") - meta:set_string("formspec", controller_formspec(pos, "Running")) + meta:set_string("formspec", controller_formspec(pos, S("Running"))) local timer = core.get_node_timer(pos) timer:start(7) end -- cgit v1.2.3