diff --git a/mods/cloud_items/.luacheckrc b/mods/cloud_items/.luacheckrc index 77255434..a24c1b85 100644 --- a/mods/cloud_items/.luacheckrc +++ b/mods/cloud_items/.luacheckrc @@ -3,7 +3,7 @@ allow_defined_top = true max_line_length = 999 globals = { - "default", "minetest", + "default", "minetest", "core", } read_globals = { @@ -13,5 +13,5 @@ read_globals = { "armor", "PseudoRandom", "toolranks", "stairs", "worldedit", "stairsplus", - "multitools", "vehicle_mash", + "multitools", "vehicle_mash", "lib_mount", } diff --git a/mods/cloud_items/LICENSE.md b/mods/cloud_items/LICENSE.md index 82685e05..cea73229 100644 --- a/mods/cloud_items/LICENSE.md +++ b/mods/cloud_items/LICENSE.md @@ -6,6 +6,8 @@ Copyright (C) Various other Minetest developers/contributors [David Leal](https://github.com/Panquesito7) ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)): - `screenshot.png` +- `cloud_items_cloud_ship.obj` +- `cloud_items_cloud_ship_inventory.png` [BlockMen](https://github.com/BlockMen) ([CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)): diff --git a/mods/cloud_items/README.md b/mods/cloud_items/README.md index 20169773..0b6605e6 100644 --- a/mods/cloud_items/README.md +++ b/mods/cloud_items/README.md @@ -45,6 +45,14 @@ Medium schematic Big schematic ![Big schematic](https://user-images.githubusercontent.com/51391473/87363085-03bf5c80-c536-11ea-8ab5-155a931e7400.png) +### Vehicles + +There are some nice-craftable vehicles you can ride on.\ +Here is one screenshot for each of the available vehicles: + +![Cloud car](https://user-images.githubusercontent.com/51391473/99441120-13ccbb80-28dd-11eb-9eb1-8af7aa699b02.png) +![Cloud ship](https://user-images.githubusercontent.com/51391473/99441264-424a9680-28dd-11eb-8dba-fb8297fef92b.png) + ### Cloud house If you go above 1500 blocks up, you may find a cloud house!\ @@ -92,6 +100,7 @@ There are 4 types of cloud: - `default` (included in [Minetest Game](https://github.com/minetest/minetest_game)) - [`worldedit`](https://github.com/Uberi/Minetest-WorldEdit) - This is required due to the `worldedit.deserialize` function. +- [`vehicle_mash`](https://github.com/minetest-mods/vehicle_mash) ### Optional dependencies @@ -103,7 +112,7 @@ There are 4 types of cloud: ## Requirements -Cloud Items is currently tested with Minetest 5.3.0.\ +Cloud Items is currently tested with Minetest 5.4.0-dev.\ Issues may arise if you use older or newer versions. It shall work with MT 5.0.0 and above, though. diff --git a/mods/cloud_items/init.lua b/mods/cloud_items/init.lua index 16a62707..e4ea931e 100644 --- a/mods/cloud_items/init.lua +++ b/mods/cloud_items/init.lua @@ -500,49 +500,80 @@ if minetest.get_modpath("multitools") then ) end +------------------ +-- Cloud ship -- +------------------ + +-- Code is taken and modified from the Vehicle Mash (https://github.com/minetest-mods/vehicle_mash) mod (WTFPL license). +-- See the mod license (https://github.com/minetest-mods/vehicle_mash/blob/master/LICENSE.md) for more information. +local ship_def = { + terrain_type = 3, + max_speed_forward = 10, + max_speed_reverse = 7, + accel = 4, + braking = 5, + turn_speed = 6, + stepheight = 1.5, + -- model specific stuff + visual = "mesh", + visual_size = {x=1, y=1}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-2.3, -0.3, -2, 2.5, 1.9, 2}, + can_fly = true, + enable_crash = false, + onplace_position_adj = 0, + textures = {"default_cloud.png"}, + -- player specific stuff + player_rotation = {x=0, y=0, z=0}, + driver_attach_at = {x=-0.6, y=19, z=0}, + driver_eye_offset = {x=-0.6, y=19, z=0}, + number_of_passengers = 0 +} + +-- Cloud ship (based on the Vehicle Mash boat) +loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/ship.lua")(table.copy(ship_def)) + ---------------- -- Cloud car -- ---------------- -- Code is taken and modified from the Vehicle Mash (https://github.com/minetest-mods/vehicle_mash) mod (WTFPL license). -- See the mod license (https://github.com/minetest-mods/vehicle_mash/blob/master/LICENSE.md) for more information. -if minetest.get_modpath("vehicle_mash") then - local car_def = { - terrain_type = 1, - max_speed_forward = 13, - max_speed_reverse = 10, - accel = 4, - braking = 6, - turn_speed = 4, - stepheight = 1.3, +local car_def = { + terrain_type = 1, + max_speed_forward = 13, + max_speed_reverse = 10, + accel = 4, + braking = 6, + turn_speed = 4, + stepheight = 1.3, - visual = "mesh", - mesh = "car.x", -- Model is from the Vehicle Mash mod; licensed under CC BY-NC-SA 3.0 - visual_size = {x=1, y=1}, - wield_scale = {x=1, y=1, z=1}, - collisionbox = {-0.6, -0.05, -0.6, 0.6, 1, 0.6}, - onplace_position_adj = -0.45, + visual = "mesh", + mesh = "car.x", -- Model is from the Vehicle Mash mod; licensed under CC BY-NC-SA 3.0 + visual_size = {x=1, y=1}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-0.6, -0.05, -0.6, 0.6, 1, 0.6}, + onplace_position_adj = -0.45, - player_rotation = {x=0,y=90,z=0}, - driver_attach_at = {x=3.5,y=3.7,z=3.5}, - driver_eye_offset = {x=-4, y=0, z=0}, - number_of_passengers = 3, - passenger_attach_at = {x=3.5,y=3.7,z=-3.5}, - passenger_eye_offset = {x=4, y=0, z=0}, + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=3.5,y=3.7,z=3.5}, + driver_eye_offset = {x=-4, y=0, z=0}, + number_of_passengers = 3, + passenger_attach_at = {x=3.5,y=3.7,z=-3.5}, + passenger_eye_offset = {x=4, y=0, z=0}, - passenger2_attach_at = {x=-4,y=3.7,z=3.5}, - passenger2_eye_offset = {x=-4, y=3, z=0}, + passenger2_attach_at = {x=-4,y=3.7,z=3.5}, + passenger2_eye_offset = {x=-4, y=3, z=0}, - passenger3_attach_at = {x=-4,y=3.7,z=-3.5}, - passenger3_eye_offset = {x=4, y=3, z=0}, + passenger3_attach_at = {x=-4,y=3.7,z=-3.5}, + passenger3_eye_offset = {x=4, y=3, z=0}, - drop_on_destroy = {"vehicle_mash:tire 2", "vehicle_mash:windshield", - "vehicle_mash:battery", "vehicle_mash:motor"}, - } + drop_on_destroy = {"vehicle_mash:tire 2", "vehicle_mash:windshield", + "vehicle_mash:battery", "vehicle_mash:motor"}, +} - -- Cloud car (similar from the CAR01 from Vehicle Mash) - loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/car.lua")(table.copy(car_def)) -end +-- Cloud car (similar from the CAR01 from Vehicle Mash) +loadfile(minetest.get_modpath(minetest.get_current_modname()) .. "/car.lua")(table.copy(car_def)) ------------- -- Crafts -- diff --git a/mods/cloud_items/mod.conf b/mods/cloud_items/mod.conf index b176323f..daed9d59 100644 --- a/mods/cloud_items/mod.conf +++ b/mods/cloud_items/mod.conf @@ -1,6 +1,6 @@ name = cloud_items -depends = default, worldedit -optional_depends = 3d_armor, toolranks, stairs, moreblocks, multitools, vehicle_mash +depends = default, worldedit, vehicle_mash +optional_depends = 3d_armor, toolranks, stairs, moreblocks, multitools description = Adds powerful cloud tools for Minetest. min_minetest_version = 5.0.0 license = LGPLv2.1 diff --git a/mods/cloud_items/models/cloud_items_cloud_ship.obj b/mods/cloud_items/models/cloud_items_cloud_ship.obj new file mode 100644 index 00000000..f63228a5 --- /dev/null +++ b/mods/cloud_items/models/cloud_items_cloud_ship.obj @@ -0,0 +1,714 @@ +# Blender v2.90.0 OBJ File: 'cloud_ship.blend' +# www.blender.org +mtllib cloud_items_cloud_ship.mtl +o model.001 +v -2.622902 4.532114 25.737923 +v -2.622902 4.532117 18.585796 +v -9.775026 4.532117 18.585796 +v -9.775026 4.532114 25.737923 +v -2.622902 -2.620008 18.585794 +v -2.622902 -2.620012 25.737919 +v -9.775026 -2.620012 25.737919 +v -9.775026 -2.620008 18.585794 +v 4.529223 4.532114 25.737923 +v 4.529223 4.532117 18.585796 +v 4.529223 -2.620008 18.585794 +v 4.529223 -2.620012 25.737919 +v 11.681349 4.532114 25.737923 +v 11.681349 4.532117 18.585796 +v 11.681349 -2.620008 18.585794 +v 11.681349 -2.620012 25.737919 +v -9.775026 4.532120 11.433672 +v -16.927151 4.532120 11.433672 +v -16.927151 4.532117 18.585796 +v -9.775026 -2.620004 11.433670 +v -16.927151 -2.620008 18.585794 +v -16.927151 -2.620004 11.433670 +v -2.622902 -2.620004 11.433670 +v 4.529223 -2.620004 11.433670 +v 11.681349 -2.620004 11.433670 +v 18.833469 4.532117 18.585796 +v 18.833469 4.532120 11.433672 +v 11.681349 4.532120 11.433672 +v 18.833469 -2.620004 11.433670 +v 18.833469 -2.620008 18.585794 +v -2.622902 11.684240 18.585800 +v -2.622902 11.684244 11.433678 +v -9.775026 11.684244 11.433678 +v -9.775026 11.684240 18.585800 +v 4.529223 11.684240 18.585800 +v 4.529223 11.684244 11.433678 +v 11.681349 11.684240 18.585800 +v 11.681349 11.684244 11.433678 +v -16.927151 4.532124 4.281550 +v -24.079273 4.532124 4.281550 +v -24.079273 4.532120 11.433672 +v -16.927151 -2.620001 4.281545 +v -24.079273 -2.620004 11.433670 +v -24.079273 -2.620001 4.281545 +v -9.775026 -2.620001 4.281545 +v -2.622902 -2.620001 4.281545 +v 4.529223 -2.620001 4.281545 +v 11.681349 -2.620001 4.281545 +v 18.833469 -2.620001 4.281545 +v 25.985596 4.532120 11.433672 +v 25.985596 4.532124 4.281550 +v 18.833469 4.532124 4.281550 +v 25.985596 -2.620001 4.281545 +v 25.985596 -2.620004 11.433670 +v -9.775026 11.684248 4.281552 +v -16.927151 11.684248 4.281552 +v -16.927151 11.684244 11.433678 +v 18.833469 11.684244 11.433678 +v 18.833469 11.684248 4.281552 +v 11.681349 11.684248 4.281552 +v -2.622902 18.836369 11.433681 +v -2.622902 18.836372 4.281562 +v -9.775026 18.836372 4.281562 +v -9.775026 18.836369 11.433681 +v 4.529223 18.836369 11.433681 +v 4.529223 18.836372 4.281562 +v 11.681349 18.836369 11.433681 +v 11.681349 18.836372 4.281562 +v -16.927151 4.532135 -2.870575 +v -24.079273 4.532135 -2.870575 +v -16.927151 -2.619990 -2.870580 +v -24.079273 -2.619990 -2.870580 +v -9.775026 -2.619990 -2.870580 +v -2.622902 -2.619990 -2.870580 +v 4.529223 -2.619990 -2.870580 +v 11.681349 -2.619990 -2.870580 +v 18.833469 -2.619990 -2.870580 +v 25.985596 4.532135 -2.870575 +v 18.833469 4.532135 -2.870575 +v 25.985596 -2.619990 -2.870580 +v -9.775026 11.684258 -2.870574 +v -16.927151 11.684258 -2.870574 +v 18.833469 11.684258 -2.870574 +v 11.681349 11.684258 -2.870574 +v -2.622902 18.836382 -2.870563 +v -9.775026 18.836382 -2.870563 +v 4.529223 18.836382 -2.870563 +v 11.681349 18.836382 -2.870563 +v -16.927151 4.532138 -10.022700 +v -24.079273 4.532138 -10.022700 +v -16.927151 -2.619987 -10.022707 +v -24.079273 -2.619987 -10.022707 +v -9.775026 -2.619987 -10.022707 +v -2.622902 -2.619987 -10.022707 +v 4.529223 -2.619987 -10.022707 +v 11.681349 -2.619987 -10.022707 +v 18.833469 -2.619987 -10.022707 +v 25.985596 4.532138 -10.022700 +v 18.833469 4.532138 -10.022700 +v 25.985596 -2.619987 -10.022707 +v -9.775026 11.684261 -10.022699 +v -16.927151 11.684261 -10.022699 +v -9.775026 4.532138 -10.022700 +v 18.833469 11.684261 -10.022699 +v 11.681349 11.684261 -10.022699 +v 11.681349 4.532138 -10.022700 +v -2.622902 18.836386 -10.022689 +v -9.775026 18.836386 -10.022689 +v -2.622902 11.684261 -10.022699 +v 4.529223 18.836386 -10.022689 +v 4.529223 11.684261 -10.022699 +v 11.681349 18.836386 -10.022689 +v -9.775026 4.532141 -17.174822 +v -16.927151 4.532141 -17.174822 +v -9.775026 -2.619983 -17.174824 +v -16.927151 -2.619983 -17.174824 +v -2.622902 -2.619983 -17.174824 +v 4.529223 -2.619983 -17.174824 +v 11.681349 -2.619983 -17.174824 +v 18.833469 4.532141 -17.174822 +v 11.681349 4.532141 -17.174822 +v 18.833469 -2.619983 -17.174824 +v -2.622902 11.684265 -17.174822 +v -9.775026 11.684265 -17.174822 +v -2.622902 4.532141 -17.174822 +v 4.529223 11.684265 -17.174822 +v 4.529223 4.532141 -17.174822 +v 11.681349 11.684265 -17.174822 +v -2.622902 4.532145 -24.326946 +v -9.775026 4.532145 -24.326946 +v -2.622902 -2.619980 -24.326948 +v -9.775026 -2.619980 -24.326948 +v 4.529223 4.532145 -24.326946 +v 4.529223 -2.619980 -24.326948 +v 11.681349 4.532145 -24.326946 +v 11.681349 -2.619980 -24.326948 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 -1.0000 -0.0000 +vn -1.0000 -0.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +vn 1.0000 -0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +usemtl default_cloud.png.001 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 7/9/3 4/10/3 3/3/3 8/8/3 +f 6/11/4 1/12/4 4/13/4 7/14/4 +f 9/15/1 10/16/1 2/17/1 1/18/1 +f 11/19/2 12/20/2 6/21/2 5/22/2 +f 12/23/4 9/24/4 1/25/4 6/26/4 +f 13/27/1 14/28/1 10/29/1 9/30/1 +f 15/31/2 16/32/2 12/33/2 11/34/2 +f 15/31/5 14/28/5 13/35/5 16/36/5 +f 16/37/4 13/38/4 9/39/4 12/40/4 +f 3/41/1 17/42/1 18/43/1 19/44/1 +f 20/45/2 8/46/2 21/47/2 22/48/2 +f 21/49/3 19/50/3 18/43/3 22/48/3 +f 8/51/4 3/52/4 19/53/4 21/54/4 +f 23/55/2 5/56/2 8/57/2 20/58/2 +f 24/59/2 11/60/2 5/61/2 23/62/2 +f 25/63/2 15/64/2 11/65/2 24/66/2 +f 26/67/1 27/68/1 28/69/1 14/70/1 +f 29/71/2 30/72/2 15/73/2 25/74/2 +f 29/71/5 27/68/5 26/75/5 30/76/5 +f 30/77/4 26/78/4 14/79/4 15/80/4 +f 31/81/1 32/82/1 33/83/1 34/84/1 +f 3/41/3 34/85/3 33/83/3 17/86/3 +f 2/87/4 31/88/4 34/89/4 3/90/4 +f 35/91/1 36/92/1 32/93/1 31/94/1 +f 10/95/4 35/96/4 31/97/4 2/98/4 +f 37/99/1 38/100/1 36/101/1 35/102/1 +f 28/103/5 38/100/5 37/104/5 14/70/5 +f 14/105/4 37/106/4 35/107/4 10/108/4 +f 18/109/1 39/110/1 40/111/1 41/112/1 +f 42/113/2 22/114/2 43/115/2 44/116/2 +f 43/117/3 41/118/3 40/111/3 44/116/3 +f 22/119/4 18/120/4 41/121/4 43/122/4 +f 45/123/2 20/124/2 22/125/2 42/126/2 +f 46/127/2 23/128/2 20/129/2 45/130/2 +f 47/131/2 24/132/2 23/133/2 46/134/2 +f 48/135/2 25/136/2 24/137/2 47/138/2 +f 49/139/2 29/140/2 25/141/2 48/142/2 +f 50/143/1 51/144/1 52/145/1 27/146/1 +f 53/147/2 54/148/2 29/149/2 49/150/2 +f 53/147/5 51/144/5 50/151/5 54/152/5 +f 54/153/4 50/154/4 27/155/4 29/156/4 +f 33/157/1 55/158/1 56/159/1 57/160/1 +f 18/109/3 57/161/3 56/159/3 39/162/3 +f 17/163/4 33/164/4 57/165/4 18/166/4 +f 58/167/1 59/168/1 60/169/1 38/170/1 +f 52/171/5 59/168/5 58/172/5 27/146/5 +f 27/173/4 58/174/4 38/175/4 28/176/4 +f 61/177/1 62/178/1 63/179/1 64/180/1 +f 33/157/3 64/181/3 63/179/3 55/182/3 +f 32/183/4 61/184/4 64/185/4 33/186/4 +f 65/187/1 66/188/1 62/189/1 61/190/1 +f 36/191/4 65/192/4 61/193/4 32/194/4 +f 67/195/1 68/196/1 66/197/1 65/198/1 +f 60/199/5 68/196/5 67/200/5 38/170/5 +f 38/201/4 67/202/4 65/203/4 36/204/4 +f 39/205/1 69/206/1 70/207/1 40/208/1 +f 71/209/2 42/210/2 44/211/2 72/212/2 +f 44/213/3 40/214/3 70/207/3 72/212/3 +f 73/215/2 45/216/2 42/217/2 71/218/2 +f 74/219/2 46/220/2 45/221/2 73/222/2 +f 75/223/2 47/224/2 46/225/2 74/226/2 +f 76/227/2 48/228/2 47/229/2 75/230/2 +f 77/231/2 49/232/2 48/233/2 76/234/2 +f 51/235/1 78/236/1 79/237/1 52/238/1 +f 80/239/2 53/240/2 49/241/2 77/242/2 +f 80/239/5 78/236/5 51/243/5 53/244/5 +f 55/245/1 81/246/1 82/247/1 56/248/1 +f 39/205/3 56/249/3 82/247/3 69/250/3 +f 59/251/1 83/252/1 84/253/1 60/254/1 +f 79/255/5 83/252/5 59/256/5 52/238/5 +f 62/257/1 85/258/1 86/259/1 63/260/1 +f 55/245/3 63/261/3 86/259/3 81/262/3 +f 66/263/1 87/264/1 85/265/1 62/266/1 +f 68/267/1 88/268/1 87/269/1 66/270/1 +f 84/271/5 88/268/5 68/272/5 60/254/5 +f 69/273/1 89/274/1 90/275/1 70/276/1 +f 91/277/2 71/278/2 72/279/2 92/280/2 +f 72/281/3 70/282/3 90/275/3 92/280/3 +f 92/283/6 90/284/6 89/285/6 91/286/6 +f 93/287/2 73/288/2 71/289/2 91/286/2 +f 94/290/2 74/291/2 73/292/2 93/293/2 +f 95/294/2 75/295/2 74/296/2 94/297/2 +f 96/298/2 76/299/2 75/300/2 95/301/2 +f 97/302/2 77/303/2 76/304/2 96/305/2 +f 78/306/1 98/307/1 99/308/1 79/309/1 +f 100/310/2 80/311/2 77/312/2 97/313/2 +f 100/310/5 98/307/5 78/314/5 80/315/5 +f 97/302/6 99/316/6 98/317/6 100/318/6 +f 81/319/1 101/320/1 102/321/1 82/322/1 +f 69/273/3 82/323/3 102/321/3 89/324/3 +f 89/325/6 102/326/6 101/327/6 103/328/6 +f 83/329/1 104/330/1 105/331/1 84/332/1 +f 99/333/5 104/330/5 83/334/5 79/309/5 +f 106/335/6 105/336/6 104/337/6 99/338/6 +f 85/339/1 107/340/1 108/341/1 86/342/1 +f 81/319/3 86/343/3 108/341/3 101/344/3 +f 101/345/6 108/346/6 107/347/6 109/348/6 +f 87/349/1 110/350/1 107/347/1 85/351/1 +f 109/352/6 107/340/6 110/353/6 111/354/6 +f 88/355/1 112/356/1 110/353/1 87/357/1 +f 105/358/5 112/356/5 88/359/5 84/332/5 +f 111/360/6 110/350/6 112/361/6 105/362/6 +f 103/363/1 113/364/1 114/365/1 89/324/1 +f 115/366/2 93/367/2 91/368/2 116/369/2 +f 91/277/3 89/274/3 114/365/3 116/369/3 +f 116/370/6 114/371/6 113/372/6 115/373/6 +f 117/374/2 94/375/2 93/376/2 115/373/2 +f 118/377/2 95/378/2 94/379/2 117/380/2 +f 119/381/2 96/382/2 95/383/2 118/384/2 +f 99/333/1 120/385/1 121/386/1 106/387/1 +f 122/388/2 97/389/2 96/390/2 119/391/2 +f 122/388/5 120/385/5 99/308/5 97/313/5 +f 119/381/6 121/392/6 120/393/6 122/394/6 +f 109/352/1 123/395/1 124/396/1 101/344/1 +f 103/363/3 101/320/3 124/396/3 113/397/3 +f 113/398/6 124/399/6 123/400/6 125/401/6 +f 111/360/1 126/402/1 123/400/1 109/348/1 +f 125/403/6 123/395/6 126/404/6 127/405/6 +f 105/358/1 128/406/1 126/404/1 111/354/1 +f 121/407/5 128/406/5 105/331/5 106/387/5 +f 127/408/6 126/402/6 128/409/6 121/410/6 +f 125/403/1 129/411/1 130/412/1 113/397/1 +f 131/413/2 117/414/2 115/415/2 132/416/2 +f 115/366/3 113/364/3 130/412/3 132/416/3 +f 132/417/6 130/418/6 129/419/6 131/420/6 +f 127/408/1 133/421/1 129/419/1 125/401/1 +f 134/422/2 118/423/2 117/424/2 131/420/2 +f 131/413/6 129/411/6 133/425/6 134/426/6 +f 121/407/1 135/427/1 133/425/1 127/405/1 +f 136/428/2 119/429/2 118/430/2 134/426/2 +f 136/428/5 135/427/5 121/386/5 119/391/5 +f 134/422/6 133/421/6 135/431/6 136/432/6 diff --git a/mods/cloud_items/ship.lua b/mods/cloud_items/ship.lua new file mode 100644 index 00000000..f1c79e49 --- /dev/null +++ b/mods/cloud_items/ship.lua @@ -0,0 +1,18 @@ +-- Code from the Vehicle Mash mod (WTFPL license) +local name = "cloud_ship" +local definition = ... + +definition.description = "Cloud ship" +definition.inventory_image = "cloud_items_cloud_ship_inventory.png" +definition.wield_image = "cloud_items_cloud_ship_inventory.png" +definition.mesh = "cloud_items_cloud_ship.obj" +definition.drop_on_destroy = {"cloud_items:cloudblock", "cloud_items:cloud_ingot 2"} +definition.can_go_down = true +definition.can_go_up = true +definition.recipe = { + {"cloud_items:cloud_ingot", "cloud_items:cloudblock", "cloud_items:cloud_ingot"}, + {"cloud_items:cloudblock", "cloud_items:cloudblock", "cloud_items:cloudblock"}, + {"cloud_items:cloud_ingot", "cloud_items:cloudblock", "cloud_items:cloud_ingot"} +} + +vehicle_mash.register_vehicle("cloud_items:" .. name, definition) diff --git a/mods/cloud_items/textures/cloud_items_cloud_ship_inventory.png b/mods/cloud_items/textures/cloud_items_cloud_ship_inventory.png new file mode 100644 index 00000000..34e24960 Binary files /dev/null and b/mods/cloud_items/textures/cloud_items_cloud_ship_inventory.png differ diff --git a/mods/homedecor_modpack/homedecor_electrical/init.lua b/mods/homedecor_modpack/homedecor_electrical/init.lua index cefa1861..fd77b710 100644 --- a/mods/homedecor_modpack/homedecor_electrical/init.lua +++ b/mods/homedecor_modpack/homedecor_electrical/init.lua @@ -161,7 +161,7 @@ minetest.register_craft( { minetest.register_craft( { output = "homedecor:doorbell", recipe = { - { "homedecor:light_switch", "basic_materials:energy_crystal_simple", "homedecor:speaker_driver" } + { "homedecor:light_switch_off", "basic_materials:energy_crystal_simple", "homedecor:speaker_driver" } }, }) diff --git a/mods/homedecor_modpack/homedecor_lighting/init.lua b/mods/homedecor_modpack/homedecor_lighting/init.lua index d072f72c..2edd3f8e 100644 --- a/mods/homedecor_modpack/homedecor_lighting/init.lua +++ b/mods/homedecor_modpack/homedecor_lighting/init.lua @@ -27,19 +27,20 @@ local word_to_bright = { } local rules_alldir = { - {x = 0, y = 0, z = -1}, -- borrowed from lightstones - {x = 1, y = 0, z = 0}, - {x = -1, y = 0, z = 0}, {x = 0, y = 0, z = 1}, - {x = 1, y = 1, z = 0}, - {x = 1, y = -1, z = 0}, - {x = -1, y = 1, z = 0}, - {x = -1, y = -1, z = 0}, + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}, -- borrowed from lightstones {x = 0, y = 1, z = 1}, - {x = 0, y = -1, z = 1}, + {x = -1, y = 1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 1, y = 1, z = 0}, {x = 0, y = 1, z = -1}, - {x = 0, y = -1, z = -1}, + {x = 0, y = -1, z = 1}, + {x = -1, y = -1, z = 0}, {x = 0, y = -1, z = 0}, + {x = 1, y = -1, z = 0}, + {x = 0, y = -1, z = -1}, } -- mesecons compatibility diff --git a/mods/moretrees/biome_defs.lua b/mods/moretrees/biome_defs.lua index c080ed01..e54f7bab 100644 --- a/mods/moretrees/biome_defs.lua +++ b/mods/moretrees/biome_defs.lua @@ -177,6 +177,7 @@ moretrees.cedar_biome = { avoid_nodes = moretrees.avoidnodes, avoid_radius = 10, seed_diff = 336, + min_elevation = 0, --Added to solve an issue where cedar trees would sometimes spawn deep underground near_nodes = {"default:water_source"}, near_nodes_size = 15, near_nodes_count = 5, diff --git a/mods/skinsdb/meta/character_1927.txt b/mods/skinsdb/meta/character_1927.txt new file mode 100644 index 00000000..080aa492 --- /dev/null +++ b/mods/skinsdb/meta/character_1927.txt @@ -0,0 +1,3 @@ +Tails_The_Fox +Tails +CC BY-SA 3.0 diff --git a/mods/skinsdb/textures/character_1927.png b/mods/skinsdb/textures/character_1927.png new file mode 100644 index 00000000..0cfc2ecc Binary files /dev/null and b/mods/skinsdb/textures/character_1927.png differ diff --git a/mods/techpack/COPYING.txt b/mods/techpack/COPYING.txt deleted file mode 100644 index 68beccdc..00000000 --- a/mods/techpack/COPYING.txt +++ /dev/null @@ -1,28 +0,0 @@ -The TechPack Modpack for Minetest is - -Copyright (C) 2017-2018 Joachim Stolberg - -License of source code ----------------------- - -This program is free software; you can redistribute and/or -modify it under the terms of the GNU Lesser General Public License version 2.1 or later -published by the Free Software Foundation. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the -Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -Boston, MA 02110-1301, USA. - - -License of media (textures, sounds and documentation) ------------------------------------------------------ - -All textures, sounds and documentation files are licensed under the -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/mods/techpack/LICENSE.txt b/mods/techpack/LICENSE.txt index 4362b491..2beb9e16 100644 --- a/mods/techpack/LICENSE.txt +++ b/mods/techpack/LICENSE.txt @@ -1,502 +1,662 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +modification follow. - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". + TERMS AND CONDITIONS - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. + 0. Definitions. - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) + "This License" refers to version 3 of the GNU Affero General Public License. - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + A "covered work" means either the unmodified Program or a work based +on the Program. - a) The modified work must itself be a software library. + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. + 1. Source Code. - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. + The Corresponding Source for a work in source code form is that +same work. - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. + 2. Basic Permissions. - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: + 4. Conveying Verbatim Copies. - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. + 5. Conveying Modified Source Versions. - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. + 6. Conveying Non-Source Forms. - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. + 13. Remote Network Interaction; Use with the GNU General Public License. -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. + 14. Revised Versions of this License. - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. - NO WARRANTY + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). + How to Apply These Terms to Your New Programs - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. - + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + Copyright (C) - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/mods/techpack/README.md b/mods/techpack/README.md index 73369bf6..809f7f9d 100644 --- a/mods/techpack/README.md +++ b/mods/techpack/README.md @@ -1,4 +1,4 @@ -# TechPack V2.03 +# TechPack V2.04 TechPack, a Mining, Crafting, & Farming Modpack for Minetest. @@ -115,8 +115,8 @@ The value 200 (default) results in a lifetime for standard machines of about 200 ### License Copyright (C) 2017-2020 Joachim Stolberg -Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt -Textures: CC BY-SA 3.0 +Code: Licensed under the GNU AGPL version 3 or later. See LICENSE.txt +Textures: CC BY-SA 3.0 ### Dependencies @@ -151,6 +151,7 @@ tubelib_addons1 optional: unified_inventory - 2019-01-27 V2.01 * SaferLua Controller Terminal added - 2019-01-28 V2.02 * Logic Not added, output reduction on Harvester, Fermenter, and Gravel Sieve - 2019-04-23 V2.03 * Piston/WorldEdit/replacer detection added, farming and grinder recipes added +- 2020-11-20 V2.04 * Switch to AGPL v3, adapt to minetest 5.3, add translation support, fix minor bugs ## New in v2 (from players point of view) diff --git a/mods/techpack/gravelsieve/hammer.lua b/mods/techpack/gravelsieve/hammer.lua index bcd82147..caecb349 100644 --- a/mods/techpack/gravelsieve/hammer.lua +++ b/mods/techpack/gravelsieve/hammer.lua @@ -5,6 +5,8 @@ ]]-- +-- Load support for I18n +local S = gravelsieve.S gravelsieve.disallow = function(pos, node, user, mode, new_param2) return false @@ -40,7 +42,7 @@ gravelsieve.handler = function(itemstack, user, pointed_thing) end minetest.register_tool("gravelsieve:hammer", { - description = "Hammer converts Cobblestone into Gravel", + description = S("Hammer converts Cobblestone into Gravel"), inventory_image = "gravelsieve_hammer.png", on_use = function(itemstack, user, pointed_thing) return gravelsieve.handler(itemstack, user, pointed_thing) diff --git a/mods/techpack/gravelsieve/init.lua b/mods/techpack/gravelsieve/init.lua index 7fbe74d7..b9c02619 100644 --- a/mods/techpack/gravelsieve/init.lua +++ b/mods/techpack/gravelsieve/init.lua @@ -7,11 +7,11 @@ Derived from the work of celeron55, Perttu Ahola (furnace) Pipeworks support added by FiftySix - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg Copyright (C) 2011-2016 celeron55, Perttu Ahola Copyright (C) 2011-2016 Various Minetest developers and contributors - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information History: @@ -42,6 +42,10 @@ gravelsieve = { } +-- Load support for I18n +gravelsieve.S = minetest.get_translator("gravelsieve") +local S = gravelsieve.S + dofile(minetest.get_modpath("gravelsieve") .. "/hammer.lua") local settings_get @@ -320,7 +324,7 @@ for idx = 0,4 do local tube_info if automatic == 0 then node_name = "gravelsieve:sieve" - description = "Gravel Sieve" + description = S("Gravel Sieve") tiles_data = { -- up, down, right, left, back, front "gravelsieve_gravel.png", @@ -332,7 +336,7 @@ for idx = 0,4 do } else node_name = "gravelsieve:auto_sieve" - description = "Automatic Gravel Sieve" + description = S("Automatic Gravel Sieve") tiles_data = { -- up, down, right, left, back, front "gravelsieve_gravel.png", @@ -366,6 +370,7 @@ for idx = 0,4 do } end + local not_in_creative_inventory if idx == 3 then tiles_data[1] = "gravelsieve_top.png" not_in_creative_inventory = 0 @@ -522,7 +527,7 @@ if minetest.global_exists("tubelib") then after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Gravel Sieve") + meta:set_string("infotext", S("Gravel Sieve")) end, on_dig = function(pos, node, puncher, pointed_thing) @@ -581,14 +586,14 @@ if minetest.global_exists("tubelib") then end minetest.register_node("gravelsieve:sieved_gravel", { - description = "Sieved Gravel", + description = S("Sieved Gravel"), tiles = {"default_gravel.png"}, groups = {crumbly=2, falling_node=1, not_in_creative_inventory=1}, sounds = default.node_sound_gravel_defaults(), }) minetest.register_node("gravelsieve:compressed_gravel", { - description = "Compressed Gravel", + description = S("Compressed Gravel"), tiles = {"gravelsieve_compressed_gravel.png"}, groups = {cracky=2, crumbly = 2, cracky = 2}, sounds = default.node_sound_gravel_defaults(), @@ -654,7 +659,7 @@ end if minetest.get_modpath("moreblocks") then stairsplus:register_all("gravelsieve", "compressed_gravel", "gravelsieve:compressed_gravel", { - description="Compressed Gravel", + description=S("Compressed Gravel"), groups={cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1}, tiles = {"gravelsieve_compressed_gravel.png"}, sounds = default.node_sound_stone_defaults(), diff --git a/mods/techpack/gravelsieve/locale/gravelsieve.de.tr b/mods/techpack/gravelsieve/locale/gravelsieve.de.tr new file mode 100644 index 00000000..71d7ee2a --- /dev/null +++ b/mods/techpack/gravelsieve/locale/gravelsieve.de.tr @@ -0,0 +1,14 @@ +# textdomain: gravelsieve + + + +### hammer.lua ### + +Hammer converts Cobblestone into Gravel=Hammer, Zertrümmert Pflasterstein in Kies + +### init.lua ### + +Automatic Gravel Sieve=Automatisches Kiessieb +Compressed Gravel=Komprimiertes Kies +Gravel Sieve=Kiessieb +Sieved Gravel=Gesiebtes Kies diff --git a/mods/techpack/gravelsieve/locale/template.txt b/mods/techpack/gravelsieve/locale/template.txt new file mode 100644 index 00000000..bc128d53 --- /dev/null +++ b/mods/techpack/gravelsieve/locale/template.txt @@ -0,0 +1,14 @@ +# textdomain: gravelsieve + + + +### hammer.lua ### + +Hammer converts Cobblestone into Gravel= + +### init.lua ### + +Automatic Gravel Sieve= +Compressed Gravel= +Gravel Sieve= +Sieved Gravel= diff --git a/mods/techpack/i18n.py b/mods/techpack/i18n.py new file mode 100644 index 00000000..93938d4c --- /dev/null +++ b/mods/techpack/i18n.py @@ -0,0 +1,450 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ +# +# See https://github.com/minetest-tools/update_translations for +# potential future updates to this script. + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv +from sys import stderr as _stderr + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [], + "no-old-file": False +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'], + "no-old-file": ['--no-old-file'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["no-old-file"])} + do not create *.old files + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua_s = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_fs = re.compile(r'[\.=^\t,{\(\s]N?FS\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed_s = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) +pattern_lua_bracketed_fs = re.compile(r'[\.=^\t,{\(\s]N?FS\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.*?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name, header_comments): + lOut = [f"# textdomain: {mod_name}\n"] + if header_comments is not None: + lOut.append(header_comments) + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name, existing_template[2]) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua_s.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed_s.findall(text): + strings.append(s) + for s in pattern_lua_fs.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed_fs.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +# Returns also header comments in the third return value. +def import_tr_file(tr_file): + dOut = {} + text = None + header_comment = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + if header_comment is None: + # Save header comments + header_comment = latest_comment_block + # Stip textdomain line + tmp_h_c = "" + for l in header_comment.split('\n'): + if not l.startswith("# textdomain:"): + tmp_h_c += l + '\n' + header_comment = tmp_h_c + + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text, header_comment) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name, tr_import[2]) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + if not params["no-old-file"]: + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + print(folder) + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print(f"\033[31mUnable to find modname in folder {folder}.\033[0m", file=_stderr) + #exit(1) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() + diff --git a/mods/techpack/lcdlib/mod.conf b/mods/techpack/lcdlib/mod.conf new file mode 100644 index 00000000..57e9be76 --- /dev/null +++ b/mods/techpack/lcdlib/mod.conf @@ -0,0 +1 @@ +name=lcdlib diff --git a/mods/techpack/releasenotes.md b/mods/techpack/releasenotes.md index 08a1fac1..050ba076 100644 --- a/mods/techpack/releasenotes.md +++ b/mods/techpack/releasenotes.md @@ -2,6 +2,23 @@ +## V2.04.00 (2020-11-20) + +### Additions +- Add minetest.translator support (issue #56) +- Add German translation +- Add new minetest v5 nodes + +### Removals + +### Changes +- Switch from LGPL to AGPL v3 + +### Fixes +- tubelib_addons2:doorblock works incorrectly (issue #55) + + + ## V2.03.12 (2020-07-23) ### Additions diff --git a/mods/techpack/safer_lua/data_struct.lua b/mods/techpack/safer_lua/data_struct.lua index 03bbe825..258c4ef8 100644 --- a/mods/techpack/safer_lua/data_struct.lua +++ b/mods/techpack/safer_lua/data_struct.lua @@ -3,9 +3,9 @@ SaferLua [safer_lua] ==================== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information data_struct.lua: diff --git a/mods/techpack/safer_lua/environ.lua b/mods/techpack/safer_lua/environ.lua index fe16bafc..ad439151 100644 --- a/mods/techpack/safer_lua/environ.lua +++ b/mods/techpack/safer_lua/environ.lua @@ -3,9 +3,9 @@ SaferLua [safer_lua] ==================== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information environ.lua: diff --git a/mods/techpack/safer_lua/init.lua b/mods/techpack/safer_lua/init.lua index f5e75aa0..21eed081 100644 --- a/mods/techpack/safer_lua/init.lua +++ b/mods/techpack/safer_lua/init.lua @@ -3,9 +3,9 @@ SaferLua [safer_lua] ==================== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information environ.lua: diff --git a/mods/techpack/safer_lua/scanner.lua b/mods/techpack/safer_lua/scanner.lua index 54817e27..fdd39aaa 100644 --- a/mods/techpack/safer_lua/scanner.lua +++ b/mods/techpack/safer_lua/scanner.lua @@ -3,9 +3,9 @@ SaferLua [safer_lua] ==================== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information scanner.lua: diff --git a/mods/techpack/sl_controller/battery.lua b/mods/techpack/sl_controller/battery.lua index c9def62c..1109dc81 100644 --- a/mods/techpack/sl_controller/battery.lua +++ b/mods/techpack/sl_controller/battery.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information battery.lua: diff --git a/mods/techpack/sl_controller/commands.lua b/mods/techpack/sl_controller/commands.lua index ca159b57..637fc528 100644 --- a/mods/techpack/sl_controller/commands.lua +++ b/mods/techpack/sl_controller/commands.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information commands.lua: diff --git a/mods/techpack/sl_controller/controller.lua b/mods/techpack/sl_controller/controller.lua index 8c30f7a3..2ee0bacb 100644 --- a/mods/techpack/sl_controller/controller.lua +++ b/mods/techpack/sl_controller/controller.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information controller.lua: diff --git a/mods/techpack/sl_controller/init.lua b/mods/techpack/sl_controller/init.lua index a5714762..75cf8cc3 100644 --- a/mods/techpack/sl_controller/init.lua +++ b/mods/techpack/sl_controller/init.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- @@ -17,4 +17,4 @@ dofile(minetest.get_modpath("sl_controller") .. "/controller.lua") dofile(minetest.get_modpath("sl_controller") .. "/commands.lua") dofile(minetest.get_modpath("sl_controller") .. "/battery.lua") dofile(minetest.get_modpath("sl_controller") .. "/server.lua") -dofile(minetest.get_modpath("sl_controller") .. "/terminal.lua") \ No newline at end of file +dofile(minetest.get_modpath("sl_controller") .. "/terminal.lua") diff --git a/mods/techpack/sl_controller/server.lua b/mods/techpack/sl_controller/server.lua index 01178a9a..9089af5b 100644 --- a/mods/techpack/sl_controller/server.lua +++ b/mods/techpack/sl_controller/server.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information server.lua: diff --git a/mods/techpack/sl_controller/terminal.lua b/mods/techpack/sl_controller/terminal.lua index 552fb67b..7c9a4854 100644 --- a/mods/techpack/sl_controller/terminal.lua +++ b/mods/techpack/sl_controller/terminal.lua @@ -3,9 +3,9 @@ sl_controller ============= - Copyright (C) 2018-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information terminal.lua: diff --git a/mods/techpack/smartline/button.lua b/mods/techpack/smartline/button.lua index 6b2b087a..f8f837af 100644 --- a/mods/techpack/smartline/button.lua +++ b/mods/techpack/smartline/button.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information button.lua: @@ -13,9 +13,11 @@ ]]-- +-- Load support for I18n +local S = smartline.S local function switch_on(pos, node) - if tubelib.data_not_corrupted(pos) then + if tubelib.data_not_corrupted(pos, true) then node.name = "smartline:button_active" minetest.swap_node(pos, node) minetest.sound_play("button", { @@ -40,7 +42,7 @@ local function switch_on(pos, node) end local function switch_off(pos) - if tubelib.data_not_corrupted(pos) then + if tubelib.data_not_corrupted(pos, true) then local node = minetest.get_node(pos) node.name = "smartline:button" minetest.swap_node(pos, node) @@ -64,7 +66,7 @@ end minetest.register_node("smartline:button", { - description = "SmartLine Button/Switch", + description = S("SmartLine Button/Switch"), inventory_image = "smartline_button_inventory.png", tiles = { -- up, down, right, left, back, front @@ -89,22 +91,23 @@ minetest.register_node("smartline:button", { local own_num = tubelib.add_node(pos, "smartline:button") meta:set_string("own_num", own_num) meta:set_string("formspec", "size[5,6]".. - "dropdown[0.2,0;3;type;switch,button 2s,button 4s,button 8s,button 16s;1]".. - "field[0.5,2;3,1;numbers;Insert destination block number(s);]" .. + "dropdown[0.2,0;3;type;"..S("switch,button 2s,button 4s,button 8s,button 16s")..";1]".. + "field[0.5,2;3,1;numbers;"..S("Insert destination block number(s)")..";]" .. "checkbox[1,3;public;public;false]".. - "button_exit[1,4;2,1;exit;Save]") + "button_exit[1,4;2,1;exit;"..S("Save").."]") meta:set_string("placer_name", placer:get_player_name()) meta:set_string("public", "false") meta:set_int("cycle_time", 0) - meta:set_string("infotext", "SmartLine Button "..own_num) + meta:set_string("infotext", S("SmartLine Button").." "..own_num) end, on_receive_fields = function(pos, formname, fields, player) local meta = minetest.get_meta(pos) + print(dump(fields)) if tubelib.check_numbers(fields.numbers) then meta:set_string("numbers", fields.numbers) local own_num = meta:get_string("own_num") - meta:set_string("infotext", "SmartLine Button "..own_num..", connected with block "..fields.numbers) + meta:set_string("infotext", S("SmartLine Button").." "..own_num..", "..S("connected with block").." "..fields.numbers) else return end @@ -153,7 +156,7 @@ minetest.register_node("smartline:button", { minetest.register_node("smartline:button_active", { - description = "SmartLine Button/Switch", + description = S("SmartLine Button/Switch"), tiles = { -- up, down, right, left, back, front "smartline.png", diff --git a/mods/techpack/smartline/collector.lua b/mods/techpack/smartline/collector.lua index d307d0db..754018d4 100644 --- a/mods/techpack/smartline/collector.lua +++ b/mods/techpack/smartline/collector.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information collector.lua: @@ -14,6 +14,9 @@ ]]-- +-- Load support for I18n +local S = smartline.S + local CYCLE_TIME = 1 local tStates = {stopped = 0, running = 0, standby = 1, blocked = 2, fault = 3, defect = 4} @@ -30,11 +33,11 @@ local function formspec(meta) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "field[0.3,0.6;9,1;poll_numbers;Node numbers to read the states from:;"..poll_numbers.."]" .. - "field[0.3,2;9,1;event_number;Node number to send the events to:;"..event_number.."]" .. - "label[1.3,2.8;Send an event if state is equal or larget than:]".. + "field[0.3,0.6;9,1;poll_numbers;"..S("Node numbers to read the states from:")..";"..poll_numbers.."]" .. + "field[0.3,2;9,1;event_number;"..S("Node number to send the events to:")..";"..event_number.."]" .. + "label[1.3,2.8;"..S("Send an event if state is equal or larget than:").."]".. "dropdown[1.2,3.4;7,4;severity;1 standby,2 blocked,3 fault,4 defect;"..dropdown_pos.."]".. - "button_exit[3,5;2,1;exit;Save]" + "button_exit[3,5;2,1;exit;"..S("Save").."]" end @@ -50,7 +53,7 @@ local function send_event(meta) else tubelib.send_message(event_number, owner, nil, "off", own_number) end - meta:set_string("infotext", "SmartLine State Collector "..own_number..': "'..lStates[state]..'"') + meta:set_string("infotext", S("SmartLine State Collector").." "..own_number..': "'..lStates[state]..'"') meta:set_int("stored_state", state) meta:set_int("state", 0) end @@ -74,7 +77,7 @@ local function on_timer(pos,elapsed) if poll_numbers == "" then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "SmartLine State Collector "..own_number..": stopped") + meta:set_string("infotext", S("SmartLine State Collector").." "..own_number..": stopped") meta:set_int("state", 0) meta:set_int("stored_state", 0) return false @@ -94,7 +97,7 @@ local function on_timer(pos,elapsed) end minetest.register_node("smartline:collector", { - description = "SmartLine State Collector", + description = S("SmartLine State Collector"), inventory_image = "smartline_collector_inventory.png", tiles = { -- up, down, right, left, back, front @@ -121,7 +124,7 @@ minetest.register_node("smartline:collector", { meta:set_string("poll_numbers", "") meta:set_string("event_number", "") meta:set_string("formspec", formspec(meta)) - meta:set_string("infotext", "SmartLine State Collector "..own_number) + meta:set_string("infotext", S("SmartLine State Collector").." "..own_number) meta:set_string("owner", placer:get_player_name()) end, @@ -145,7 +148,7 @@ minetest.register_node("smartline:collector", { if not timer:is_started() then timer:start(CYCLE_TIME) end - meta:set_string("infotext", "SmartLine State Collector "..own_number..": running") + meta:set_string("infotext", S("SmartLine State Collector").." "..own_number..": running") else if timer:is_started() then timer:stop() diff --git a/mods/techpack/smartline/commands.lua b/mods/techpack/smartline/commands.lua index 4c054bbd..8f577546 100644 --- a/mods/techpack/smartline/commands.lua +++ b/mods/techpack/smartline/commands.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information command.lua: diff --git a/mods/techpack/smartline/controller.lua b/mods/techpack/smartline/controller.lua index 1d4b6da8..0e0513d5 100644 --- a/mods/techpack/smartline/controller.lua +++ b/mods/techpack/smartline/controller.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information controller.lua: diff --git a/mods/techpack/smartline/display.lua b/mods/techpack/smartline/display.lua index 62d8b267..8f5b14e4 100644 --- a/mods/techpack/smartline/display.lua +++ b/mods/techpack/smartline/display.lua @@ -3,15 +3,17 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information display.lua: ]]-- +-- Load support for I18n +local S = smartline.S lcdlib.register_display_entity("smartline:entity") @@ -42,7 +44,7 @@ local lcd_box = { } minetest.register_node("smartline:display", { - description = "SmartLine Display", + description = S("SmartLine Display"), inventory_image = 'smartline_display_inventory.png', tiles = {"smartline_display.png"}, drawtype = "nodebox", diff --git a/mods/techpack/smartline/icta/action.lua b/mods/techpack/smartline/icta/action.lua index 7bcfc9a1..6e68bcac 100644 --- a/mods/techpack/smartline/icta/action.lua +++ b/mods/techpack/smartline/icta/action.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information action.lua diff --git a/mods/techpack/smartline/icta/balancer.lua b/mods/techpack/smartline/icta/balancer.lua index 34fe5a75..639abefb 100644 --- a/mods/techpack/smartline/icta/balancer.lua +++ b/mods/techpack/smartline/icta/balancer.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information balancer.lua diff --git a/mods/techpack/smartline/icta/battery.lua b/mods/techpack/smartline/icta/battery.lua index cca063c8..f50c1fd9 100644 --- a/mods/techpack/smartline/icta/battery.lua +++ b/mods/techpack/smartline/icta/battery.lua @@ -3,9 +3,9 @@ ICTA Controller =============== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information battery.lua diff --git a/mods/techpack/smartline/icta/commands.lua b/mods/techpack/smartline/icta/commands.lua index 16119ce6..1fb682f1 100644 --- a/mods/techpack/smartline/icta/commands.lua +++ b/mods/techpack/smartline/icta/commands.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information command.lua: diff --git a/mods/techpack/smartline/icta/condition.lua b/mods/techpack/smartline/icta/condition.lua index 4a2c92d6..51857102 100644 --- a/mods/techpack/smartline/icta/condition.lua +++ b/mods/techpack/smartline/icta/condition.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information condition.lua diff --git a/mods/techpack/smartline/icta/controller.lua b/mods/techpack/smartline/icta/controller.lua index 661553f4..44c4825d 100644 --- a/mods/techpack/smartline/icta/controller.lua +++ b/mods/techpack/smartline/icta/controller.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information controller.lua diff --git a/mods/techpack/smartline/icta/edit.lua b/mods/techpack/smartline/icta/edit.lua index 3e04ccbf..290bce6c 100644 --- a/mods/techpack/smartline/icta/edit.lua +++ b/mods/techpack/smartline/icta/edit.lua @@ -3,9 +3,9 @@ ICTA Controller =============== - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information edit.lua diff --git a/mods/techpack/smartline/icta/formspec.lua b/mods/techpack/smartline/icta/formspec.lua index 19f019c3..b25d13a8 100644 --- a/mods/techpack/smartline/icta/formspec.lua +++ b/mods/techpack/smartline/icta/formspec.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information formspec.lua: diff --git a/mods/techpack/smartline/icta/stopwatch.lua b/mods/techpack/smartline/icta/stopwatch.lua index 67d18fdf..93b1f5a3 100644 --- a/mods/techpack/smartline/icta/stopwatch.lua +++ b/mods/techpack/smartline/icta/stopwatch.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information stopwatch.lua diff --git a/mods/techpack/smartline/icta/submenu.lua b/mods/techpack/smartline/icta/submenu.lua index bb547ead..0719042f 100644 --- a/mods/techpack/smartline/icta/submenu.lua +++ b/mods/techpack/smartline/icta/submenu.lua @@ -5,9 +5,9 @@ Part of the SmartLine mod - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information submenu.lua diff --git a/mods/techpack/smartline/init.lua b/mods/techpack/smartline/init.lua index bd6f43a1..3c13f134 100644 --- a/mods/techpack/smartline/init.lua +++ b/mods/techpack/smartline/init.lua @@ -3,15 +3,18 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- smartline = {} +-- Load support for I18n +smartline.S = minetest.get_translator("smartline") + local MP = minetest.get_modpath("smartline") dofile(MP.."/display.lua") diff --git a/mods/techpack/smartline/locale/smartline.de.tr b/mods/techpack/smartline/locale/smartline.de.tr new file mode 100644 index 00000000..46d50d0f --- /dev/null +++ b/mods/techpack/smartline/locale/smartline.de.tr @@ -0,0 +1,85 @@ +# textdomain: smartline + + + +### button.lua ### + +Insert destination block number(s)=Zielblocknummer(n) eingeben +SmartLine Button=SmartLine Taster +SmartLine Button/Switch=SmartLine Taster/Schalter +connected with block=verbunden mit Block +switch,button 2s,button 4s,button 8s,button 16s=Schalter,Taster 2s,Taster 4s,Taster 8s,Taster 16s + +### button.lua ### +### collector.lua ### +### playerdetector.lua ### +### repeater.lua ### + +Save=Speichern + +### collector.lua ### + +Node number to send the events to:=Knotennummer, an den die Events gesendet werden sollen: +Node numbers to read the states from:=Knotennummers, von wo der Status gelesen werden soll: +Send an event if state is equal or larget than:=Sende einen Event, wenn der Status gleich oder größer ist als: +SmartLine State Collector=SmartLine Status Sammler + +### display.lua ### + +SmartLine Display=SmartLine Display + +### playerdetector.lua ### + +Input the number(s) of the receiving node(s).=Gib die Nummer(n) der Empfangsblöcke ein. +Input the player name(s) separated by blanks,=Gebe sie Spielernamen getrennt durch Leerzeichen ein, +Player Detector=Spieler Detektor +Player Detector Help=Spieler Detektor Hilfe +Player name(s):=Spielername(n): +Receiver node numbers:=Empfangsblocknummer(n): +Separate numbers via blanks, like '0123 0234'.=Separiere die Nummern mit Leerzeichen, wie '0123 0234'. +SmartLine Player Detector=SmartLine Spieler Detektor +or leave it blank for all players.=oder lasse es leer für alle Spieler. + +### playerdetector.lua ### +### sequencer.lua ### +### timer.lua ### + +close=schließen +help=Hilfe + +### repeater.lua ### + +Destination node numbers=Zielknotennummern +SmartLine Repeater=SmartLine Wiederholer +connected with=verbunden mit +fault (overloaded)=Fehler (überlastet) +not connected=nicht verbunden + +### sequencer.lua ### + +Offset/s=Offset/s +Run endless=Laufe endlos +SmartLine Sequencer=SmartLine Sequenzer + +SmartLine Sequencer Help@n @nDefine a sequence of commands to control other machines.@nNumbers(s) are the node numbers, the command shall sent to.@nThe commands 'on'/'off' are used for machines and other nodes.@nOffset is the time to the next line in seconds (1..999).@nIf endless is set, the Sequencer restarts again and again.@nThe command ' ' does nothing, only consuming the offset time.@n=SmartLine Sequenzer Hilfe@n @nDefiniere eine Sequenz von Kommandos um andere Maschinen zu steuern.@nNummern sind Blocknummern, wo die Kommandos hingesendet werden sollen@nDas Kommando 'on'/'off' wird für Maschinen und andere Blöcke verwendet@nOffset ist die Zeit zur nächsten Zeile in Sekunden (1..999).@nWird 'endlos' angeklickt, startet der Sequenzer immer wieder neu.@nDas Kommando ' ' macht nichts, die die Zeit zu verbrauchen.@n + +running=läuft +stopped=gestoppt + +### sequencer.lua ### +### timer.lua ### + +Command=Kommando +Number(s)=Nummer(m) + +### signaltower.lua ### + +SmartLine Signal Tower=SmartLine Signalturm + +### timer.lua ### + +SmartLine Timer=SmartLine Timer + +SmartLine Timer Help@n@nThe Timer is for a daytime controlled sending of commands@ne.g. to turn street lights on/off. The timer checks the @ntime every few seconds. If the block was just loaded, @nthe timer will check the last 4 hours for commands@nthat still need to be executed.=SmartLine Timer Hilfe@n@nDer Timer st zum Tageszeit abhängigem Senden von Kommandos@nDer Timer prüft die regeln alle paar Sekunden.@nFalls die Block gerade erst aktiviert wurde (Spieler kommt in die Nähe),@nwerden auch die Kommandos der letzten 4 Spielstunden@ngeprüft und ggf. ausgeführt. + +Time=Zeit diff --git a/mods/techpack/smartline/locale/template.txt b/mods/techpack/smartline/locale/template.txt new file mode 100644 index 00000000..0b729a74 --- /dev/null +++ b/mods/techpack/smartline/locale/template.txt @@ -0,0 +1,85 @@ +# textdomain: smartline + + + +### button.lua ### + +Insert destination block number(s)= +SmartLine Button= +SmartLine Button/Switch= +connected with block= +switch,button 2s,button 4s,button 8s,button 16s= + +### button.lua ### +### collector.lua ### +### playerdetector.lua ### +### repeater.lua ### + +Save= + +### collector.lua ### + +Node number to send the events to:= +Node numbers to read the states from:= +Send an event if state is equal or larget than:= +SmartLine State Collector= + +### display.lua ### + +SmartLine Display= + +### playerdetector.lua ### + +Input the number(s) of the receiving node(s).= +Input the player name(s) separated by blanks,= +Player Detector= +Player Detector Help= +Player name(s):= +Receiver node numbers:= +Separate numbers via blanks, like '0123 0234'.= +SmartLine Player Detector= +or leave it blank for all players.= + +### playerdetector.lua ### +### sequencer.lua ### +### timer.lua ### + +close= +help= + +### repeater.lua ### + +Destination node numbers= +SmartLine Repeater= +connected with= +fault (overloaded)= +not connected= + +### sequencer.lua ### + +Offset/s= +Run endless= +SmartLine Sequencer= + +SmartLine Sequencer Help@n @nDefine a sequence of commands to control other machines.@nNumbers(s) are the node numbers, the command shall sent to.@nThe commands 'on'/'off' are used for machines and other nodes.@nOffset is the time to the next line in seconds (1..999).@nIf endless is set, the Sequencer restarts again and again.@nThe command ' ' does nothing, only consuming the offset time.@n= + +running= +stopped= + +### sequencer.lua ### +### timer.lua ### + +Command= +Number(s)= + +### signaltower.lua ### + +SmartLine Signal Tower= + +### timer.lua ### + +SmartLine Timer= + +SmartLine Timer Help@n@nThe Timer is for a daytime controlled sending of commands@ne.g. to turn street lights on/off. The timer checks the @ntime every few seconds. If the block was just loaded, @nthe timer will check the last 4 hours for commands@nthat still need to be executed.= + +Time= diff --git a/mods/techpack/smartline/playerdetector.lua b/mods/techpack/smartline/playerdetector.lua index eca67073..6f646c38 100644 --- a/mods/techpack/smartline/playerdetector.lua +++ b/mods/techpack/smartline/playerdetector.lua @@ -3,15 +3,18 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information playerdetector.lua: ]]-- +-- Load support for I18n +local S = smartline.S + local function switch_on(pos) local meta = minetest.get_meta(pos) local node = minetest.get_node(pos) @@ -56,15 +59,19 @@ local function scan_for_player(pos) end local function formspec_help() + local help = table.concat({ + S("Input the number(s) of the receiving node(s)."), + S("Separate numbers via blanks, like '0123 0234'."), + S("Input the player name(s) separated by blanks,"), + S("or leave it blank for all players.") + }, "\n") return "size[10,9]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[3,0;Player Detector Help]".. - "label[0,1;Input the number(s) of the receiving node(s).\n".. - "Separate numbers via blanks, like '0123 0234'.\n\n".. - "Input the player name(s) separated by blanks,\nor empty for all players.]".. - "button_exit[4,8;2,1;exit;close]" + "label[3,0;"..S("Player Detector Help").."]".. + "label[0,1;"..help.."]".. + "button_exit[4,8;2,1;exit2;"..S("close").."]" end @@ -73,26 +80,27 @@ local function formspec(numbers, names) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[2,0;Player Detector]".. - "field[0.3,1;8,1;numbers;Receiver node numbers:;"..numbers.."]" .. - "field[0.3,2.5;8,1;names;Player name(s):;"..names.."]" .. - "button_exit[5,3.5;2,1;exit;Save]".. - "button[1,3.5;1,1;help;help]" + "label[2,0;"..S("Player Detector").."]".. + "field[0.3,1;8,1;numbers;"..S("Receiver node numbers:")..";"..numbers.."]" .. + "field[0.3,2.5;8,1;names;"..S("Player name(s):")..";"..names.."]" .. + "button_exit[5,3.5;2,1;exit1;"..S("Save").."]".. + "button[1,3.5;1,1;help;"..S("help").."]" end local function on_receive_fields(pos, formname, fields, player) local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") if player:get_player_name() == owner then - if fields.exit == "Save" then + print(dump(fields)) + if fields.exit1 then if tubelib.check_numbers(fields.numbers) then meta:set_string("numbers", fields.numbers) end meta:set_string("names", fields.names) meta:set_string("formspec", formspec(fields.numbers, fields.names)) - elseif fields.help ~= nil then + elseif fields.help then meta:set_string("formspec", formspec_help()) - elseif fields.exit == "close" then + elseif fields.exit2 then local numbers = meta:get_string("numbers") local names = meta:get_string("names") meta:set_string("formspec", formspec(numbers, names)) @@ -101,7 +109,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("smartline:playerdetector", { - description = "SmartLine Player Detector", + description = S("SmartLine Player Detector"), inventory_image = "smartline_detector_inventory.png", tiles = { -- up, down, right, left, back, front @@ -127,7 +135,7 @@ minetest.register_node("smartline:playerdetector", { local numbers = meta:get_string("numbers") or "" local names = meta:get_string("names") or "" meta:set_string("formspec", formspec(numbers, names)) - meta:set_string("infotext", "SmartLine Player Detector "..number) + meta:set_string("infotext", S("SmartLine Player Detector").." "..number) meta:set_string("owner", placer:get_player_name()) minetest.get_node_timer(pos):start(1) end, @@ -159,7 +167,7 @@ minetest.register_node("smartline:playerdetector", { }) minetest.register_node("smartline:playerdetector_active", { - description = "SmartLine Player Detector", + description = S("SmartLine Player Detector"), tiles = { -- up, down, right, left, back, front "smartline.png", diff --git a/mods/techpack/smartline/repeater.lua b/mods/techpack/smartline/repeater.lua index a942bd2a..0556f5ed 100644 --- a/mods/techpack/smartline/repeater.lua +++ b/mods/techpack/smartline/repeater.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information repeater.lua: @@ -13,17 +13,20 @@ ]]-- +-- Load support for I18n +local S = smartline.S + local OVER_LOAD_MAX = 5 local function formspec(meta) local numbers = meta:get_string("numbers") return "size[7,5]".. - "field[0.5,2;6,1;number;Destination node numbers;"..numbers.."]" .. - "button_exit[1,3;2,1;exit;Save]" + "field[0.5,2;6,1;number;"..S("Destination node numbers")..";"..numbers.."]" .. + "button_exit[1,3;2,1;exit;"..S("Save").."]" end minetest.register_node("smartline:repeater", { - description = "SmartLine Repeater", + description = S("SmartLine Repeater"), inventory_image = "smartline_repeater_inventory.png", tiles = { -- up, down, right, left, back, front @@ -48,7 +51,7 @@ minetest.register_node("smartline:repeater", { local own_number = tubelib.add_node(pos, "smartline:repeater") meta:set_string("own_number", own_number) meta:set_string("formspec", formspec(meta)) - meta:set_string("infotext", "SmartLine Repeater "..own_number..": not connected") + meta:set_string("infotext", S("SmartLine Repeater").." "..own_number..": "..S("not connected")) meta:set_string("owner", placer:get_player_name()) meta:set_int("overload_cnt", 0) minetest.get_node_timer(pos):start(1) @@ -64,7 +67,7 @@ minetest.register_node("smartline:repeater", { if tubelib.check_numbers(fields.number) then meta:set_string("numbers", fields.number) local own_number = meta:get_string("own_number") - meta:set_string("infotext", "SmartLine Repeater "..own_number..": connected with "..fields.number) + meta:set_string("infotext", S("SmartLine Repeater").." "..own_number..": "..S("connected with").." "..fields.number) meta:set_string("formspec", formspec(meta)) end @@ -114,12 +117,12 @@ tubelib.register_node("smartline:repeater", {}, { meta:set_int("overload_cnt", overload_cnt) if overload_cnt > OVER_LOAD_MAX then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "SmartLine Repeater "..own_number..": fault (overloaded)") + meta:set_string("infotext", S("SmartLine Repeater").." "..own_number..": "..S("fault (overloaded)")) minetest.get_node_timer(pos):stop() return false elseif topic == "set_numbers" then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "SmartLine Repeater "..own_number..": connected with "..payload) + meta:set_string("infotext", S("SmartLine Repeater").." "..own_number..": "..S("connected with").." "..payload) meta:set_string("numbers", payload) meta:set_string("formspec", formspec(meta)) return true diff --git a/mods/techpack/smartline/sequencer.lua b/mods/techpack/smartline/sequencer.lua index 8758c383..d9e7aa34 100644 --- a/mods/techpack/smartline/sequencer.lua +++ b/mods/techpack/smartline/sequencer.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information sequencer.lua: @@ -13,20 +13,24 @@ ]]-- +-- Load support for I18n +local S = smartline.S + local RUNNING_STATE = 1 local STOP_STATE = 0 local NUM_SLOTS = 8 -local sHELP = [[label[0,0;SmartLine Sequencer Help - +local sHELP = "label[0,0;".. +S([[SmartLine Sequencer Help + Define a sequence of commands to control other machines. Numbers(s) are the node numbers, the command shall sent to. The commands 'on'/'off' are used for machines and other nodes. Offset is the time to the next line in seconds (1..999). If endless is set, the Sequencer restarts again and again. The command ' ' does nothing, only consuming the offset time. -] -]] +]]).. +"]" local sAction = ",on,off" @@ -39,15 +43,15 @@ local function formspec(state, rules, endless) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[0,0;Number(s)]label[2.1,0;Command]label[6.4,0;Offset/s]"} + "label[0,0;"..S("Number(s)").."]label[2.1,0;"..S("Command").."]label[6.4,0;"..S("Offset/s").."]"} for idx, rule in ipairs(rules or {}) do tbl[#tbl+1] = "field[0.2,"..(-0.2+idx)..";2,1;num"..idx..";;"..(rule.num or "").."]" tbl[#tbl+1] = "dropdown[2,"..(-0.4+idx)..";3.9,1;act"..idx..";"..sAction..";"..(rule.act or "").."]" tbl[#tbl+1] = "field[6.2,"..(-0.2+idx)..";2,1;offs"..idx..";;"..(rule.offs or "").."]" end - tbl[#tbl+1] = "checkbox[0,8.5;endless;Run endless;"..endless.."]" - tbl[#tbl+1] = "button[4.5,8.5;1.5,1;help;help]" + tbl[#tbl+1] = "checkbox[0,8.5;endless;"..S("Run endless")..";"..endless.."]" + tbl[#tbl+1] = "button[4.5,8.5;1.5,1;help;"..S("help").."]" tbl[#tbl+1] = "image_button[6.5,8.5;1,1;".. tubelib.state_button(state) ..";button;]" return table.concat(tbl) @@ -58,10 +62,10 @@ local function formspec_help() default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "field[0,0;0,0;_type_;;help]".. + "field[0,0;0,0;_type_;;"..S("help").."]".. sHELP.. --"label[0.2,0;test]".. - "button[11.5,9;1.5,1;close;close]" + "button[11.5,9;1.5,1;close;"..S("close").."]" end local function stop_the_sequencer(pos) @@ -69,7 +73,7 @@ local function stop_the_sequencer(pos) local meta = minetest.get_meta(pos) local number = meta:get_string("number") meta:set_int("running", STOP_STATE) - meta:set_string("infotext", "SmartLine Sequencer "..number..": stopped") + meta:set_string("infotext", S("SmartLine Sequencer").." "..number..": "..S("stopped")) local rules = minetest.deserialize(meta:get_string("rules")) local endless = meta:get_int("endless") or 0 meta:set_string("formspec", formspec(tubelib.STOPPED, rules, endless)) @@ -120,7 +124,7 @@ local function check_rules(pos, elapsed) if index == 1 and offs < 1 then offs = 2 end - meta:set_string("infotext", "SmartLine Sequencer "..number..": running ("..index.."/"..NUM_SLOTS..")") + meta:set_string("infotext", S("SmartLine Sequencer").." "..number..": "..S("running").." ("..index.."/"..NUM_SLOTS..")") meta:set_int("index", index) if offs > 0 then minetest.after(0, restart_timer, pos, offs) @@ -142,7 +146,7 @@ local function start_the_sequencer(pos) local number = meta:get_string("number") meta:set_int("running", RUNNING_STATE) meta:set_int("index", 1) - meta:set_string("infotext", "SmartLine Sequencer "..number..": running (1/"..NUM_SLOTS..")") + meta:set_string("infotext", S("SmartLine Sequencer").." "..number..": "..S("running").." (1/"..NUM_SLOTS..")") local rules = minetest.deserialize(meta:get_string("rules")) local endless = meta:get_int("endless") or 0 meta:set_string("formspec", formspec(tubelib.RUNNING, rules, endless)) @@ -202,7 +206,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("smartline:sequencer", { - description = "SmartLine Sequencer", + description = S("SmartLine Sequencer"), inventory_image = "smartline_sequencer_inventory.png", wield_image = "smartline_sequencer_inventory.png", stack_max = 1, @@ -237,7 +241,7 @@ minetest.register_node("smartline:sequencer", { meta:set_int("endless", 0) meta:get_int("running", STOP_STATE) meta:set_string("formspec", formspec(tubelib.STOPPED, rules, 0)) - meta:set_string("infotext", "SmartLine Sequencer "..number) + meta:set_string("infotext", S("SmartLine Sequencer").." "..number) end, on_receive_fields = on_receive_fields, diff --git a/mods/techpack/smartline/signaltower.lua b/mods/techpack/smartline/signaltower.lua index 9156abc5..b2549781 100644 --- a/mods/techpack/smartline/signaltower.lua +++ b/mods/techpack/smartline/signaltower.lua @@ -3,15 +3,17 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information signaltower.lua: ]]-- +-- Load support for I18n +local S = smartline.S local function switch_on(pos, node, color) local meta = minetest.get_meta(pos) @@ -28,7 +30,7 @@ local function switch_off(pos, node) end minetest.register_node("smartline:signaltower", { - description = "SmartLine Signal Tower", + description = S("SmartLine Signal Tower"), tiles = { 'smartline_signaltower_top.png', 'smartline_signaltower_top.png', @@ -47,7 +49,7 @@ minetest.register_node("smartline:signaltower", { local number = tubelib.add_node(pos, "smartline:signaltower") local meta = minetest.get_meta(pos) meta:set_string("state", "off") - meta:set_string("infotext", "SmartLine Signal Tower "..number) + meta:set_string("infotext", S("SmartLine Signal Tower").." "..number) end, on_rightclick = function(pos, node, clicker) @@ -71,7 +73,7 @@ minetest.register_node("smartline:signaltower", { for _,color in ipairs({"green", "amber", "red"}) do minetest.register_node("smartline:signaltower_"..color, { - description = "SmartLine Signal Tower", + description = S("SmartLine Signal Tower"), tiles = { 'smartline_signaltower_top.png', 'smartline_signaltower_top.png', diff --git a/mods/techpack/smartline/timer.lua b/mods/techpack/smartline/timer.lua index 9367973e..63e5d597 100644 --- a/mods/techpack/smartline/timer.lua +++ b/mods/techpack/smartline/timer.lua @@ -3,9 +3,9 @@ SmartLine ========= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information timer.lua: @@ -13,13 +13,20 @@ ]]-- +-- Load support for I18n +local S = smartline.S + local CYCLE_TIME = 8 -local sHELP = [[label[0,0;SmartLine Timer Help +local sHELP = "label[0,0;".. +S([[SmartLine Timer Help -tbd -] -]] +The Timer is for a daytime controlled sending of commands +e.g. to turn street lights on/off. The timer checks the +time every few seconds. If the block was just loaded, +the timer will check the last 4 hours for commands +that still need to be executed.]]).. +"]" local tTime = { @@ -45,7 +52,7 @@ local function formspec(events, numbers, actions) default.gui_bg_img.. default.gui_slots.. - "label[0,0;Time]label[2.3,0;Number(s)]label[4.5,0;Command]".. + "label[0,0;"..S("Time").."]label[2.3,0;"..S("Number(s)").."]label[4.5,0;"..S("Command").."]".. "dropdown[0,1;2,1;e1;"..sTime..";"..events[1].."]".. "field[2.3,1.2;2,1;n1;;"..numbers[1].."]" .. "dropdown[4.5,1;3,1;a1;"..sAction..";"..tAction[actions[1]].."]".. @@ -70,8 +77,8 @@ local function formspec(events, numbers, actions) "field[2.3,6.2;2,1;n6;;"..numbers[6].."]" .. "dropdown[4.5,6;3,1;a6;"..sAction..";"..tAction[actions[6]].."]".. - "button[4.5,7;1.5,1;help;help]".. - "button_exit[6.5,7;1.5,1;exit;close]" + "button[4.5,7;1.5,1;help;"..S("help").."]".. + "button_exit[6.5,7;1.5,1;exit;"..S("close").."]" end local function formspec_help() @@ -79,10 +86,10 @@ local function formspec_help() default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "field[0,0;0,0;_type_;;help]".. + "field[0,0;0,0;_type_;;"..S("help").."]".. sHELP.. --"label[0.2,0;test]".. - "button[11.5,9;1.5,1;close;close]" + "button[11.5,9;1.5,1;close;"..S("close").."]" end local function check_rules(pos,elapsed) @@ -120,7 +127,7 @@ local function check_rules(pos,elapsed) done = {false,false,false,false,false,false} end meta:set_string("done", minetest.serialize(done)) - meta:set_string("infotext","SmartLine Timer ("..own_num..")"..hour..":00") + meta:set_string("infotext", S("SmartLine Timer").." "..own_num..": "..hour..":00") return true end return false @@ -128,7 +135,7 @@ end minetest.register_node("smartline:timer", { - description = "SmartLine Timer", + description = S("SmartLine Timer"), inventory_image = "smartline_timer_inventory.png", wield_image = "smartline_timer_inventory.png", stack_max = 1, diff --git a/mods/techpack/techpack_stairway/init.lua b/mods/techpack/techpack_stairway/init.lua index b74ec4e9..b0bac50e 100644 --- a/mods/techpack/techpack_stairway/init.lua +++ b/mods/techpack/techpack_stairway/init.lua @@ -3,16 +3,19 @@ TechPack Stairway ================= - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2019-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information init.lua ]]-- + +S = minetest.get_translator("techpack_stairway") + minetest.register_node("techpack_stairway:grating", { - description = "TechPack Grating", + description = S("TechPack Grating"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -43,7 +46,7 @@ minetest.register_node("techpack_stairway:grating", { }) minetest.register_node("techpack_stairway:handrail1", { - description = "TechPack Handrail 1", + description = S("TechPack Handrail 1"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -74,7 +77,7 @@ minetest.register_node("techpack_stairway:handrail1", { }) minetest.register_node("techpack_stairway:handrail2", { - description = "TechPack Handrail 2", + description = S("TechPack Handrail 2"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -107,7 +110,7 @@ minetest.register_node("techpack_stairway:handrail2", { }) minetest.register_node("techpack_stairway:handrail3", { - description = "TechPack Handrail 3", + description = S("TechPack Handrail 3"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -140,7 +143,7 @@ minetest.register_node("techpack_stairway:handrail3", { }) minetest.register_node("techpack_stairway:handrail4", { - description = "TechPack Handrail 4", + description = S("TechPack Handrail 4"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -175,7 +178,7 @@ minetest.register_node("techpack_stairway:handrail4", { }) minetest.register_node("techpack_stairway:bridge1", { - description = "TechPack Bridge 1", + description = S("TechPack Bridge 1"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -207,7 +210,7 @@ minetest.register_node("techpack_stairway:bridge1", { }) minetest.register_node("techpack_stairway:bridge2", { - description = "TechPack Bridge 2", + description = S("TechPack Bridge 2"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -240,7 +243,7 @@ minetest.register_node("techpack_stairway:bridge2", { }) minetest.register_node("techpack_stairway:bridge3", { - description = "TechPack Bridge 3", + description = S("TechPack Bridge 3"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -273,7 +276,7 @@ minetest.register_node("techpack_stairway:bridge3", { }) minetest.register_node("techpack_stairway:bridge4", { - description = "TechPack Bridge 4", + description = S("TechPack Bridge 4"), tiles = { 'techpack_stairway_bottom.png', 'techpack_stairway_bottom.png', @@ -307,7 +310,7 @@ minetest.register_node("techpack_stairway:bridge4", { }) minetest.register_node("techpack_stairway:stairway", { - description = "TechPack Stairway", + description = S("TechPack Stairway"), tiles = { 'techpack_stairway_steps.png', 'techpack_stairway_steps.png', @@ -345,7 +348,7 @@ minetest.register_node("techpack_stairway:stairway", { }) minetest.register_node("techpack_stairway:ladder1", { - description = "TechPack Ladder 1", + description = S("TechPack Ladder 1"), tiles = { 'techpack_stairway_steps.png', 'techpack_stairway_steps.png', @@ -376,7 +379,7 @@ minetest.register_node("techpack_stairway:ladder1", { }) minetest.register_node("techpack_stairway:ladder2", { - description = "TechPack Ladder 2", + description = S("TechPack Ladder 2"), tiles = { 'techpack_stairway_steps.png', 'techpack_stairway_steps.png', @@ -408,7 +411,7 @@ minetest.register_node("techpack_stairway:ladder2", { }) minetest.register_node("techpack_stairway:ladder3", { - description = "TechPack Ladder 3", + description = S("TechPack Ladder 3"), tiles = { 'techpack_stairway_steps.png', 'techpack_stairway_steps.png', @@ -439,8 +442,39 @@ minetest.register_node("techpack_stairway:ladder3", { sounds = default.node_sound_metal_defaults(), }) +minetest.register_node("techpack_stairway:ladder4", { + description = S("TechPack Ladder 4"), + tiles = { + 'techpack_stairway_ladder.png', + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-17/32, -17/32, 15/32, 17/32, 17/32, 17/32}, + --{-17/32, -17/32, -17/32, -15/32, 17/32, 17/32}, + --{-17/32, -17/32, -17/32, 17/32, 17/32, -15/32}, + --{ 15/32, -17/32, -17/32, 17/32, 17/32, 17/32}, + }, + }, + + selection_box = { + type = "fixed", + fixed = {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, + }, + + climbable = true, + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 2}, + sounds = default.node_sound_metal_defaults(), +}) + + minetest.register_node("techpack_stairway:lattice", { - description = "TechPack Lattice", + description = S("TechPack Lattice"), tiles = { 'techpack_stairway_lattice.png', }, @@ -470,6 +504,53 @@ minetest.register_node("techpack_stairway:lattice", { sounds = default.node_sound_metal_defaults(), }) +minetest.register_node("techpack_stairway:lattice_slop", { + description = S("TechPack Lattice Slope"), + tiles = { + 'techpack_stairway_lattice.png', + }, + drawtype = "mesh", + mesh="techpack_stairway_slope.obj", + + selection_box = { + type = "fixed", + fixed = { + {-8/16, 4/16, 4/16, 8/16, 8/16, 8/16}, + {-8/16, 0/16, 0/16, 8/16, 4/16, 8/16}, + {-8/16, -4/16, -4/16, 8/16, 0/16, 8/16}, + {-8/16, -8/16, -8/16, 8/16, -4/16, 8/16}, + }, + }, + + collision_box = { + type = "fixed", + fixed = { + {-8/16, 4/16, 4/16, 8/16, 8/16, 8/16}, + {-8/16, 0/16, 0/16, 8/16, 4/16, 8/16}, + {-8/16, -4/16, -4/16, 8/16, 0/16, 8/16}, + {-8/16, -8/16, -8/16, 8/16, -4/16, 8/16}, + }, + }, + + after_place_node = function(pos, placer, itemstack, pointed_thing) + local node = minetest.get_node(pos) + local dir = minetest.facedir_to_dir(node.param2) + if pointed_thing.under.y >= pointed_thing.above.y then + local newparam2 = ({[0] = 8, [1] = 17, [2] = 22, [3] = 15})[node.param2] + if newparam2 then + node.param2 = newparam2 + minetest.swap_node(pos, node) + end + end + end, + + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 2}, + sounds = default.node_sound_metal_defaults(), +}) minetest.register_craft({ output = "techpack_stairway:grating 4", @@ -516,6 +597,15 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "techpack_stairway:ladder4 8", + recipe = { + {"dye:dark_grey", "default:tin_ingot", "default:coal_lump"}, + {"", "default:steel_ingot", ""}, + {"", "default:steel_ingot", ""}, + }, +}) + minetest.register_craft({ output = "techpack_stairway:lattice 2", recipe = { @@ -525,6 +615,10 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "techpack_stairway:lattice_slop 2", + recipe = {{"techpack_stairway:lattice"}}, +}) minetest.register_craft({ output = "techpack_stairway:handrail2", diff --git a/mods/techpack/techpack_stairway/locale/techpack_stairway.de.tr b/mods/techpack/techpack_stairway/locale/techpack_stairway.de.tr new file mode 100644 index 00000000..758b3b93 --- /dev/null +++ b/mods/techpack/techpack_stairway/locale/techpack_stairway.de.tr @@ -0,0 +1,22 @@ +# textdomain: techpack_stairway + + + +### init.lua ### + +TechPack Bridge 1=TechPack Brücke 1 +TechPack Bridge 2=TechPack Brücke 2 +TechPack Bridge 3=TechPack Brücke 3 +TechPack Bridge 4=TechPack Brücke 4 +TechPack Grating=TechPack Gitterrost +TechPack Handrail 1=TechPack Geländer 1 +TechPack Handrail 2=TechPack Geländer 2 +TechPack Handrail 3=TechPack Geländer 3 +TechPack Handrail 4=TechPack Geländer 4 +TechPack Ladder 1=TechPack Leiter 1 +TechPack Ladder 2=TechPack Leiter 2 +TechPack Ladder 3=TechPack Leiter 3 +TechPack Ladder 4=TechPack Leiter 4 +TechPack Lattice=TechPack Gitterrahmen +TechPack Lattice Slope=TechPack Gitterrahmenrampe +TechPack Stairway=TechPack Treppe diff --git a/mods/techpack/techpack_stairway/locale/template.txt b/mods/techpack/techpack_stairway/locale/template.txt new file mode 100644 index 00000000..9c29e43a --- /dev/null +++ b/mods/techpack/techpack_stairway/locale/template.txt @@ -0,0 +1,22 @@ +# textdomain: techpack_stairway + + + +### init.lua ### + +TechPack Bridge 1= +TechPack Bridge 2= +TechPack Bridge 3= +TechPack Bridge 4= +TechPack Grating= +TechPack Handrail 1= +TechPack Handrail 2= +TechPack Handrail 3= +TechPack Handrail 4= +TechPack Ladder 1= +TechPack Ladder 2= +TechPack Ladder 3= +TechPack Ladder 4= +TechPack Lattice= +TechPack Lattice Slope= +TechPack Stairway= diff --git a/mods/techpack/techpack_warehouse/box_copper.lua b/mods/techpack/techpack_warehouse/box_copper.lua index 2683b1bd..0f9d8b66 100644 --- a/mods/techpack/techpack_warehouse/box_copper.lua +++ b/mods/techpack/techpack_warehouse/box_copper.lua @@ -3,23 +3,25 @@ TechPack Warehouse ================== - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information box_copper.lua ]]-- +-- Load support for I18n +local S = techpack_warehouse.S + --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta local wh = techpack_warehouse local NODE_NAME = "techpack_warehouse:box_copper" -local DESCRIPTION = "Warehouse Box Copper" +local DESCRIPTION = S("Warehouse Box Copper") local INV_SIZE = 1200 local BACKGROUND_IMG = "default_copper_block.png" diff --git a/mods/techpack/techpack_warehouse/box_gold.lua b/mods/techpack/techpack_warehouse/box_gold.lua index b6745c2f..46c0c5ff 100644 --- a/mods/techpack/techpack_warehouse/box_gold.lua +++ b/mods/techpack/techpack_warehouse/box_gold.lua @@ -3,23 +3,25 @@ TechPack Warehouse ================== - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information box_gold.lua ]]-- +-- Load support for I18n +local S = techpack_warehouse.S + --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta local wh = techpack_warehouse local NODE_NAME = "techpack_warehouse:box_gold" -local DESCRIPTION = "Warehouse Box Gold" +local DESCRIPTION = S("Warehouse Box Gold") local INV_SIZE = 3600 local BACKGROUND_IMG = "default_gold_block.png" diff --git a/mods/techpack/techpack_warehouse/box_steel.lua b/mods/techpack/techpack_warehouse/box_steel.lua index cf6f85a5..765f0667 100644 --- a/mods/techpack/techpack_warehouse/box_steel.lua +++ b/mods/techpack/techpack_warehouse/box_steel.lua @@ -3,23 +3,25 @@ TechPack Warehouse ================== - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information box_steel.lua ]]-- +-- Load support for I18n +local S = techpack_warehouse.S + --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta local wh = techpack_warehouse local NODE_NAME = "techpack_warehouse:box_steel" -local DESCRIPTION = "Warehouse Box Steel" +local DESCRIPTION = S("Warehouse Box Steel") local INV_SIZE = 400 local BACKGROUND_IMG = "default_steel_block.png" diff --git a/mods/techpack/techpack_warehouse/common.lua b/mods/techpack/techpack_warehouse/common.lua index cfba34a5..cfe07532 100644 --- a/mods/techpack/techpack_warehouse/common.lua +++ b/mods/techpack/techpack_warehouse/common.lua @@ -3,17 +3,19 @@ TechPack Warehouse ================== - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information common.lua ]]-- +-- Load support for I18n +local S = techpack_warehouse.S + --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -49,10 +51,10 @@ local function formspec(self, pos, meta) "list[context;input;1,3.6;8,1;]".. "image_button[9,3.6;1,1;techpack_warehouse_input_inv.png;input;;true;false;]".. - "tooltip[shift;Pass-through storage for unconfigured items (turn on/off)]".. - "tooltip[filter;Filter: To configure the 8 storages]".. - "tooltip[storage;Storage: All items will be stored here]".. - "tooltip[input;Input: Put items will be moved to the storage, if configured]".. + "tooltip[shift;"..S("Pass-through storage for unconfigured items (turn on/off)").."]".. + "tooltip[filter;"..S("Filter: To configure the 8 storages").."]".. + "tooltip[storage;"..S("Storage: All items will be stored here").."]".. + "tooltip[input;"..S("Input: Put items will be moved to the storage, if configured").."]".. "list[current_player;main;1,5.3;8,4;]".. "listring[context;shift]".. diff --git a/mods/techpack/techpack_warehouse/init.lua b/mods/techpack/techpack_warehouse/init.lua index 2dac8a47..f20cf129 100644 --- a/mods/techpack/techpack_warehouse/init.lua +++ b/mods/techpack/techpack_warehouse/init.lua @@ -3,9 +3,9 @@ TechPack Warehouse ================== - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information init.lua @@ -14,6 +14,10 @@ techpack_warehouse = {} +-- Load support for I18n +techpack_warehouse.S = minetest.get_translator("techpack_warehouse") + + dofile(minetest.get_modpath("techpack_warehouse") .. "/common.lua") dofile(minetest.get_modpath("techpack_warehouse") .. "/box_steel.lua") dofile(minetest.get_modpath("techpack_warehouse") .. "/box_copper.lua") diff --git a/mods/techpack/techpack_warehouse/locale/template.txt b/mods/techpack/techpack_warehouse/locale/template.txt new file mode 100644 index 00000000..b068cd04 --- /dev/null +++ b/mods/techpack/techpack_warehouse/locale/template.txt @@ -0,0 +1,22 @@ +# textdomain: techpack_warehouse + + + +### box_copper.lua ### + +Warehouse Box Copper= + +### box_gold.lua ### + +Warehouse Box Gold= + +### box_steel.lua ### + +Warehouse Box Steel= + +### common.lua ### + +Filter: To configure the 8 storages= +Input: Put items will be moved to the storage, if configured= +Pass-through storage for unconfigured items (turn on/off)= +Storage: All items will be stored here= diff --git a/mods/techpack/tubelib/basalt.lua b/mods/techpack/tubelib/basalt.lua index f2c4a18d..9d596b67 100644 --- a/mods/techpack/tubelib/basalt.lua +++ b/mods/techpack/tubelib/basalt.lua @@ -3,15 +3,18 @@ Tube Library ============ - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information basalt.lua: ]]-- +-- Load support for I18n +local S = tubelib.S + if tubelib.basalt_stone_enabled then -- Replace default:stone with tubelib:basalt which is useless for ore generation. default.cool_lava = function(pos, node) @@ -25,14 +28,14 @@ if tubelib.basalt_stone_enabled then end minetest.register_node("tubelib:basalt_stone", { - description = "Basalt Stone", + description = S("Basalt Stone"), tiles = {"default_stone.png^[brighten"}, groups = {cracky = 3, stone = 1}, drop = "default:silver_sand", sounds = default.node_sound_stone_defaults(), }) minetest.register_node("tubelib:basalt_stone_brick", { - description = "Basalt Stone Brick", + description = S("Basalt Stone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_stone_brick.png^[brighten"}, @@ -42,7 +45,7 @@ if tubelib.basalt_stone_enabled then }) minetest.register_node("tubelib:basalt_stone_block", { - description = "Basalt Stone Block", + description = S("Basalt Stone Block"), tiles = {"default_stone_block.png^[brighten"}, is_ground_content = false, groups = {cracky = 2, stone = 1}, diff --git a/mods/techpack/tubelib/blackhole.lua b/mods/techpack/tubelib/blackhole.lua index baef64fd..77422654 100644 --- a/mods/techpack/tubelib/blackhole.lua +++ b/mods/techpack/tubelib/blackhole.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information blackhole.lua: @@ -24,9 +24,11 @@ -- | |/ -- +--------+ +-- Load support for I18n +local S = tubelib.S minetest.register_node("tubelib:blackhole", { - description = "Tubelib Black Hole", + description = S("Tubelib Black Hole"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -42,7 +44,7 @@ minetest.register_node("tubelib:blackhole", { local number = tubelib.add_node(pos, "tubelib:blackhole") -- <<=== tubelib meta:set_string("number", number) meta:set_int("disappeared", 0) - meta:set_string("infotext","0 items disappeared") + meta:set_string("infotext", "0 "..S("items disappeared")) end, after_dig_node = function(pos) @@ -79,7 +81,7 @@ tubelib.register_node("tubelib:blackhole", {}, { local meta = minetest.get_meta(pos) local disappeared = meta:get_int("disappeared") + item:get_count() meta:set_int("disappeared", disappeared) - meta:set_string("infotext", disappeared.." items disappeared") + meta:set_string("infotext", disappeared.." "..S("items disappeared")) return true end return false diff --git a/mods/techpack/tubelib/button.lua b/mods/techpack/tubelib/button.lua index 1d5225ba..551e225c 100644 --- a/mods/techpack/tubelib/button.lua +++ b/mods/techpack/tubelib/button.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information button.lua: @@ -14,9 +14,11 @@ ]]-- +-- Load support for I18n +local S = tubelib.S local function switch_on(pos, node) - if tubelib.data_not_corrupted(pos) then + if tubelib.data_not_corrupted(pos, true) then node.name = "tubelib:button_active" minetest.swap_node(pos, node) minetest.sound_play("button", { @@ -41,7 +43,7 @@ local function switch_on(pos, node) end local function switch_off(pos) - if tubelib.data_not_corrupted(pos) then + if tubelib.data_not_corrupted(pos, true) then local node = minetest.get_node(pos) node.name = "tubelib:button" minetest.swap_node(pos, node) @@ -65,7 +67,7 @@ end minetest.register_node("tubelib:button", { - description = "Tubelib Button/Switch", + description = S("Tubelib Button/Switch"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -81,14 +83,14 @@ minetest.register_node("tubelib:button", { local own_num = tubelib.add_node(pos, "tubelib:button") meta:set_string("own_num", own_num) meta:set_string("formspec", "size[7.5,6]".. - "dropdown[0.2,0;3;type;switch,button 2s,button 4s,button 8s,button 16s;1]".. - "field[0.5,2;7,1;numbers;Insert destination node number(s);]" .. - "checkbox[1,3;public;public;false]".. - "button_exit[2,4;3,1;exit;Save]") + "dropdown[0.2,0;3;type;"..S("switch,button 2s,button 4s,button 8s,button 16s")..";1]".. + "field[0.5,2;7,1;numbers;"..S("Insert destination node number(s)")..";]" .. + "checkbox[1,3;public;"..S("public")..";false]".. + "button_exit[2,4;3,1;exit;"..S("Save").."]") meta:set_string("placer_name", placer:get_player_name()) meta:set_string("public", "false") meta:set_int("cycle_time", 0) - meta:set_string("infotext", "Tubelib Button "..own_num) + meta:set_string("infotext", S("Tubelib Button").." "..own_num) end, on_receive_fields = function(pos, formname, fields, player) @@ -96,7 +98,7 @@ minetest.register_node("tubelib:button", { if tubelib.check_numbers(fields.numbers) then -- <<=== tubelib meta:set_string("numbers", fields.numbers) local own_num = meta:get_string("own_num") - meta:set_string("infotext", "Tubelib Button "..own_num..", connected with block "..fields.numbers) + meta:set_string("infotext", S("Tubelib Button").." "..own_num..", "..S("connected with block").." "..fields.numbers) else return end @@ -142,7 +144,7 @@ minetest.register_node("tubelib:button", { minetest.register_node("tubelib:button_active", { - description = "Tubelib Button/Switch", + description = S("Tubelib Button/Switch"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib/command.lua b/mods/techpack/tubelib/command.lua index c735b31e..49428973 100644 --- a/mods/techpack/tubelib/command.lua +++ b/mods/techpack/tubelib/command.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information command.lua: @@ -607,9 +607,11 @@ function tubelib.temporary_remove_node(pos, number, name, add_data) add_data.name = name TemporaryRemovedNodes[key] = add_data else - local data = table.copy(TemporaryRemovedNodes[key]) - TemporaryRemovedNodes[key] = nil - return data + if TemporaryRemovedNodes[key] then + local data = table.copy(TemporaryRemovedNodes[key]) + TemporaryRemovedNodes[key] = nil + return data + end end end diff --git a/mods/techpack/tubelib/defect.lua b/mods/techpack/tubelib/defect.lua index 40ede921..178bf780 100644 --- a/mods/techpack/tubelib/defect.lua +++ b/mods/techpack/tubelib/defect.lua @@ -1,5 +1,8 @@ +-- Load support for I18n +local S = tubelib.S + minetest.register_node("tubelib:defect_dummy", { - description = "Corrupted Tubelib Node", + description = S("Corrupted Tubelib Node"), tiles = { "tubelib_front.png", "tubelib_front.png", @@ -22,7 +25,7 @@ local function already_reported(pos) end -function tubelib.data_not_corrupted(pos) +function tubelib.data_not_corrupted(pos, has_no_info) if minetest.pos_to_string(pos) ~= minetest.get_meta(pos):get_string("my_pos") then -- node number corrupt? local meta = minetest.get_meta(pos) @@ -42,6 +45,13 @@ function tubelib.data_not_corrupted(pos) report(pos) end end + + -- button like odes + if has_no_info then + minetest.get_meta(pos):get_string("my_pos", minetest.pos_to_string(pos)) + return true + end + -- node moved? local info = tubelib.get_node_info(number) if not info or not vector.equals(info.pos, pos) then diff --git a/mods/techpack/tubelib/distributor.lua b/mods/techpack/tubelib/distributor.lua index 5df42099..e06f0f8b 100644 --- a/mods/techpack/tubelib/distributor.lua +++ b/mods/techpack/tubelib/distributor.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information distributor.lua: @@ -19,8 +19,10 @@ response is "running", "stopped", "standby", "defect", or "not supported" ]]-- +-- Load support for I18n +local S = tubelib.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -62,7 +64,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib:distributor", node_name_active = "tubelib:distributor_active", node_name_defect = "tubelib:distributor_defect", - infotext_name = "Tubelib Distributor", + infotext_name = S("Tubelib Distributor"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, aging_factor = 10, @@ -353,7 +355,7 @@ local function change_filter_settings(pos, slot, val) end minetest.register_node("tubelib:distributor", { - description = "Tubelib Distributor", + description = S("Tubelib Distributor"), tiles = { -- up, down, right, left, back, front 'tubelib_distributor.png', @@ -413,7 +415,7 @@ minetest.register_node("tubelib:distributor", { minetest.register_node("tubelib:distributor_active", { - description = "Tubelib Distributor", + description = S("Tubelib Distributor"), tiles = { -- up, down, right, left, back, front { @@ -451,7 +453,7 @@ minetest.register_node("tubelib:distributor_active", { }) minetest.register_node("tubelib:distributor_defect", { - description = "Tubelib Distributor", + description = S("Tubelib Distributor"), tiles = { -- up, down, right, left, back, front 'tubelib_distributor.png', diff --git a/mods/techpack/tubelib/forceload.lua b/mods/techpack/tubelib/forceload.lua index 0f214bbb..da639481 100644 --- a/mods/techpack/tubelib/forceload.lua +++ b/mods/techpack/tubelib/forceload.lua @@ -3,17 +3,20 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information forceload.lua: ]]-- +-- Load support for I18n +local S = tubelib.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end +local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -109,22 +112,22 @@ local function formspec(player) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[0,0;List of your Forceload Blocks:]" + "label[0,0;"..S("List of your Forceload Blocks")..":]" for idx,pos in ipairs(lPos) do local pos1, pos2 = calc_area(pos) local ypos = 0.2 + idx * 0.4 tRes[#tRes+1] = "label[0,"..ypos..";"..idx.."]" - tRes[#tRes+1] = "label[0.8,"..ypos..";"..S(pos1).."]" - tRes[#tRes+1] = "label[3.2,"..ypos..";to]" - tRes[#tRes+1] = "label[4,"..ypos..";"..S(pos2).."]" + tRes[#tRes+1] = "label[0.8,"..ypos..";"..P2S(pos1).."]" + tRes[#tRes+1] = "label[3.2,"..ypos..";"..S("to").."]" + tRes[#tRes+1] = "label[4,"..ypos..";"..P2S(pos2).."]" end return table.concat(tRes) end minetest.register_node("tubelib:forceload", { - description = "Tubelib Forceload Block", + description = S("Tubelib Forceload Block"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -145,13 +148,13 @@ minetest.register_node("tubelib:forceload", { if add_pos(pos, placer) then minetest.forceload_block(pos, true) local pos1, pos2, num, max = get_data(pos, placer) - M(pos):set_string("infotext", "Area "..S(pos1).." to "..S(pos2).." loaded!\n".. - "Punch the block to make the area visible.") - chat(placer, "Area ("..num.."/"..max..") "..S(pos1).." to "..S(pos2).." loaded!") + M(pos):set_string("infotext", S("Area").." "..P2S(pos1).." "..S("to").." "..P2S(pos2).." "..S("loaded!").."\n".. + S("Punch the block to make the area visible.")) + chat(placer, S("Area").." ("..num.."/"..max..") "..P2S(pos1).." "..S("to").." "..P2S(pos2).." "..S("loaded!")) tubelib.mark_region(placer:get_player_name(), pos1, pos2) M(pos):set_string("owner", placer:get_player_name()) else - chat(placer, "Area already loaded or max. number of Forceload Blocks reached!") + chat(placer, S("Area already loaded or max. number of Forceload Blocks reached!")) minetest.remove_node(pos) return itemstack end diff --git a/mods/techpack/tubelib/init.lua b/mods/techpack/tubelib/init.lua index fb803c2c..b12fc8b3 100644 --- a/mods/techpack/tubelib/init.lua +++ b/mods/techpack/tubelib/init.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information History: @@ -34,6 +34,10 @@ tubelib = { NodeDef = {}, -- node registration info } +-- Load support for I18n +tubelib.S = minetest.get_translator("tubelib") +local S = tubelib.S + tubelib.version = 2.00 tubelib.max_num_forceload_blocks = tonumber(minetest.setting_get("tubelib_max_num_forceload_blocks")) or 10 @@ -78,7 +82,7 @@ minetest.register_lbm({ }) minetest.register_craftitem("tubelib:wlanchip", { - description = "Tubelib WLAN Chip", + description = S("Tubelib WLAN Chip"), inventory_image = "tubelib_wlanchip.png", }) diff --git a/mods/techpack/tubelib/lamp.lua b/mods/techpack/tubelib/lamp.lua index 67703e0d..acd21061 100644 --- a/mods/techpack/tubelib/lamp.lua +++ b/mods/techpack/tubelib/lamp.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information lamp.lua: @@ -18,6 +18,9 @@ ]]-- +-- Load support for I18n +local S = tubelib.S + local function switch_on(pos, node) node.name = "tubelib:lamp_on" minetest.swap_node(pos, node) @@ -29,7 +32,7 @@ local function switch_off(pos, node) end minetest.register_node("tubelib:lamp", { - description = "Tubelib Lamp", + description = S("Tubelib Lamp"), tiles = { 'tubelib_lamp.png', }, @@ -37,7 +40,7 @@ minetest.register_node("tubelib:lamp", { after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib:lamp") -- <<=== tubelib local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Lamp "..number) + meta:set_string("infotext", S("Tubelib Lamp").." "..number) end, on_rightclick = function(pos, node, clicker) @@ -60,7 +63,7 @@ minetest.register_node("tubelib:lamp", { }) minetest.register_node("tubelib:lamp_on", { - description = "Tubelib Lamp", + description = S("Tubelib Lamp"), tiles = { 'tubelib_lamp.png', }, diff --git a/mods/techpack/tubelib/legacy_nodes.lua b/mods/techpack/tubelib/legacy_nodes.lua index 8b814a08..865f5603 100644 --- a/mods/techpack/tubelib/legacy_nodes.lua +++ b/mods/techpack/tubelib/legacy_nodes.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information legacy_nodes.lua: diff --git a/mods/techpack/tubelib/locale/template.txt b/mods/techpack/tubelib/locale/template.txt new file mode 100644 index 00000000..2a70dbf1 --- /dev/null +++ b/mods/techpack/tubelib/locale/template.txt @@ -0,0 +1,69 @@ +# textdomain: tubelib + + + +### basalt.lua ### + +Basalt Stone= +Basalt Stone Block= +Basalt Stone Brick= + +### blackhole.lua ### + +Tubelib Black Hole= +items disappeared= + +### button.lua ### + +Insert destination node number(s)= +Save= +Tubelib Button= +Tubelib Button/Switch= +connected with block= +public= +switch,button 2s,button 4s,button 8s,button 16s= + +### defect.lua ### + +Corrupted Tubelib Node= + +### distributor.lua ### + +Tubelib Distributor= + +### forceload.lua ### + +Area= + +Area already loaded or max. number of Forceload Blocks reached!= + +List of your Forceload Blocks= +Punch the block to make the area visible.= +Tubelib Forceload Block= +loaded!= +to= + +### init.lua ### + +Tubelib WLAN Chip= + +### lamp.lua ### + +Tubelib Lamp= + +### pusher.lua ### + +Tubelib Pusher= + +### repairkit.lua ### + +Tubelib End Wrench (use @= read status, place @= destroy)= +Tubelib Repair Kit= +[Tubelib] Node repaired= +[Tubelib] state= +aging= +counter= + +### tubes.lua ### + +Tubelib Tube= diff --git a/mods/techpack/tubelib/locale/tubelib.de.tr b/mods/techpack/tubelib/locale/tubelib.de.tr new file mode 100644 index 00000000..a1d37a4d --- /dev/null +++ b/mods/techpack/tubelib/locale/tubelib.de.tr @@ -0,0 +1,69 @@ +# textdomain: tubelib + + + +### basalt.lua ### + +Basalt Stone=Basaltstein +Basalt Stone Block=Basaltsteinblock +Basalt Stone Brick=Basaltsteinziegel + +### blackhole.lua ### + +Tubelib Black Hole=Tubelib Schwarzes Loch +items disappeared=Gegenstände verschwunden + +### button.lua ### + +Insert destination node number(s)=Zielblocknummer(n) eingeben +Save=Speichern +Tubelib Button=Tubelib Taster +Tubelib Button/Switch=Tubelib Taster/Schalter +connected with block=verbunden mit Block +public=öffentlich +switch,button 2s,button 4s,button 8s,button 16s=Schalter,Taster 2s,Taster 4s,Taster 8s,Taster 16s + +### defect.lua ### + +Corrupted Tubelib Node=beschädigter Tubelib Block + +### distributor.lua ### + +Tubelib Distributor=Tubelib Verteiler + +### forceload.lua ### + +Area=Bereich + +Area already loaded or max. number of Forceload Blocks reached!=Bereich bereits geladen oder max. Anzahl von Forceload Blöcken erreicht! + +List of your Forceload Blocks=Liste deiner Forceload Blöcke +Punch the block to make the area visible.=Schlage den Block um den Bereich anzuzeigen +Tubelib Forceload Block=Tubelib Forceload Block +loaded!=geladen! +to=bis + +### init.lua ### + +Tubelib WLAN Chip=Tubelib WLAN Chip + +### lamp.lua ### + +Tubelib Lamp=Tubelib Lampe + +### pusher.lua ### + +Tubelib Pusher=Tubelib Schieber + +### repairkit.lua ### + +Tubelib End Wrench (use @= read status, place @= destroy)=Tubelib Gabelschlüssel (benutzen @= Status lesen, platzieren @= zerstören) +Tubelib Repair Kit=Tubelib Reparatur Kit +[Tubelib] Node repaired=[Tubelib] Block repariert +[Tubelib] state=Tubelib Zustand +aging=altern +counter=Zähler + +### tubes.lua ### + +Tubelib Tube=Tubelib Röhre diff --git a/mods/techpack/tubelib/mark.lua b/mods/techpack/tubelib/mark.lua index 73328db3..5d758ed7 100644 --- a/mods/techpack/tubelib/mark.lua +++ b/mods/techpack/tubelib/mark.lua @@ -3,10 +3,10 @@ Tube Library ============ - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg Code derived from wordedit (sfan5, Anthony Zhang (Uberi/Temperest), and Brett O'Donnell (cornernote)) - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information mark.lua: diff --git a/mods/techpack/tubelib/node_states.lua b/mods/techpack/tubelib/node_states.lua index 573ff6c5..14b58d8b 100644 --- a/mods/techpack/tubelib/node_states.lua +++ b/mods/techpack/tubelib/node_states.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information node_states.lua: diff --git a/mods/techpack/tubelib/pusher.lua b/mods/techpack/tubelib/pusher.lua index 87fc30c7..54f73506 100644 --- a/mods/techpack/tubelib/pusher.lua +++ b/mods/techpack/tubelib/pusher.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information pusher.lua: @@ -29,8 +29,10 @@ -- | |/ -- +--------+ +-- Load support for I18n +local S = tubelib.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -42,7 +44,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib:pusher", node_name_active = "tubelib:pusher_active", node_name_defect = "tubelib:pusher_defect", - infotext_name = "Tubelib Pusher", + infotext_name = S("Tubelib Pusher"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -75,7 +77,7 @@ local function keep_running(pos, elapsed) end minetest.register_node("tubelib:pusher", { - description = "Tubelib Pusher", + description = S("Tubelib Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_pusher1.png', @@ -117,7 +119,7 @@ minetest.register_node("tubelib:pusher", { minetest.register_node("tubelib:pusher_active", { - description = "Tubelib Pusher", + description = S("Tubelib Pusher"), tiles = { -- up, down, right, left, back, front { @@ -182,7 +184,7 @@ minetest.register_node("tubelib:pusher_active", { }) minetest.register_node("tubelib:pusher_defect", { - description = "Tubelib Pusher", + description = S("Tubelib Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_pusher1.png', diff --git a/mods/techpack/tubelib/repairkit.lua b/mods/techpack/tubelib/repairkit.lua index 4aba31e9..f0bcee36 100644 --- a/mods/techpack/tubelib/repairkit.lua +++ b/mods/techpack/tubelib/repairkit.lua @@ -3,16 +3,18 @@ Tube Library ============ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information repairkit.lua: ]]-- +-- Load support for I18n +local S = tubelib.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -29,7 +31,7 @@ local function repair_node(itemstack, user, pointed_thing) local pos = pointed_thing.under if pos then if tubelib.repair_node(pos) then - minetest.chat_send_player(user:get_player_name(), "[Tubelib] Node repaired") + minetest.chat_send_player(user:get_player_name(), S("[Tubelib] Node repaired")) itemstack:take_item() return itemstack end @@ -47,14 +49,14 @@ local function read_state(itemstack, user, pointed_thing) local aging = tubelib.send_request(number, "aging", nil) if state and counter and aging then if type(counter) ~= "number" then counter = "unknown" end - minetest.chat_send_player(user:get_player_name(), "[Tubelib] state ="..state..", counter = "..counter..", aging = "..aging) + minetest.chat_send_player(user:get_player_name(), S("[Tubelib] state").." ="..state..", "..S("counter").." = "..counter..", "..S("aging").." = "..aging) end end end end minetest.register_craftitem("tubelib:repairkit", { - description = "Tubelib Repair Kit", + description = S("Tubelib Repair Kit"), inventory_image = "tubelib_repairkit.png", wield_image = "tubelib_repairkit.png^[transformR270", groups = {cracky=1, book=1}, @@ -64,7 +66,7 @@ minetest.register_craftitem("tubelib:repairkit", { minetest.register_node("tubelib:end_wrench", { - description = "Tubelib End Wrench (use = read status, place = destroy)", + description = S("Tubelib End Wrench (use = read status, place = destroy)"), inventory_image = "tubelib_end_wrench.png", wield_image = "tubelib_end_wrench.png", groups = {cracky=1, book=1}, diff --git a/mods/techpack/tubelib/states.lua b/mods/techpack/tubelib/states.lua index 3710d63a..8c6f634b 100644 --- a/mods/techpack/tubelib/states.lua +++ b/mods/techpack/tubelib/states.lua @@ -3,9 +3,9 @@ Tube Library ============ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information states.lua: diff --git a/mods/techpack/tubelib/tubes.lua b/mods/techpack/tubelib/tubes.lua index f2e932f8..d467fde7 100644 --- a/mods/techpack/tubelib/tubes.lua +++ b/mods/techpack/tubelib/tubes.lua @@ -3,15 +3,18 @@ Tubes based on tubelib2 ======================= - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information tubes.lua: Node registration and API functions to move items via tubes ]]-- +-- Load support for I18n +local S = tubelib.S + -- used for registered nodes tubelib.KnownNodes = { ["tubelib:tubeS"] = true, @@ -33,7 +36,7 @@ local Tube = tubelib2.Tube:new({ tubelib.Tube = Tube minetest.register_node("tubelib:tubeS", { - description = "Tubelib Tube", + description = S("Tubelib Tube"), tiles = { -- Top, base, right, left, front, back "tubelib_tube.png^[transformR90", "tubelib_tube.png^[transformR90", @@ -80,7 +83,7 @@ minetest.register_node("tubelib:tubeS", { }) minetest.register_node("tubelib:tubeA", { - description = "Tubelib Tube", + description = S("Tubelib Tube"), tiles = { -- Top, base, right, left, front, back "tubelib_knee2.png", "tubelib_hole2.png^[transformR180", diff --git a/mods/techpack/tubelib_addons1/autocrafter.lua b/mods/techpack/tubelib_addons1/autocrafter.lua index 8437903e..4aa0cbc1 100644 --- a/mods/techpack/tubelib_addons1/autocrafter.lua +++ b/mods/techpack/tubelib_addons1/autocrafter.lua @@ -3,9 +3,9 @@ Tubelib Addons ============== - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information The autocrafter is derived from pipeworks: @@ -15,8 +15,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -47,7 +49,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:autocrafter", node_name_active = "tubelib_addons1:autocrafter_active", node_name_defect = "tubelib_addons1:autocrafter_defect", - infotext_name = "Tubelib Autocrafter", + infotext_name = S("Tubelib Autocrafter"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -287,7 +289,7 @@ end minetest.register_node("tubelib_addons1:autocrafter", { - description = "Tubelib Autocrafter", + description = S("Tubelib Autocrafter"), drawtype = "normal", tiles = { 'tubelib_front.png', @@ -335,7 +337,7 @@ minetest.register_node("tubelib_addons1:autocrafter", { }) minetest.register_node("tubelib_addons1:autocrafter_active", { - description = "Tubelib Autocrafter", + description = S("Tubelib Autocrafter"), drawtype = "normal", tiles = { 'tubelib_front.png', @@ -368,7 +370,7 @@ minetest.register_node("tubelib_addons1:autocrafter_active", { }) minetest.register_node("tubelib_addons1:autocrafter_defect", { - description = "Tubelib Autocrafter", + description = S("Tubelib Autocrafter"), drawtype = "normal", tiles = { 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons1/chest.lua b/mods/techpack/tubelib_addons1/chest.lua index c585b385..363eae36 100644 --- a/mods/techpack/tubelib_addons1/chest.lua +++ b/mods/techpack/tubelib_addons1/chest.lua @@ -3,15 +3,18 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information chest.lua ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + local PlayerActions = {} local InventoryState = {} @@ -74,7 +77,7 @@ local function formspec() end minetest.register_node("tubelib_addons1:chest", { - description = "Tubelib Protected Chest", + description = S("Tubelib Protected Chest"), tiles = { -- up, down, right, left, back, front "default_chest_top.png^tubelib_addons1_frame.png", @@ -97,7 +100,7 @@ minetest.register_node("tubelib_addons1:chest", { meta:set_string("number", number) meta:set_string("owner", placer:get_player_name()) meta:set_string("formspec", formspec()) - meta:set_string("infotext", "Tubelib Protected Chest "..number) + meta:set_string("infotext", S("Tubelib Protected Chest").." "..number) end, can_dig = function(pos, player) @@ -157,7 +160,7 @@ tubelib.register_node("tubelib_addons1:chest", {}, { local meta = minetest.get_meta(pos) meta:set_string("dest_num", payload) local number = meta:get_string("number") - meta:set_string("infotext", "Tubelib Protected Chest "..number.." connected with "..payload) + meta:set_string("infotext", S("Tubelib Protected Chest").." "..number.." "..S("connected with").." "..payload) return true end else diff --git a/mods/techpack/tubelib_addons1/detector.lua b/mods/techpack/tubelib_addons1/detector.lua index e6573449..aae81b57 100644 --- a/mods/techpack/tubelib_addons1/detector.lua +++ b/mods/techpack/tubelib_addons1/detector.lua @@ -3,15 +3,17 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information detector.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons1.S local function switch_on(pos) if tubelib.data_not_corrupted(pos) then @@ -42,7 +44,7 @@ end minetest.register_node("tubelib_addons1:detector", { - description = "Tubelib Detector", + description = S("Tubelib Detector"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -58,10 +60,10 @@ minetest.register_node("tubelib_addons1:detector", { local own_num = tubelib.add_node(pos, "tubelib_addons1:detector") meta:set_string("own_num", own_num) meta:set_string("formspec", "size[7.5,3]".. - "field[0.5,1;7,1;numbers;Insert destination node number(s);]" .. - "button_exit[2,2;3,1;exit;Save]") + "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";]" .. + "button_exit[2,2;3,1;exit;"..S("Save").."]") meta:set_string("placer_name", placer:get_player_name()) - meta:set_string("infotext", "Tubelib Detector, unconfigured") + meta:set_string("infotext", S("Tubelib Detector, unconfigured")) end, on_receive_fields = function(pos, formname, fields, player) @@ -69,10 +71,10 @@ minetest.register_node("tubelib_addons1:detector", { if tubelib.check_numbers(fields.numbers) then meta:set_string("numbers", fields.numbers) local own_num = meta:get_string("own_num") - meta:set_string("infotext", "Tubelib Detector, connected") + meta:set_string("infotext", S("Tubelib Detector, connected")) meta:set_string("formspec", "size[7.5,3]".. - "field[0.5,1;7,1;numbers;Insert destination node number(s);"..fields.numbers.."]" .. - "button_exit[2,2;3,1;exit;Save]") + "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..fields.numbers.."]" .. + "button_exit[2,2;3,1;exit;"..S("Save").."]") end end, @@ -91,7 +93,7 @@ minetest.register_node("tubelib_addons1:detector", { minetest.register_node("tubelib_addons1:detector_active", { - description = "Tubelib Detector", + description = S("Tubelib Detector"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons1/fermenter.lua b/mods/techpack/tubelib_addons1/fermenter.lua index 0abb51f9..05236f7e 100644 --- a/mods/techpack/tubelib_addons1/fermenter.lua +++ b/mods/techpack/tubelib_addons1/fermenter.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information fermenter.lua @@ -15,8 +15,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -46,7 +48,7 @@ end local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:fermenter", node_name_defect = "tubelib_addons1:fermenter_defect", - infotext_name = "Tubelib Fermenter", + infotext_name = S("Tubelib Fermenter"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -161,7 +163,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons1:fermenter", { - description = "Tubelib Fermenter", + description = S("Tubelib Fermenter"), inventory_image = "tubelib_addons1_fermenter_inventory.png", tiles = { -- up, down, right, left, back, front @@ -192,7 +194,7 @@ minetest.register_node("tubelib_addons1:fermenter", { State:node_init(pos, number) else minetest.remove_node(pos) - minetest.chat_send_player(placer:get_player_name(), "Fermenter will not fit there") + minetest.chat_send_player(placer:get_player_name(), S("Fermenter will not fit there")) return true end end, @@ -231,7 +233,7 @@ minetest.register_node("tubelib_addons1:fermenter", { }) minetest.register_node("tubelib_addons1:fermenter_defect", { - description = "Tubelib Fermenter defect", + description = S("Tubelib Fermenter defect"), inventory_image = "tubelib_addons1_fermenter_inventory.png", tiles = { -- up, down, right, left, back, front @@ -263,7 +265,7 @@ minetest.register_node("tubelib_addons1:fermenter_defect", { State:defect(pos, M(pos)) else minetest.remove_node(pos) - minetest.chat_send_player(placer:get_player_name(), "Fermenter will not fit there") + minetest.chat_send_player(placer:get_player_name(), S("Fermenter will not fit there")) return true end end, @@ -303,7 +305,7 @@ minetest.register_node("tubelib_addons1:fermenter_defect", { }) minetest.register_node("tubelib_addons1:fermenter_top", { - description = "Tubelib Fermenter Top", + description = S("Tubelib Fermenter Top"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -323,19 +325,19 @@ minetest.register_node("tubelib_addons1:fermenter_top", { }) minetest.register_craftitem("tubelib_addons1:biogas", { - description = "Bio Gas", + description = S("Bio Gas"), inventory_image = "tubelib_addons1_biogas.png", }) if minetest.global_exists("unified_inventory") then unified_inventory.register_craft_type("fermenting", { - description = "Fermenter", + description = S("Fermenter"), icon = "tubelib_addons1_fermenter_inventory.png", width = 2, height = 2, }) unified_inventory.register_craft_type("reforming", { - description = "Reformer", + description = S("Reformer"), icon = "tubelib_addons1_reformer_inventory.png", width = 2, height = 2, diff --git a/mods/techpack/tubelib_addons1/funnel.lua b/mods/techpack/tubelib_addons1/funnel.lua index 108f520b..0f21c3dc 100644 --- a/mods/techpack/tubelib_addons1/funnel.lua +++ b/mods/techpack/tubelib_addons1/funnel.lua @@ -3,15 +3,18 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information funnel.lua ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + local function allow_metadata_inventory_put(pos, listname, index, stack, player) if minetest.is_protected(pos, player:get_player_name()) then return 0 @@ -60,7 +63,7 @@ local function scan_for_objects(pos, elapsed) end minetest.register_node("tubelib_addons1:funnel", { - description = "Tubelib Funnel", + description = S("Tubelib Funnel"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_funnel_top.png', diff --git a/mods/techpack/tubelib_addons1/grinder.lua b/mods/techpack/tubelib_addons1/grinder.lua index 23124adf..10af7b64 100644 --- a/mods/techpack/tubelib_addons1/grinder.lua +++ b/mods/techpack/tubelib_addons1/grinder.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information grinder.lua @@ -14,8 +14,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -49,7 +51,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:grinder", node_name_active = "tubelib_addons1:grinder_active", node_name_defect = "tubelib_addons1:grinder_defect", - infotext_name = "Tubelib Grinder", + infotext_name = S("Tubelib Grinder"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -120,7 +122,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons1:grinder", { - description = "Tubelib Grinder", + description = S("Tubelib Grinder"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_grinder.png', @@ -170,7 +172,7 @@ minetest.register_node("tubelib_addons1:grinder", { minetest.register_node("tubelib_addons1:grinder_active", { - description = "Tubelib Grinder", + description = S("Tubelib Grinder"), tiles = { -- up, down, right, left, back, front { @@ -207,7 +209,7 @@ minetest.register_node("tubelib_addons1:grinder_active", { }) minetest.register_node("tubelib_addons1:grinder_defect", { - description = "Tubelib Grinder", + description = S("Tubelib Grinder"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_grinder.png', @@ -296,7 +298,7 @@ tubelib.register_node("tubelib_addons1:grinder", if minetest.global_exists("unified_inventory") then unified_inventory.register_craft_type("grinding", { - description = "Grinding", + description = S("Grinding"), icon = 'tubelib_addons1_grinder.png', width = 1, height = 1, diff --git a/mods/techpack/tubelib_addons1/harvester.lua b/mods/techpack/tubelib_addons1/harvester.lua index 37b05f61..a5852344 100644 --- a/mods/techpack/tubelib_addons1/harvester.lua +++ b/mods/techpack/tubelib_addons1/harvester.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information harvester.lua @@ -19,8 +19,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -56,8 +58,8 @@ local function formspec(self, pos, meta) default.gui_bg_img.. default.gui_slots.. "dropdown[0,0;1.5;radius;4,6,8,10,12,14,16;"..radius.."]".. - "label[1.6,0.2;Area radius]".. - "checkbox[0,1;endless;Run endless;"..endless.."]".. + "label[1.6,0.2;"..S("Area radius").."]".. + "checkbox[0,1;endless;"..S("Run endless")..";"..endless.."]".. "list[context;main;5,0;4,4;]".. "list[context;fuel;1.5,3;1,1;]".. "item_image[1.5,3;1,1;tubelib_addons1:biofuel]".. @@ -72,7 +74,7 @@ end local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:harvester_base", node_name_defect = "tubelib_addons1:harvester_defect", - infotext_name = "Tubelib Harvester", + infotext_name = S("Tubelib Harvester"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -254,8 +256,8 @@ local function keep_running(pos, elapsed) if harvest_field(this, meta) then meta:set_string("this", minetest.serialize(this)) meta:set_string("infotext", - "Tubelib Harvester "..this.number.. - ": running ("..this.idx.."/"..this.max..")") + S("Tubelib Harvester").." "..this.number.. + S(": running (")..this.idx.."/"..this.max..")") State:keep_running(pos, meta, COUNTDOWN_TICKS, this.num_items) else State:blocked(pos, meta) @@ -300,7 +302,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons1:harvester_base", { - description = "Tubelib Harvester Base", + description = S("Tubelib Harvester Base"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -356,7 +358,7 @@ minetest.register_node("tubelib_addons1:harvester_base", { }) minetest.register_node("tubelib_addons1:harvester_defect", { - description = "Tubelib Harvester Base", + description = S("Tubelib Harvester Base"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons1/init.lua b/mods/techpack/tubelib_addons1/init.lua index 46c140b1..f95bf4e4 100644 --- a/mods/techpack/tubelib_addons1/init.lua +++ b/mods/techpack/tubelib_addons1/init.lua @@ -3,13 +3,17 @@ Tubelib Addons 1 ================ - Copyright (C) 2017,2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- +tubelib_addons1 = {} + +-- Load support for I18n +tubelib_addons1.S = minetest.get_translator("tubelib_addons1") dofile(minetest.get_modpath("tubelib_addons1") .. "/quarry.lua") dofile(minetest.get_modpath("tubelib_addons1") .. "/grinder.lua") diff --git a/mods/techpack/tubelib_addons1/liquidsampler.lua b/mods/techpack/tubelib_addons1/liquidsampler.lua index 3e51938e..dfea956d 100644 --- a/mods/techpack/tubelib_addons1/liquidsampler.lua +++ b/mods/techpack/tubelib_addons1/liquidsampler.lua @@ -3,17 +3,19 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information liquidsampler.lua ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -43,7 +45,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:liquidsampler", node_name_active = "tubelib_addons1:liquidsampler_active", node_name_defect = "tubelib_addons1:liquidsampler_defect", - infotext_name = "Liquid Sampler", + infotext_name = S("Liquid Sampler"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -128,7 +130,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons1:liquidsampler", { - description = "Liquid Sampler", + description = S("Liquid Sampler"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -180,7 +182,7 @@ minetest.register_node("tubelib_addons1:liquidsampler", { }) minetest.register_node("tubelib_addons1:liquidsampler_active", { - description = "Liquid Sampler", + description = S("Liquid Sampler"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -216,7 +218,7 @@ minetest.register_node("tubelib_addons1:liquidsampler_active", { }) minetest.register_node("tubelib_addons1:liquidsampler_defect", { - description = "Liquid Sampler", + description = S("Liquid Sampler"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons1/locale/template.txt b/mods/techpack/tubelib_addons1/locale/template.txt new file mode 100644 index 00000000..b899b77c --- /dev/null +++ b/mods/techpack/tubelib_addons1/locale/template.txt @@ -0,0 +1,75 @@ +# textdomain: tubelib_addons1 + + + +### autocrafter.lua ### + +Tubelib Autocrafter= + +### chest.lua ### + +Tubelib Protected Chest= +connected with= + +### detector.lua ### + +Insert destination node number(s)= +Save= +Tubelib Detector= +Tubelib Detector, connected= +Tubelib Detector, unconfigured= + +### fermenter.lua ### + +Bio Gas= +Fermenter= +Fermenter will not fit there= +Reformer= +Tubelib Fermenter= +Tubelib Fermenter Top= +Tubelib Fermenter defect= + +### funnel.lua ### + +Tubelib Funnel= + +### grinder.lua ### + +Grinding= +Tubelib Grinder= + +### harvester.lua ### + +: running (= +Area radius= +Tubelib Harvester= +Tubelib Harvester Base= + +### harvester.lua ### +### quarry.lua ### + +Run endless= + +### liquidsampler.lua ### + +Liquid Sampler= + +### pusher_fast.lua ### + +Fast Pusher= + +### quarry.lua ### + +Digging depth= +Start level= +Tubelib Quarry= +[Tubelib Quarry] Area is protected!= +running= + +### reformer.lua ### + +Bio Fuel= +Reformer will not fit there= +Tubelib Reformer= +Tubelib Reformer Top= +Tubelib Reformer defect= diff --git a/mods/techpack/tubelib_addons1/locale/tubelib_addons1.de.tr b/mods/techpack/tubelib_addons1/locale/tubelib_addons1.de.tr new file mode 100644 index 00000000..14ec1906 --- /dev/null +++ b/mods/techpack/tubelib_addons1/locale/tubelib_addons1.de.tr @@ -0,0 +1,75 @@ +# textdomain: tubelib_addons1 + + + +### autocrafter.lua ### + +Tubelib Autocrafter=Tubelib Autocrafter + +### chest.lua ### + +Tubelib Protected Chest=Tubelib geschützte Kiste +connected with=verbunden mit + +### detector.lua ### + +Insert destination node number(s)=Geben Sie die Zielknotennummer(n) ein. +Save=Speichern +Tubelib Detector=Tubelib Detektor +Tubelib Detector, connected=Tubelib Detektor, verbunden +Tubelib Detector, unconfigured=Tubelib Detektor, nicht konfiguriert + +### fermenter.lua ### + +Bio Gas=Biogas +Fermenter=Fermenter +Fermenter will not fit there=Fermenter wird dort nicht passen +Reformer=Reformer +Tubelib Fermenter=Tubelib Fermenter +Tubelib Fermenter Top=Tubelib Fermenter Oberteil +Tubelib Fermenter defect=Tubelib Fermenter defekt + +### funnel.lua ### + +Tubelib Funnel=Tubelib Trichter + +### grinder.lua ### + +Grinding=Mahlen +Tubelib Grinder=Tubelib Mühle + +### harvester.lua ### + +: running (=: läuft ( +Area radius=Flächenradius +Tubelib Harvester=Tubelib Ernter +Tubelib Harvester Base=Tubelib Ernter Basis + +### harvester.lua ### +### quarry.lua ### + +Run endless=endlos laufen + +### liquidsampler.lua ### + +Liquid Sampler=Flüssigkeitsaufnehmer + +### pusher_fast.lua ### + +Fast Pusher=Schneller Schieber + +### quarry.lua ### + +Digging depth=Grabetiefe +Start level=Startebene +Tubelib Quarry=Tubelib Steinbrecher +[Tubelib Quarry] Area is protected!=[Tubelib Steinbrecher] Gebiet ist geschützt! +running=läuft + +### reformer.lua ### + +Bio Fuel=Biotreibstoff +Reformer will not fit there=Reformer wird dort nicht passen +Tubelib Reformer=Tubelib Reformer +Tubelib Reformer Top=Tubelib Reformer Oberteil +Tubelib Reformer defect=Tubelib Reformer defekt diff --git a/mods/techpack/tubelib_addons1/nodes.lua b/mods/techpack/tubelib_addons1/nodes.lua index bf6c1bbc..910c484a 100644 --- a/mods/techpack/tubelib_addons1/nodes.lua +++ b/mods/techpack/tubelib_addons1/nodes.lua @@ -3,15 +3,13 @@ Tubelib Addons 1 ================ - Copyright (C) 2017,2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- -tubelib_addons1 = {} - -- tables needed for Harvester tubelib_addons1.FarmingNodes = {} tubelib_addons1.Flowers = {} @@ -68,6 +66,7 @@ fn("default:jungleleaves") fn("default:bush_leaves") fn("default:acacia_bush_leaves") +fn("default:blueberry_bush_leaves") fn("default:cactus", "default:cactus", "default:cactus") fn("default:papyrus", "default:papyrus", "default:papyrus") @@ -77,6 +76,7 @@ fn("default:apple") if farming.mod ~= "redo" then dn("farming:wheat_8", "farming:wheat", "farming:wheat_1") dn("farming:cotton_8", "farming:cotton", "farming:cotton_1") + dn("farming:blueberry_bush_leaves_with_berries", "default:blueberries", "farming:blueberry_bush_leaves") end ------------------------------------------------------------------------------- @@ -117,7 +117,7 @@ end -- Ethereal Farming ------------------------------------------------------------------------------- fn("ethereal:strawberry_8", "ethereal:strawberry 2", "ethereal:strawberry 1") -fn("ethereal:onion_5", "ethereal:wild_onion_plant 2", "ethereal:onion_1") +fn("ethereal:onion_5", "ethereal:wild_onion_plant 2", "ethereal:onion_1") fn("ethereal:willow_trunk", "ethereal:willow_trunk", "ethereal:willow_sapling") @@ -162,24 +162,28 @@ gn("default:ice") gn("default:snowblock") gn("default:snow") gn("default:obsidian") - +gn("default:mese") gn("stairs:stair_cobble") gn("stairs:stair_mossycobble") gn("stairs:stair_desert_cobble") +gn("default:permafrost") +gn("default:permafrost_with_moss") +gn("default:permafrost_with_stones") + gn("default:stone", "default:cobble") gn("default:desert_stone", "default:desert_cobble") gn("default:sandstone", "default:sandstone") gn("default:desert_sandstone", "default:desert_sandstone") +gn("default:silver_sandstone", "default:silver_sandstone") gn("default:clay", "default:clay_lump") + gn("default:stone_with_coal", "default:coal_lump") gn("default:stone_with_iron", "default:iron_lump") gn("default:stone_with_copper", "default:copper_lump") gn("default:stone_with_gold", "default:gold_lump") gn("default:stone_with_tin", "default:tin_lump") - gn("default:stone_with_mese", "default:mese_crystal") - gn("default:stone_with_diamond", "default:diamond") gn("default:dirt_with_grass", "default:dirt") @@ -188,6 +192,13 @@ gn("default:dirt_with_dry_grass", "default:dirt") gn("default:dirt_with_snow", "default:dirt") gn("default:dirt_with_rainforest_litter", "default:dirt") gn("default:dirt_with_grass", "default:dirt") +gn("default:dirt_with_coniferous_litter", "default:dirt") +gn("default:dry_dirt", "default:dry_dirt") +gn("default:dry_dirt_with_dry_grass", "default:dry_dirt") + +gn("default:dirt_with_coniferous_litter") +gn("default:dirt_with_coniferous_litter") +gn("default:dirt_with_coniferous_litter") gn("default:coral_skeleton", "default:coral_skeleton") gn("default:coral_orange", "default:coral_skeleton") diff --git a/mods/techpack/tubelib_addons1/pusher_fast.lua b/mods/techpack/tubelib_addons1/pusher_fast.lua index 4baad5c1..8ee9b2cd 100644 --- a/mods/techpack/tubelib_addons1/pusher_fast.lua +++ b/mods/techpack/tubelib_addons1/pusher_fast.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information pusher_fast.lua: @@ -29,8 +29,10 @@ -- | |/ -- +--------+ +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -42,7 +44,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:pusher_fast", node_name_active = "tubelib_addons1:pusher_fast_active", node_name_defect = "tubelib_addons1:pusher_fast_defect", - infotext_name = "Fast Pusher", + infotext_name = S("Fast Pusher"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -75,7 +77,7 @@ local function keep_running(pos, elapsed) end minetest.register_node("tubelib_addons1:pusher_fast", { - description = "Fast Pusher", + description = S("Fast Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_pusher.png', @@ -117,7 +119,7 @@ minetest.register_node("tubelib_addons1:pusher_fast", { minetest.register_node("tubelib_addons1:pusher_fast_active", { - description = "Fast Pusher", + description = S("Fast Pusher"), tiles = { -- up, down, right, left, back, front { @@ -182,7 +184,7 @@ minetest.register_node("tubelib_addons1:pusher_fast_active", { }) minetest.register_node("tubelib_addons1:pusher_fast_defect", { - description = "Fast Pusher", + description = S("Fast Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_pusher.png', diff --git a/mods/techpack/tubelib_addons1/quarry.lua b/mods/techpack/tubelib_addons1/quarry.lua index ea294b66..ea7ac9c7 100644 --- a/mods/techpack/tubelib_addons1/quarry.lua +++ b/mods/techpack/tubelib_addons1/quarry.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information quarry.lua @@ -20,8 +20,11 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end +local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -55,10 +58,10 @@ local function formspec(self, pos, meta) default.gui_bg_img.. default.gui_slots.. "dropdown[0,0;1.5;level;2,1,0,-1,-2,-3,-5,-10,-15,-20;"..Level2Idx[start_level].."]".. - "label[1.6,0.2;Start level]".. + "label[1.6,0.2;"..S("Start level").."]".. "dropdown[0,1;1.5;depth;1,2,3,5,10,15,20,25,50,100;"..Depth2Idx[depth].."]".. - "label[1.6,1.2;Digging depth]".. - "checkbox[0,2;endless;Run endless;"..endless.."]".. + "label[1.6,1.2;"..S("Digging depth").."]".. + "checkbox[0,2;endless;"..S("Run endless")..";"..endless.."]".. "list[context;main;5,0;4,4;]".. "list[context;fuel;1.5,3;1,1;]".. "item_image[1.5,3;1,1;tubelib_addons1:biofuel]".. @@ -74,7 +77,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:quarry", node_name_active = "tubelib_addons1:quarry_active", node_name_defect = "tubelib_addons1:quarry_defect", - infotext_name = "Tubelib Quarry", + infotext_name = S("Tubelib Quarry"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -209,10 +212,10 @@ local function quarry_next_node(pos, meta) return end meta:set_int("idx", idx) - meta:set_string("quarry_pos", S(quarry_pos)) + meta:set_string("quarry_pos", P2S(quarry_pos)) if minetest.is_protected(quarry_pos, owner) then - minetest.chat_send_player(owner, "[Tubelib Quarry] Area is protected!") + minetest.chat_send_player(owner, S("[Tubelib Quarry] Area is protected!")) State:fault(pos, meta) return end @@ -226,15 +229,15 @@ local function quarry_next_node(pos, meta) if inv:room_for_item("main", ItemStack(order.drop)) then minetest.remove_node(quarry_pos) inv:add_item("main", ItemStack(order.drop)) - meta:set_string("infotext", "Tubelib Quarry "..number.. - ": running "..idx.."/"..(start_y-quarry_pos.y+1)) + meta:set_string("infotext", S("Tubelib Quarry").." "..number.. + ": "..S("running").." "..idx.."/"..(start_y-quarry_pos.y+1)) State:keep_running(pos, meta, COUNTDOWN_TICKS, 1) else State:blocked(pos, meta) end else - meta:set_string("infotext", "Tubelib Quarry "..number.. - ": running "..idx.."/"..(start_y-quarry_pos.y+1)) + meta:set_string("infotext", S("Tubelib Quarry").." "..number.. + ": "..S("running").." "..idx.."/"..(start_y-quarry_pos.y+1)) end end end @@ -284,7 +287,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons1:quarry", { - description = "Tubelib Quarry", + description = S("Tubelib Quarry"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -336,7 +339,7 @@ minetest.register_node("tubelib_addons1:quarry", { }) minetest.register_node("tubelib_addons1:quarry_active", { - description = "Tubelib Quarry", + description = S("Tubelib Quarry"), tiles = { -- up, down, right, left, back, front @@ -374,7 +377,7 @@ minetest.register_node("tubelib_addons1:quarry_active", { }) minetest.register_node("tubelib_addons1:quarry_defect", { - description = "Tubelib Quarry", + description = S("Tubelib Quarry"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons1/reformer.lua b/mods/techpack/tubelib_addons1/reformer.lua index 4a88b61a..3803251f 100644 --- a/mods/techpack/tubelib_addons1/reformer.lua +++ b/mods/techpack/tubelib_addons1/reformer.lua @@ -3,9 +3,9 @@ Tubelib Addons 1 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information reformer.lua @@ -15,8 +15,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons1.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -46,7 +48,7 @@ end local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons1:reformer", node_name_defect = "tubelib_addons1:reformer_defect", - infotext_name = "Tubelib Reformer", + infotext_name = S("Tubelib Reformer"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -157,7 +159,7 @@ end minetest.register_node("tubelib_addons1:reformer", { - description = "Tubelib Reformer", + description = S("Tubelib Reformer"), inventory_image = "tubelib_addons1_reformer_inventory.png", tiles = { -- up, down, right, left, back, front @@ -188,7 +190,7 @@ minetest.register_node("tubelib_addons1:reformer", { State:node_init(pos, number) else minetest.remove_node(pos) - minetest.chat_send_player(placer:get_player_name(), "Reformer will not fit there") + minetest.chat_send_player(placer:get_player_name(), S("Reformer will not fit there")) return true end end, @@ -227,7 +229,7 @@ minetest.register_node("tubelib_addons1:reformer", { }) minetest.register_node("tubelib_addons1:reformer_defect", { - description = "Tubelib Reformer defect", + description = S("Tubelib Reformer defect"), inventory_image = "tubelib_addons1_reformer_inventory.png", tiles = { -- up, down, right, left, back, front @@ -259,7 +261,7 @@ minetest.register_node("tubelib_addons1:reformer_defect", { State:defect(pos, M(pos)) else minetest.remove_node(pos) - minetest.chat_send_player(placer:get_player_name(), "Reformer will not fit there") + minetest.chat_send_player(placer:get_player_name(), S("Reformer will not fit there")) return true end end, @@ -300,7 +302,7 @@ minetest.register_node("tubelib_addons1:reformer_defect", { minetest.register_node("tubelib_addons1:reformer_top", { - description = "Tubelib Reformer Top", + description = S("Tubelib Reformer Top"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -320,7 +322,7 @@ minetest.register_node("tubelib_addons1:reformer_top", { }) minetest.register_craftitem("tubelib_addons1:biofuel", { - description = "Bio Fuel", + description = S("Bio Fuel"), inventory_image = "tubelib_addons1_biofuel.png", }) diff --git a/mods/techpack/tubelib_addons2/accesscontrol.lua b/mods/techpack/tubelib_addons2/accesscontrol.lua index bfe8d73a..b7d206dc 100644 --- a/mods/techpack/tubelib_addons2/accesscontrol.lua +++ b/mods/techpack/tubelib_addons2/accesscontrol.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information accesscontrol.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local function switch_on(pos, meta) if tubelib.data_not_corrupted(pos) then minetest.sound_play("tubelib_addons2_door", { @@ -47,9 +50,9 @@ local function formspec1(numbers) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "field[0.5,1;5,1;numbers;Door block numbers:;"..numbers.."]" .. - "field[0.5,2.5;5,1;code;Access code (4 digits):;]" .. - "button_exit[1.5,3.5;2,1;exit;Save]" + "field[0.5,1;5,1;numbers;"..S("Door block numbers:")..";"..numbers.."]" .. + "field[0.5,2.5;5,1;code;"..S("Access code (4 digits):")..";]" .. + "button_exit[1.5,3.5;2,1;exit;"..S("Save").."]" end local function formspec2(code) @@ -57,7 +60,7 @@ local function formspec2(code) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "field[0.5,1;3.6,1;code;Enter access code;"..code.."]" .. + "field[0.5,1;3.6,1;code;"..S("Enter access code")..";"..code.."]" .. "button[0.4,2;1,1;b1;1]" .. "button[1.6,2;1,1;b2;2]" .. "button[2.8,2;1,1;b3;3]" .. @@ -67,11 +70,11 @@ local function formspec2(code) "button[0.4,4;1,1;b7;7]" .. "button[1.6,4;1,1;b8;8]" .. "button[2.8,4;1,1;b9;9]" .. - "button_exit[1.6,5;1,1;ok;OK]" + "button_exit[1.6,5;1,1;ok;"..S("OK").."]" end minetest.register_node("tubelib_addons2:accesscontrol", { - description = "Tubelib Access Lock", + description = S("Tubelib Access Lock"), tiles = { -- up, down, right, left, back, front 'default_steel_block.png', @@ -99,7 +102,7 @@ minetest.register_node("tubelib_addons2:accesscontrol", { meta:set_string("numbers", fields.numbers) meta:set_string("code", fields.code) meta:mark_as_private("code") - meta:set_string("infotext", "Tubelib Access Lock, Enter access code") + meta:set_string("infotext", S("Tubelib Access Lock, Enter access code")) meta:set_string("formspec", formspec2("")) end end diff --git a/mods/techpack/tubelib_addons2/ceilinglamp.lua b/mods/techpack/tubelib_addons2/ceilinglamp.lua index 71374063..2e3bd296 100644 --- a/mods/techpack/tubelib_addons2/ceilinglamp.lua +++ b/mods/techpack/tubelib_addons2/ceilinglamp.lua @@ -3,15 +3,17 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ceilinglamp.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S local function switch_on(pos, node) node.name = "tubelib_addons2:ceilinglamp_on" @@ -27,7 +29,7 @@ local function switch_off(pos, node) end minetest.register_node("tubelib_addons2:ceilinglamp", { - description = "Tubelib Ceiling Lamp", + description = S("Tubelib Ceiling Lamp"), tiles = { -- up, down, right, left, back, front 'tubelib_addons2_ceilinglamp_top.png', @@ -53,7 +55,7 @@ minetest.register_node("tubelib_addons2:ceilinglamp", { after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib_addons2:ceilinglamp") local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Ceiling Lamp "..number) + meta:set_string("infotext", S("Tubelib Ceiling Lamp").." "..number) end, on_rightclick = function(pos, node, clicker) @@ -76,7 +78,7 @@ minetest.register_node("tubelib_addons2:ceilinglamp", { }) minetest.register_node("tubelib_addons2:ceilinglamp_on", { - description = "Tubelib Ceiling Lamp", + description = S("Tubelib Ceiling Lamp"), tiles = { -- up, down, right, left, back, front 'tubelib_addons2_ceilinglamp_top.png', diff --git a/mods/techpack/tubelib_addons2/colorlamp.lua b/mods/techpack/tubelib_addons2/colorlamp.lua index 93b84885..fc2fa34f 100644 --- a/mods/techpack/tubelib_addons2/colorlamp.lua +++ b/mods/techpack/tubelib_addons2/colorlamp.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information colorlamp.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local tColors = {"#0000FF", "#00FFFF", "#00FF00", "#FFFF00", "#FF0000", "#FF00FF", "#FFFFFF", "#000000", "#3BC23B", "#CA3131", "#FFA500", "#FFC0CB"} local sColor = "1,2,3,4,5,6,7,8,9,10,11,12" @@ -24,7 +27,7 @@ local function switch_node(pos, num, player) minetest.swap_node(pos, node) local number = meta:get_int("number") number = string.format("%.04u", number) - meta:set_string("infotext", "Tubelib Color Lamp "..number) + meta:set_string("infotext", S("Tubelib Color Lamp").." "..number) if num ~= "" then meta:set_int("color", num) end @@ -32,7 +35,7 @@ local function switch_node(pos, num, player) end minetest.register_node("tubelib_addons2:lamp", { - description = "Tubelib Color Lamp", + description = S("Tubelib Color Lamp"), tiles = {"tubelib_addons2_lamp.png^[colorize:#000000:100"}, after_place_node = function(pos, placer) @@ -43,7 +46,7 @@ minetest.register_node("tubelib_addons2:lamp", { meta:set_string("formspec", "size[3,2]".. "label[0,0;Select color]".. "dropdown[0,0.5;3;type;"..sColor..";1]".. - "button_exit[0.5,1.5;2,1;exit;Save]") + "button_exit[0.5,1.5;2,1;exit;"..S("Save").."]") meta:set_int("color", 1) end, @@ -96,7 +99,7 @@ minetest.register_craft({ for idx,color in ipairs(tColors) do minetest.register_node("tubelib_addons2:lamp"..idx, { - description = "Tubelib Color Lamp", + description = S("Tubelib Color Lamp"), tiles = { "tubelib_addons2_lamp.png^[colorize:"..color..":120", }, diff --git a/mods/techpack/tubelib_addons2/colorlamp_ud.lua b/mods/techpack/tubelib_addons2/colorlamp_ud.lua index 2fc7a150..34bcdabd 100644 --- a/mods/techpack/tubelib_addons2/colorlamp_ud.lua +++ b/mods/techpack/tubelib_addons2/colorlamp_ud.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information colorlamp_ud.lua which requires the mod unifieddyes: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local function switch_on(pos, node, player) if player == nil or not minetest.is_protected(pos, player:get_player_name()) then node.name = "tubelib_addons2:lamp_on" @@ -27,13 +30,13 @@ local function switch_off(pos, node, player) end minetest.register_node("tubelib_addons2:lamp_off", { - description = "Tubelib Color Lamp", + description = S("Tubelib Color Lamp"), tiles = {"tubelib_addons2_lamp.png^[colorize:#000000:100"}, after_place_node = function(pos, placer, itemstack, pointed_thing) local number = tubelib.add_node(pos, "tubelib_addons2:lamp_off") local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Color Lamp "..number) + meta:set_string("infotext", S("Tubelib Color Lamp").." "..number) unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing) end, @@ -60,7 +63,7 @@ minetest.register_node("tubelib_addons2:lamp_off", { minetest.register_node("tubelib_addons2:lamp_on", { - description = "Tubelib Color Lamp", + description = S("Tubelib Color Lamp"), tiles = {"tubelib_addons2_lamp.png"}, on_rightclick = switch_off, @@ -108,7 +111,7 @@ minetest.register_craft({ -- for idx=1,12 do minetest.register_node("tubelib_addons2:lamp"..idx, { - description = "Tubelib Color Lamp "..idx, + description = S("Tubelib Color Lamp").." "..idx, tiles = {"tubelib_addons2_lamp.png"}, paramtype = 'light', groups = {choppy=2, cracky=1, not_in_creative_inventory=1}, @@ -143,7 +146,7 @@ minetest.register_lbm({ minetest.swap_node(pos, node) local number = meta:get_int("number") or 0 number = string.format("%.04u", number) - meta:set_string("infotext", "Tubelib Color Lamp "..number) + meta:set_string("infotext", S("Tubelib Color Lamp").." "..number) end }) diff --git a/mods/techpack/tubelib_addons2/doorblock.lua b/mods/techpack/tubelib_addons2/doorblock.lua index c65275c8..ae66413a 100644 --- a/mods/techpack/tubelib_addons2/doorblock.lua +++ b/mods/techpack/tubelib_addons2/doorblock.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information doorblock.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local sTextures = "Gate Wood,Aspen Wood,Jungle Wood,Pine Wood,".. "Cobblestone,Sandstone,Stone,Desert Sandstone,".. "Copper,Steel,Tin,Coral,".. @@ -32,7 +35,7 @@ local tPgns = {"tubelib_addon2_door.png", "default_aspen_wood.png", "default_jun local not_in_inventory=nil for idx,pgn in ipairs(tPgns) do minetest.register_node("tubelib_addons2:doorblock"..idx, { - description = "Tubelib Door Block", + description = S("Tubelib Door Block"), tiles = { pgn.."^[transformR90", pgn, @@ -54,11 +57,11 @@ for idx,pgn in ipairs(tPgns) do local node = minetest.get_node(pos) local number = tubelib.add_node(pos, node.name) meta:set_string("number", number) - meta:set_string("infotext", "Tubelib Door Block "..number) + meta:set_string("infotext", S("Tubelib Door Block").." "..number) meta:set_string("formspec", "size[3,2]".. - "label[0,0;Select texture]".. + "label[0,0;"..S("Select texture").."]".. "dropdown[0,0.5;3;type;"..sTextures..";1]".. - "button_exit[0.5,1.5;2,1;exit;Save]") + "button_exit[0.5,1.5;2,1;exit;"..S("Save").."]") end, on_receive_fields = function(pos, formname, fields, player) diff --git a/mods/techpack/tubelib_addons2/gateblock.lua b/mods/techpack/tubelib_addons2/gateblock.lua index 756ee2f3..eb4c3e86 100644 --- a/mods/techpack/tubelib_addons2/gateblock.lua +++ b/mods/techpack/tubelib_addons2/gateblock.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information gateblock.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local NUM_TEXTURES = 20 local sTextures = "Wood,Aspen Wood,Jungle Wood,Pine Wood,".. @@ -34,21 +37,20 @@ local tPgns = {"default_wood.png", "default_aspen_wood.png", "default_junglewood "default_copper_block.png", "default_steel_block.png", "default_tin_block.png", "default_coral_skeleton.png", "default_glass.png", "default_obsidian_glass.png", "default_ice.png", "tubelib_addon2_gate.png"} -local not_in_inventory=nil for idx,pgn in ipairs(tPgns) do minetest.register_node("tubelib_addons2:gateblock"..idx, { - description = "Tubelib Gate Block", + description = S("Tubelib Gate Block"), tiles = {pgn}, after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) local node = minetest.get_node(pos) local number = tubelib.add_node(pos, node.name) meta:set_string("number", number) - meta:set_string("infotext", "Tubelib Gate Block "..number) + meta:set_string("infotext", S("Tubelib Gate Block").." "..number) meta:set_string("formspec", "size[3,2]".. "label[0,0;Select texture]".. "dropdown[0,0.5;3;type;"..sTextures..";"..NUM_TEXTURES.."]".. - "button_exit[0.5,1.5;2,1;exit;Save]") + "button_exit[0.5,1.5;2,1;exit;"..S("Save").."]") end, on_receive_fields = function(pos, formname, fields, player) @@ -73,13 +75,11 @@ for idx,pgn in ipairs(tPgns) do paramtype2 = "facedir", sunlight_propagates = true, sounds = default.node_sound_stone_defaults(), - groups = {cracky=2, choppy=2, crumbly=2, not_in_creative_inventory=not_in_inventory}, + groups = {cracky=2, choppy=2, crumbly=2, not_in_creative_inventory = idx == NUM_TEXTURES and 0 or 1}, is_ground_content = false, drop = "tubelib_addons2:gateblock1", }) - not_in_inventory = 1 - tubelib.register_node("tubelib_addons2:gateblock"..idx, {}, { on_recv_message = function(pos, topic, payload) local node = minetest.get_node(pos) diff --git a/mods/techpack/tubelib_addons2/industriallamp.lua b/mods/techpack/tubelib_addons2/industriallamp.lua index 373879e1..777151b2 100644 --- a/mods/techpack/tubelib_addons2/industriallamp.lua +++ b/mods/techpack/tubelib_addons2/industriallamp.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information industriallamp.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local function switch_on(pos, node) if string.sub(node.name, -3) ~= "_on" then node.name = node.name.."_on" @@ -32,7 +35,7 @@ end local function register_lamp(tbl) local num, tiles, tiles_on, node_box, size = tbl.num, tbl.tiles, tbl.tiles_on, tbl.node_box, tbl.size minetest.register_node("tubelib_addons2:industriallamp"..num, { - description = "Tubelib Industrial Lamp "..num, + description = S("Tubelib Industrial Lamp").." "..num, tiles = tiles, drawtype = "nodebox", node_box = node_box, @@ -48,7 +51,7 @@ local function register_lamp(tbl) after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib_addons2:industriallamp"..num) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Industrial Lamp "..num..": "..number) + meta:set_string("infotext", S("Tubelib Industrial Lamp").." "..num..": "..number) end, on_rightclick = function(pos, node, clicker) @@ -72,7 +75,7 @@ local function register_lamp(tbl) }) minetest.register_node("tubelib_addons2:industriallamp"..num.."_on", { - description = "Tubelib Industrial Lamp "..num, + description = S("Tubelib Industrial Lamp").." "..num, tiles = tiles_on, drawtype = "nodebox", node_box = node_box, @@ -87,7 +90,7 @@ local function register_lamp(tbl) after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib_addons2:industriallamp"..num) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Industrial Lamp "..num..": "..number) + meta:set_string("infotext", S("Tubelib Industrial Lamp").." "..num..": "..number) end, on_rightclick = function(pos, node, clicker) diff --git a/mods/techpack/tubelib_addons2/init.lua b/mods/techpack/tubelib_addons2/init.lua index fb378101..94bdd5a8 100644 --- a/mods/techpack/tubelib_addons2/init.lua +++ b/mods/techpack/tubelib_addons2/init.lua @@ -3,13 +3,19 @@ Tubelib Addons 2 ================ - Copyright (C) 2017,2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- +tubelib_addons2 = {} + + +-- Load support for I18n +tubelib_addons2.S = minetest.get_translator("tubelib_addons2") + dofile(minetest.get_modpath("tubelib_addons2") .. "/timer.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/sequencer.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/gateblock.lua") diff --git a/mods/techpack/tubelib_addons2/invisiblelamp.lua b/mods/techpack/tubelib_addons2/invisiblelamp.lua index 8e532efb..7d2721e1 100644 --- a/mods/techpack/tubelib_addons2/invisiblelamp.lua +++ b/mods/techpack/tubelib_addons2/invisiblelamp.lua @@ -3,15 +3,17 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information invisiblelamp.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S local function switch_on(pos, node) node.name = "tubelib_addons2:invisiblelamp_on" @@ -27,7 +29,7 @@ local function switch_off(pos, node) end minetest.register_node("tubelib_addons2:invisiblelamp", { - description = "Tubelib Invisible Lamp", + description = S("Tubelib Invisible Lamp"), drawtype = "glasslike_framed_optional", tiles = {"tubelib_addons2_invisiblelamp.png"}, inventory_image = 'tubelib_addons2_invisiblelamp_inventory.png', @@ -35,7 +37,7 @@ minetest.register_node("tubelib_addons2:invisiblelamp", { after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib_addons2:invisiblelamp") local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Invisible Lamp "..number) + meta:set_string("infotext", S("Tubelib Invisible Lamp").." "..number) end, on_rightclick = function(pos, node, clicker) @@ -58,7 +60,7 @@ minetest.register_node("tubelib_addons2:invisiblelamp", { }) minetest.register_node("tubelib_addons2:invisiblelamp_on", { - description = "Tubelib Invisible Lamp", + description = S("Tubelib Invisible Lamp"), drawtype = "glasslike_framed_optional", tiles = {"tubelib_addons2_invisiblelamp.png"}, diff --git a/mods/techpack/tubelib_addons2/locale/template.txt b/mods/techpack/tubelib_addons2/locale/template.txt new file mode 100644 index 00000000..1228f9a4 --- /dev/null +++ b/mods/techpack/tubelib_addons2/locale/template.txt @@ -0,0 +1,115 @@ +# textdomain: tubelib_addons2 + + +### accesscontrol.lua ### + +Access code (4 digits):= +Door block numbers:= +Enter access code= +OK= +Tubelib Access Lock= +Tubelib Access Lock, Enter access code= + +### accesscontrol.lua ### +### colorlamp.lua ### +### doorblock.lua ### +### gateblock.lua ### +### logic_not.lua ### +### mesecons_converter.lua ### +### repeater.lua ### + +Save= + +### ceilinglamp.lua ### + +Tubelib Ceiling Lamp= + +### colorlamp.lua ### +### colorlamp_ud.lua ### + +Tubelib Color Lamp= + +### doorblock.lua ### + +Select texture= +Tubelib Door Block= + +### gateblock.lua ### + +Tubelib Gate Block= + +### industriallamp.lua ### + +Tubelib Industrial Lamp= + +### invisiblelamp.lua ### + +Tubelib Invisible Lamp= + +### logic_not.lua ### + +Tubelib Logic Not= + +### logic_not.lua ### +### mesecons_converter.lua ### +### repeater.lua ### + +: connected with= +: not connected= +Destination node numbers= + +### mesecons_converter.lua ### + +Tubelib Mesecons Converter= + +### mesecons_converter.lua ### +### repeater.lua ### + +: fault (overloaded)= + +### programmer.lua ### + +Tubelib Programmer= +[Tubelib Programmer] Error: programmer not supported!= +[Tubelib Programmer] Unknown node on= +[Tubelib Programmer] foreign or unknown node!= +[Tubelib Programmer] node programmed!= +[Tubelib Programmer] number= +[Tubelib Programmer] programmer reset= +read= + +### repeater.lua ### + +Tubelib Repeater= + +### sequencer.lua ### + +Define a sequence of commands@nto control other machines.= +If endless is set, the Sequencer@nrestarts again and again.= +Numbers(s) are the node numbers,@nthe command shall sent to.= +Offset is the time to the@nnext line in seconds (1..999).= +Run endless= +Sequencer Help= + +The command ' ' does nothing,@nonly consuming the offset time.= + +The commands 'on'/'off' are used@n for machines and other nodes.= + +Tubelib Sequencer= +exit= +help= + +### sequencer.lua ### +### timer.lua ### + +Command= + +### streetlamp.lua ### + +Tubelib Street Lamp= + +### timer.lua ### + +Number(s)= +Time= +Tubelib Timer= diff --git a/mods/techpack/tubelib_addons2/locale/tubelib_addons2.de.tr b/mods/techpack/tubelib_addons2/locale/tubelib_addons2.de.tr new file mode 100644 index 00000000..92c42d95 --- /dev/null +++ b/mods/techpack/tubelib_addons2/locale/tubelib_addons2.de.tr @@ -0,0 +1,118 @@ +# textdomain: tubelib_addons2 + + + +### accesscontrol.lua ### + +Access code (4 digits):=Zugangscode (4 Zahlen): +Door block numbers:=Türblocknummern: +Enter access code=Zugangscode eingeben +OK=OK +Tubelib Access Lock=Tubelib Zugangsschloss +Tubelib Access Lock, Enter access code=Tubelib Zugangsschloss, Zugangscode eingeben + +### accesscontrol.lua ### +### colorlamp.lua ### +### doorblock.lua ### +### gateblock.lua ### +### logic_not.lua ### +### mesecons_converter.lua ### +### repeater.lua ### + +Save=Speichern + +### ceilinglamp.lua ### + +Tubelib Ceiling Lamp=Tubelib Deckenleuchte + +### colorlamp.lua ### +### colorlamp_ud.lua ### + +Tubelib Color Lamp=Tubelib Farblampe + +### doorblock.lua ### + +Select texture=Wähle Textur +Tubelib Door Block=Tubelib Türblock + +### gateblock.lua ### + +Tubelib Gate Block=Tubelib Torblock + +### industriallamp.lua ### + +Tubelib Industrial Lamp=Tubelib Industrielampe + +### invisiblelamp.lua ### + +Tubelib Invisible Lamp=Tubelib Unsichtbare Lampe + +### logic_not.lua ### + +#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE +Tubelib Logic Not=Tubelib Logisches NOT + +### logic_not.lua ### +### mesecons_converter.lua ### +### repeater.lua ### + +: connected with=: verbunden mit +: not connected=: nicht verbunden +Destination node numbers=Zielknotennummern + +### mesecons_converter.lua ### + +Tubelib Mesecons Converter=Tubelib Mesecons Konverter + +### mesecons_converter.lua ### +### repeater.lua ### + +: fault (overloaded)=: Fehler (überlastet) + +### programmer.lua ### + +Tubelib Programmer=Tubelib Programmer +[Tubelib Programmer] Error: programmer not supported!=[Tubelib Programmer] Fehler: Programmer wird nicht unterstützt! +[Tubelib Programmer] Unknown node on=[Tubelib Programmer] Unbekannter Knoten an +[Tubelib Programmer] foreign or unknown node!=[Tubelib Programmer] fremder oder unbekannter Knoten! +[Tubelib Programmer] node programmed!=[Tubelib Programmer] Knoten programmiert! +[Tubelib Programmer] number=[Tubelib Programmer] Nummer +[Tubelib Programmer] programmer reset=[Tubelib Programmer] Programmer zurückgesetzt +read=lesen + +### repeater.lua ### + +#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE +Tubelib Repeater=Tubelib Repeater + +### sequencer.lua ### + +Define a sequence of commands@nto control other machines.=Definieren Sie eine Folge von Befehlen@nandere Maschinen zu steuern. +If endless is set, the Sequencer@nrestarts again and again.=Wenn endlos eingestellt ist, wird der Sequenzer@nimmer wieder neu gestartet. +Numbers(s) are the node numbers,@nthe command shall sent to.=Zahlen sind die Knotennummern,@nzu denen der Befehl gesendet werden soll. +Offset is the time to the@nnext line in seconds (1..999).=Offset ist die Zeit bis zur@nnächste Zeile in Sekunden (1..999). +Run endless=Laufe endlos +Sequencer Help=Sequenzer-Hilfe + +The command ' ' does nothing,@nonly consuming the offset time.=Der Befehl '' macht nichts,@nverbraucht nur die Wartezeit. + +The commands 'on'/'off' are used@n for machines and other nodes.=Die Befehle 'ein'/'aus' werden@nfür Maschinen und andere Knoten verwendet. + +Tubelib Sequencer=Tubelib Sequenzer +exit=raus +help=Hilfe + +### sequencer.lua ### +### timer.lua ### + +Command=Befehl + +### streetlamp.lua ### + +Tubelib Street Lamp=Tubelib Straßenlaterne + +### timer.lua ### + +Number(s)=Nummer(n) +Time=Zeit +Tubelib Timer=Tubelib Timer diff --git a/mods/techpack/tubelib_addons2/logic_not.lua b/mods/techpack/tubelib_addons2/logic_not.lua index 3003447b..bcb69a09 100644 --- a/mods/techpack/tubelib_addons2/logic_not.lua +++ b/mods/techpack/tubelib_addons2/logic_not.lua @@ -3,24 +3,27 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information logic_not.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local function formspec(meta) local numbers = meta:get_string("numbers") return "size[7,5]".. - "field[0.5,2;6,1;number;Destination node numbers;"..numbers.."]" .. - "button_exit[1,3;2,1;exit;Save]" + "field[0.5,2;6,1;number;"..S("Destination node numbers")..";"..numbers.."]" .. + "button_exit[1,3;2,1;exit;"..S("Save").."]" end minetest.register_node("tubelib_addons2:logic_not", { - description = "Tubelib Logic Not", + description = S("Tubelib Logic Not"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -33,7 +36,7 @@ minetest.register_node("tubelib_addons2:logic_not", { local own_number = tubelib.add_node(pos, "tubelib_addons2:logic_not") meta:set_string("own_number", own_number) meta:set_string("formspec", formspec(meta)) - meta:set_string("infotext", "Tubelib Logic Not "..own_number..": not connected") + meta:set_string("infotext", S("Tubelib Logic Not").." "..own_number..S(": not connected")) meta:set_string("owner", placer:get_player_name()) end, @@ -47,7 +50,7 @@ minetest.register_node("tubelib_addons2:logic_not", { if tubelib.check_numbers(fields.number) then meta:set_string("numbers", fields.number) local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Logic Not "..own_number..": connected with "..fields.number) + meta:set_string("infotext", S("Tubelib Logic Not").." "..own_number..S(": connected with").." "..fields.number) meta:set_string("formspec", formspec(meta)) end end, @@ -82,7 +85,7 @@ tubelib.register_node("tubelib_addons2:logic_not", {}, { local numbers = meta:get_string("numbers") local own_number = meta:get_string("own_number") if topic == "set_numbers" then - meta:set_string("infotext", "Tubelib Logic Not "..own_number..": connected with "..payload) + meta:set_string("infotext", S("Tubelib Logic Not").." "..own_number..S(": connected with").." "..payload) meta:set_string("numbers", payload) meta:set_string("formspec", formspec(meta)) return true diff --git a/mods/techpack/tubelib_addons2/mesecons_converter.lua b/mods/techpack/tubelib_addons2/mesecons_converter.lua index f64d0c5b..eacf4498 100644 --- a/mods/techpack/tubelib_addons2/mesecons_converter.lua +++ b/mods/techpack/tubelib_addons2/mesecons_converter.lua @@ -3,22 +3,25 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information mesecons_converter.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local OVER_LOAD_MAX = 5 local function formspec(meta) local numbers = meta:get_string("numbers") return "size[7,5]".. - "field[0.5,2;6,1;number;Destination node numbers;"..numbers.."]" .. - "button_exit[1,3;2,1;exit;Save]" + "field[0.5,2;6,1;number;"..S("Destination node numbers")..";"..numbers.."]" .. + "button_exit[1,3;2,1;exit;"..S("Save").."]" end local function send_message(pos, topic, payload) @@ -29,7 +32,7 @@ local function send_message(pos, topic, payload) meta:set_int("overload_cnt", overload_cnt) if overload_cnt > OVER_LOAD_MAX then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Mesecons Converter "..own_number..": fault (overloaded)") + meta:set_string("infotext", S("Tubelib Mesecons Converter").." "..own_number..S(": fault (overloaded)")) minetest.get_node_timer(pos):stop() return else @@ -42,7 +45,7 @@ local function send_message(pos, topic, payload) end minetest.register_node("tubelib_addons2:mesecons_converter", { - description = "Tubelib Mesecons Converter", + description = S("Tubelib Mesecons Converter"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -55,7 +58,7 @@ minetest.register_node("tubelib_addons2:mesecons_converter", { local own_number = tubelib.add_node(pos, "tubelib_addons2:mesecons_converter") meta:set_string("own_number", own_number) meta:set_string("formspec", formspec(meta)) - meta:set_string("infotext", "Tubelib Mesecons Converter "..own_number..": not connected") + meta:set_string("infotext", S("Tubelib Mesecons Converter").." "..own_number..S(": not connected")) meta:set_string("owner", placer:get_player_name()) -- send_message is called 24 times after the node is placed meta:set_int("overload_cnt", -24) @@ -72,7 +75,7 @@ minetest.register_node("tubelib_addons2:mesecons_converter", { if tubelib.check_numbers(fields.number) then meta:set_string("numbers", fields.number) local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Mesecons Converter "..own_number..": connected with "..fields.number) + meta:set_string("infotext", S("Tubelib Mesecons Converter").." "..own_number..S(": connected with").." "..fields.number) meta:set_string("formspec", formspec(meta)) end @@ -145,7 +148,7 @@ tubelib.register_node("tubelib_addons2:mesecons_converter", {}, { elseif topic == "set_numbers" then local meta = minetest.get_meta(pos) local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Mesecons Converter "..own_number..": connected with "..payload) + meta:set_string("infotext", S("Tubelib Mesecons Converter").." "..own_number..S(": connected with").." "..payload) meta:set_string("numbers", payload) meta:set_string("formspec", formspec(meta)) end diff --git a/mods/techpack/tubelib_addons2/programmer.lua b/mods/techpack/tubelib_addons2/programmer.lua index fe83da76..8e0aecc3 100644 --- a/mods/techpack/tubelib_addons2/programmer.lua +++ b/mods/techpack/tubelib_addons2/programmer.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information programmer.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local function join_to_string(tbl) local t = {} for key,_ in pairs(tbl) do @@ -23,7 +26,7 @@ end local function reset_programmer(itemstack, user, pointed_thing) user:set_attribute("tubelib_prog_numbers", nil) - minetest.chat_send_player(user:get_player_name(), "[Tubelib Programmer] programmer reset") + minetest.chat_send_player(user:get_player_name(), S("[Tubelib Programmer] programmer reset")) return itemstack end @@ -35,9 +38,9 @@ local function read_number(itemstack, user, pointed_thing) local numbers = minetest.deserialize(user:get_attribute("tubelib_prog_numbers")) or {} numbers[number] = true user:set_attribute("tubelib_prog_numbers", minetest.serialize(numbers)) - minetest.chat_send_player(user:get_player_name(), "[Tubelib Programmer] number "..number.." read") + minetest.chat_send_player(user:get_player_name(), S("[Tubelib Programmer] number").." "..number.." "..S("read")) else - minetest.chat_send_player(user:get_player_name(), "[Tubelib Programmer] Unknown node on "..minetest.pos_to_string(pos)) + minetest.chat_send_player(user:get_player_name(), S("[Tubelib Programmer] Unknown node on").." "..minetest.pos_to_string(pos)) end else return reset_programmer(itemstack, user, pointed_thing) @@ -55,14 +58,14 @@ local function program_numbers(itemstack, placer, pointed_thing) local text = join_to_string(numbers) local player_name = placer:get_player_name() if meta and meta:get_string("owner") ~= player_name then - minetest.chat_send_player(player_name, "[Tubelib Programmer] foreign or unknown node!") + minetest.chat_send_player(player_name, S("[Tubelib Programmer] foreign or unknown node!")) return itemstack end local res = tubelib.send_request(node_number, "set_numbers", text) if res == true then - minetest.chat_send_player(player_name, "[Tubelib Programmer] node programmed!") + minetest.chat_send_player(player_name, S("[Tubelib Programmer] node programmed!")) else - minetest.chat_send_player(player_name, "[Tubelib Programmer] Error: programmer not supported!") + minetest.chat_send_player(player_name, S("[Tubelib Programmer] Error: programmer not supported!")) end return itemstack else @@ -71,7 +74,7 @@ local function program_numbers(itemstack, placer, pointed_thing) end minetest.register_craftitem("tubelib_addons2:programmer", { - description = "Tubelib Programmer", + description = S("Tubelib Programmer"), inventory_image = "tubelib_addons2_programmer.png", stack_max = 1, wield_image = "tubelib_addons2_programmer_wield.png", diff --git a/mods/techpack/tubelib_addons2/repeater.lua b/mods/techpack/tubelib_addons2/repeater.lua index 313996ff..a423180e 100644 --- a/mods/techpack/tubelib_addons2/repeater.lua +++ b/mods/techpack/tubelib_addons2/repeater.lua @@ -3,26 +3,29 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information repeater.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local OVER_LOAD_MAX = 5 local function formspec(meta) local numbers = meta:get_string("numbers") return "size[7,5]".. - "field[0.5,2;6,1;number;Destination node numbers;"..numbers.."]" .. - "button_exit[1,3;2,1;exit;Save]" + "field[0.5,2;6,1;number;"..S("Destination node numbers")..";"..numbers.."]" .. + "button_exit[1,3;2,1;exit;"..S("Save").."]" end minetest.register_node("tubelib_addons2:repeater", { - description = "Tubelib Repeater", + description = S("Tubelib Repeater"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', @@ -35,7 +38,7 @@ minetest.register_node("tubelib_addons2:repeater", { local own_number = tubelib.add_node(pos, "tubelib_addons2:repeater") meta:set_string("own_number", own_number) meta:set_string("formspec", formspec(meta)) - meta:set_string("infotext", "Tubelib Repeater "..own_number..": not connected") + meta:set_string("infotext", S("Tubelib Repeater").." "..own_number..S(": not connected")) meta:set_string("owner", placer:get_player_name()) meta:set_int("overload_cnt", 0) minetest.get_node_timer(pos):start(1) @@ -51,7 +54,7 @@ minetest.register_node("tubelib_addons2:repeater", { if tubelib.check_numbers(fields.number) then meta:set_string("numbers", fields.number) local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Repeater "..own_number..": connected with "..fields.number) + meta:set_string("infotext", S("Tubelib Repeater").." "..own_number..S(": connected with").." "..fields.number) meta:set_string("formspec", formspec(meta)) end @@ -101,12 +104,12 @@ tubelib.register_node("tubelib_addons2:repeater", {}, { meta:set_int("overload_cnt", overload_cnt) if overload_cnt > OVER_LOAD_MAX then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Repeater "..own_number..": fault (overloaded)") + meta:set_string("infotext", S("Tubelib Repeater").." "..own_number..S(": fault (overloaded)")) minetest.get_node_timer(pos):stop() return false elseif topic == "set_numbers" then local own_number = meta:get_string("own_number") - meta:set_string("infotext", "Tubelib Repeater "..own_number..": connected with "..payload) + meta:set_string("infotext", S("Tubelib Repeater").." "..own_number..S(": connected with").." "..payload) meta:set_string("numbers", payload) meta:set_string("formspec", formspec(meta)) return true diff --git a/mods/techpack/tubelib_addons2/sequencer.lua b/mods/techpack/tubelib_addons2/sequencer.lua index 9c7fec17..6cdf8e3d 100644 --- a/mods/techpack/tubelib_addons2/sequencer.lua +++ b/mods/techpack/tubelib_addons2/sequencer.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information sequencer.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local RUNNING_STATE = 1 local STOP_STATE = 0 local NUM_SLOTS = 8 @@ -26,16 +29,16 @@ local function formspec(state, rules, endless) default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[0,0;Number(s)]label[2.1,0;Command]label[6.4,0;Offset/s]"} + "label[0,0;Number(s)]label[2.1,0;"..S("Command").."]label[6.4,0;Offset/s]"} for idx, rule in ipairs(rules or {}) do tbl[#tbl+1] = "field[0.2,"..(-0.2+idx)..";2,1;num"..idx..";;"..(rule.num or "").."]" tbl[#tbl+1] = "dropdown[2,"..(-0.4+idx)..";3.9,1;act"..idx..";"..sAction..";"..(rule.act or "").."]" tbl[#tbl+1] = "field[6.2,"..(-0.2+idx)..";2,1;offs"..idx..";;"..(rule.offs or "").."]" end - tbl[#tbl+1] = "checkbox[0,8.5;endless;Run endless;"..endless.."]" + tbl[#tbl+1] = "checkbox[0,8.5;endless;"..S("Run endless")..";"..endless.."]" tbl[#tbl+1] = "image_button[5,8.5;1,1;".. tubelib.state_button(state) ..";button;]" - tbl[#tbl+1] = "button[6.2,8.5;1.5,1;help;help]" + tbl[#tbl+1] = "button[6.2,8.5;1.5,1;"..S("help")..";help]" return table.concat(tbl) end @@ -45,14 +48,14 @@ local function formspec_help() default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[2,0;Sequencer Help]".. - "label[0,1;Define a sequence of commands\nto control other machines.]".. - "label[0,2.2;Numbers(s) are the node numbers,\nthe command shall sent to.]".. - "label[0,3.4;The commands 'on'/'off' are used\n for machines and other nodes.]".. - "label[0,4.6;Offset is the time to the\nnext line in seconds (1..999).]".. - "label[0,5.8;If endless is set, the Sequencer\nrestarts again and again.]".. - "label[0,7;The command ' ' does nothing,\nonly consuming the offset time.]".. - "button[3,8;2,1;exit;close]" + "label[2,0;"..S("Sequencer Help").."]".. + "label[0,1;"..S("Define a sequence of commands\nto control other machines.").."]".. + "label[0,2.2;"..S("Numbers(s) are the node numbers,\nthe command shall sent to.").."]".. + "label[0,3.4;"..S("The commands 'on'/'off' are used\n for machines and other nodes.").."]".. + "label[0,4.6;"..S("Offset is the time to the\nnext line in seconds (1..999).").."]".. + "label[0,5.8;"..S("If endless is set, the Sequencer\nrestarts again and again.").."]".. + "label[0,7;"..S("The command ' ' does nothing,\nonly consuming the offset time.").."]".. + "button[3,8;2,1;"..S("exit")..";close]" end local function stop_the_sequencer(pos) @@ -60,7 +63,7 @@ local function stop_the_sequencer(pos) local meta = minetest.get_meta(pos) local number = meta:get_string("number") meta:set_int("running", STOP_STATE) - meta:set_string("infotext", "Tubelib Sequencer "..number..": stopped") + meta:set_string("infotext", S("Tubelib Sequencer").." "..number..": stopped") local rules = minetest.deserialize(meta:get_string("rules")) local endless = meta:get_int("endless") or 0 meta:set_string("formspec", formspec(tubelib.STOPPED, rules, endless)) @@ -111,7 +114,7 @@ local function check_rules(pos, elapsed) if index == 1 and offs < 1 then offs = 1 end - meta:set_string("infotext", "Tubelib Sequencer "..number..": running ("..index.."/"..NUM_SLOTS..")") + meta:set_string("infotext", S("Tubelib Sequencer").." "..number..": running ("..index.."/"..NUM_SLOTS..")") meta:set_int("index", index) if offs > 0 then minetest.after(0, restart_timer, pos, offs) @@ -133,7 +136,7 @@ local function start_the_sequencer(pos) local number = meta:get_string("number") meta:set_int("running", 1) meta:set_int("index", 1) - meta:set_string("infotext", "Tubelib Sequencer "..number..": running (1/"..NUM_SLOTS..")") + meta:set_string("infotext", S("Tubelib Sequencer").." "..number..": running (1/"..NUM_SLOTS..")") local rules = minetest.deserialize(meta:get_string("rules")) local endless = meta:get_int("endless") or 0 meta:set_string("formspec", formspec(tubelib.RUNNING, rules, endless)) @@ -196,7 +199,7 @@ local function on_receive_fields(pos, formname, fields, player) end minetest.register_node("tubelib_addons2:sequencer", { - description = "Tubelib Sequencer", + description = S("Tubelib Sequencer"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons2/streetlamp.lua b/mods/techpack/tubelib_addons2/streetlamp.lua index 81002d4a..7d5bc3fd 100644 --- a/mods/techpack/tubelib_addons2/streetlamp.lua +++ b/mods/techpack/tubelib_addons2/streetlamp.lua @@ -3,15 +3,17 @@ Tubelib Addons 2 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information streetlamp.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S local function switch_on(pos, node) node.name = "tubelib_addons2:streetlamp_on" @@ -24,7 +26,7 @@ local function switch_off(pos, node) end minetest.register_node("tubelib_addons2:streetlamp", { - description = "Tubelib Street Lamp", + description = S("Tubelib Street Lamp"), tiles = { -- up, down, right, left, back, front 'tubelib_addons2_streetlamp_top.png', @@ -50,7 +52,7 @@ minetest.register_node("tubelib_addons2:streetlamp", { after_place_node = function(pos, placer) local number = tubelib.add_node(pos, "tubelib_addons2:streetlamp") local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Tubelib Street Lamp "..number) + meta:set_string("infotext", S("Tubelib Street Lamp").." "..number) end, on_rightclick = function(pos, node, clicker) @@ -73,7 +75,7 @@ minetest.register_node("tubelib_addons2:streetlamp", { }) minetest.register_node("tubelib_addons2:streetlamp_on", { - description = "Tubelib Street Lamp", + description = S("Tubelib Street Lamp"), tiles = { -- up, down, right, left, back, front 'tubelib_addons2_streetlamp_top.png', diff --git a/mods/techpack/tubelib_addons2/timer.lua b/mods/techpack/tubelib_addons2/timer.lua index 588e0598..fd21d509 100644 --- a/mods/techpack/tubelib_addons2/timer.lua +++ b/mods/techpack/tubelib_addons2/timer.lua @@ -3,15 +3,18 @@ Tubelib Addons 2 ================ - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information timer.lua: ]]-- +-- Load support for I18n +local S = tubelib_addons2.S + local CYCLE_TIME = 8 local tTime = { @@ -37,7 +40,7 @@ local function formspec(events, numbers, actions) default.gui_bg_img.. default.gui_slots.. - "label[0,0;Time]label[2.3,0;Number(s)]label[4.5,0;Command]".. + "label[0,0;"..S("Time").."]label[2.3,0;"..S("Number(s)").."]label[4.5,0;"..S("Command").."]".. "dropdown[0,1;2,1;e1;"..sTime..";"..events[1].."]".. "field[2.3,1.2;2,1;n1;;"..numbers[1].."]" .. "dropdown[4.5,1;3,1;a1;"..sAction..";"..tAction[actions[1]].."]".. @@ -97,7 +100,7 @@ local function check_rules(pos,elapsed) done = {false,false,false,false,false,false} end meta:set_string("done", minetest.serialize(done)) - meta:set_string("infotext","Tubelib Timer "..hour..":00") + meta:set_string("infotext", S("Tubelib Timer").." "..hour..":00") return true end return false @@ -105,7 +108,7 @@ end minetest.register_node("tubelib_addons2:timer", { - description = "Tubelib Timer", + description = S("Tubelib Timer"), tiles = { -- up, down, right, left, back, front 'tubelib_front.png', diff --git a/mods/techpack/tubelib_addons3/chest.lua b/mods/techpack/tubelib_addons3/chest.lua index e32aeb34..8d075fc2 100644 --- a/mods/techpack/tubelib_addons3/chest.lua +++ b/mods/techpack/tubelib_addons3/chest.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information chest.lua @@ -14,6 +14,9 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + local PlayerActions = {} local InventoryState = {} @@ -76,7 +79,7 @@ local function formspec() end minetest.register_node("tubelib_addons3:chest", { - description = "HighPerf Chest", + description = S("HighPerf Chest"), tiles = { -- up, down, right, left, back, front 'tubelib_addons3_chest_bottom.png', @@ -99,7 +102,7 @@ minetest.register_node("tubelib_addons3:chest", { meta:set_string("number", number) meta:set_string("owner", placer:get_player_name()) meta:set_string("formspec", formspec()) - meta:set_string("infotext", "HighPerf Chest "..number) + meta:set_string("infotext", S("HighPerf Chest").." "..number) end, can_dig = function(pos,player) @@ -168,7 +171,7 @@ tubelib.register_node("tubelib_addons3:chest", {}, { local meta = minetest.get_meta(pos) meta:set_string("dest_num", payload) local number = meta:get_string("number") - meta:set_string("infotext", "HighPerf Chest "..number.." connected with "..payload) + meta:set_string("infotext", S("HighPerf Chest").." "..number.." "..S("connected with").." "..payload) return true end else diff --git a/mods/techpack/tubelib_addons3/distributor.lua b/mods/techpack/tubelib_addons3/distributor.lua index 86d621e8..41d55d90 100644 --- a/mods/techpack/tubelib_addons3/distributor.lua +++ b/mods/techpack/tubelib_addons3/distributor.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2018-2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information distributor.lua: @@ -13,8 +13,10 @@ A high performance distributor ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -55,7 +57,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons3:distributor", node_name_active = "tubelib_addons3:distributor_active", node_name_defect = "tubelib_addons3:distributor_defect", - infotext_name = "HighPerf Distributor", + infotext_name = S("HighPerf Distributor"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, aging_factor = 50, @@ -322,7 +324,7 @@ local function change_filter_settings(pos, slot, val) end minetest.register_node("tubelib_addons3:distributor", { - description = "HighPerf Distributor", + description = S("HighPerf Distributor"), tiles = { -- up, down, right, left, back, front 'tubelib_distributor.png^tubelib_addons3_node_frame.png', @@ -382,7 +384,7 @@ minetest.register_node("tubelib_addons3:distributor", { minetest.register_node("tubelib_addons3:distributor_active", { - description = "HighPerf Distributor", + description = S("HighPerf Distributor"), tiles = { -- up, down, right, left, back, front { @@ -420,7 +422,7 @@ minetest.register_node("tubelib_addons3:distributor_active", { }) minetest.register_node("tubelib_addons3:distributor_defect", { - description = "HighPerf Distributor", + description = S("HighPerf Distributor"), tiles = { -- up, down, right, left, back, front 'tubelib_distributor.png^tubelib_addons3_node_frame.png', diff --git a/mods/techpack/tubelib_addons3/funnel.lua b/mods/techpack/tubelib_addons3/funnel.lua index c149413a..f60b5414 100644 --- a/mods/techpack/tubelib_addons3/funnel.lua +++ b/mods/techpack/tubelib_addons3/funnel.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2019 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information funnel.lua @@ -14,6 +14,9 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + local function allow_metadata_inventory_put(pos, listname, index, stack, player) if minetest.is_protected(pos, player:get_player_name()) then return 0 @@ -62,7 +65,7 @@ local function scan_for_objects(pos, elapsed) end minetest.register_node("tubelib_addons3:funnel", { - description = "HighPerf Funnel", + description = S("HighPerf Funnel"), tiles = { -- up, down, right, left, back, front 'tubelib_addons1_funnel_top.png^tubelib_addons3_node_frame4.png', diff --git a/mods/techpack/tubelib_addons3/init.lua b/mods/techpack/tubelib_addons3/init.lua index a6d584a1..dd2becad 100644 --- a/mods/techpack/tubelib_addons3/init.lua +++ b/mods/techpack/tubelib_addons3/init.lua @@ -3,13 +3,18 @@ Tubelib Addons 3 ================ - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information ]]-- +tubelib_addons3 = {} + +-- Load support for I18n +tubelib_addons3.S = minetest.get_translator("tubelib_addons3") + dofile(minetest.get_modpath("tubelib_addons3") .. '/chest.lua') dofile(minetest.get_modpath("tubelib_addons3") .. '/pusher.lua') dofile(minetest.get_modpath("tubelib_addons3") .. '/distributor.lua') diff --git a/mods/techpack/tubelib_addons3/locale/template.txt b/mods/techpack/tubelib_addons3/locale/template.txt new file mode 100644 index 00000000..c8b3db1d --- /dev/null +++ b/mods/techpack/tubelib_addons3/locale/template.txt @@ -0,0 +1,30 @@ +# textdomain: tubelib_addons3 + + + +### chest.lua ### + +HighPerf Chest= +connected with= + +### distributor.lua ### + +HighPerf Distributor= + +### funnel.lua ### + +HighPerf Funnel= + +### pusher.lua ### + +HighPerf Pusher= + +### pushing_chest.lua ### + +HighPerf Pushing Chest= + +### teleporter.lua ### + +Enter channel string= +Save= +Tubelib Teleporter= diff --git a/mods/techpack/tubelib_addons3/locale/tubelib_addons3.de.tr b/mods/techpack/tubelib_addons3/locale/tubelib_addons3.de.tr new file mode 100644 index 00000000..8395bc53 --- /dev/null +++ b/mods/techpack/tubelib_addons3/locale/tubelib_addons3.de.tr @@ -0,0 +1,30 @@ +# textdomain: tubelib_addons3 + + + +### chest.lua ### + +HighPerf Chest=HighPerf Kiste +connected with=verbunden mit + +### distributor.lua ### + +HighPerf Distributor=HighPerf Verteiler + +### funnel.lua ### + +HighPerf Funnel=HighPerf Trichter + +### pusher.lua ### + +HighPerf Pusher=HighPerf Schieber + +### pushing_chest.lua ### + +HighPerf Pushing Chest=HighPerf Shiebende Kiste + +### teleporter.lua ### + +Enter channel string=Geben Sie die Kanalbezeichner ein +Save=Speichern +Tubelib Teleporter=Tubelib Teleporter diff --git a/mods/techpack/tubelib_addons3/pusher.lua b/mods/techpack/tubelib_addons3/pusher.lua index 1207377d..254d50bd 100644 --- a/mods/techpack/tubelib_addons3/pusher.lua +++ b/mods/techpack/tubelib_addons3/pusher.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information pusher.lua @@ -14,8 +14,10 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + -- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta @@ -27,7 +29,7 @@ local State = tubelib.NodeStates:new({ node_name_passive = "tubelib_addons3:pusher", node_name_active = "tubelib_addons3:pusher_active", node_name_defect = "tubelib_addons3:pusher_defect", - infotext_name = "HighPerf Pusher", + infotext_name = S("HighPerf Pusher"), cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, has_item_meter = true, @@ -60,7 +62,7 @@ local function keep_running(pos, elapsed) end minetest.register_node("tubelib_addons3:pusher", { - description = "HighPerf Pusher", + description = S("HighPerf Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_pusher1.png^tubelib_addons3_node_frame4.png', @@ -102,7 +104,7 @@ minetest.register_node("tubelib_addons3:pusher", { minetest.register_node("tubelib_addons3:pusher_active", { - description = "HighPerf Pusher", + description = S("HighPerf Pusher"), tiles = { -- up, down, right, left, back, front { @@ -167,7 +169,7 @@ minetest.register_node("tubelib_addons3:pusher_active", { }) minetest.register_node("tubelib_addons3:pusher_defect", { - description = "HighPerf Pusher", + description = S("HighPerf Pusher"), tiles = { -- up, down, right, left, back, front 'tubelib_pusher1.png^tubelib_addons3_node_frame4.png', diff --git a/mods/techpack/tubelib_addons3/pushing_chest.lua b/mods/techpack/tubelib_addons3/pushing_chest.lua index 1ab6b0a9..e72a6bdc 100644 --- a/mods/techpack/tubelib_addons3/pushing_chest.lua +++ b/mods/techpack/tubelib_addons3/pushing_chest.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information pushing_chest.lua @@ -14,6 +14,9 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + -- tubelib aging feature local AGING_LEVEL1 = 50 * tubelib.machine_aging_value local AGING_LEVEL2 = 150 * tubelib.machine_aging_value @@ -78,7 +81,7 @@ end local function set_state(meta, state) local number = meta:get_string("number") - meta:set_string("infotext", "HighPerf Pushing Chest "..number..": "..state) + meta:set_string("infotext", S("HighPerf Pushing Chest").." "..number..": "..state) meta:set_string("state", state) end @@ -175,7 +178,7 @@ end minetest.register_node("tubelib_addons3:pushing_chest", { - description = "HighPerf Pushing Chest", + description = S("HighPerf Pushing Chest"), tiles = { -- up, down, right, left, back, front { @@ -244,7 +247,7 @@ minetest.register_node("tubelib_addons3:pushing_chest", { }) minetest.register_node("tubelib_addons3:pushing_chest_defect", { - description = "HighPerf Pushing Chest", + description = S("HighPerf Pushing Chest"), tiles = { -- up, down, right, left, back, front 'tubelib_pusher1.png^tubelib_addons3_node_frame4.png', diff --git a/mods/techpack/tubelib_addons3/teleporter.lua b/mods/techpack/tubelib_addons3/teleporter.lua index 09aeaa54..b8d30722 100644 --- a/mods/techpack/tubelib_addons3/teleporter.lua +++ b/mods/techpack/tubelib_addons3/teleporter.lua @@ -3,9 +3,9 @@ Tubelib Addons 3 ================ - Copyright (C) 2017-2018 Joachim Stolberg + Copyright (C) 2017-2020 Joachim Stolberg - LGPLv2.1+ + AGPL v3 See LICENSE.txt for more information teleporter.lua @@ -14,14 +14,17 @@ ]]-- +-- Load support for I18n +local S = tubelib_addons3.S + local Tube = tubelib.Tube local sFormspec = "size[7.5,3]".. - "field[0.5,1;7,1;channel;Enter channel string;]" .. - "button_exit[2,2;3,1;exit;Save]" + "field[0.5,1;7,1;channel;"..S("Enter channel string")..";]" .. + "button_exit[2,2;3,1;exit;"..S("Save").."]" minetest.register_node("tubelib_addons3:teleporter", { - description = "Tubelib Teleporter", + description = S("Tubelib Teleporter"), tiles = { -- up, down, right, left, back, front 'tubelib_addons3_chest_bottom.png', diff --git a/mods/vehicle_mash/init.lua b/mods/vehicle_mash/init.lua index a3db4311..bc10d965 100755 --- a/mods/vehicle_mash/init.lua +++ b/mods/vehicle_mash/init.lua @@ -1,225 +1,245 @@ -- get modpath local mpath = minetest.get_modpath("vehicle_mash") - --- load framework -dofile(mpath .. "/framework.lua") - --- load crafts local craft_check = minetest.settings:get_bool("vehicle_mash.enable_crafts") -if craft_check or craft_check == nil then - dofile(mpath .. "/crafts.lua") + +-- Do not change value at settingtypes.txt +-- Only change value at minetest.conf and Minetest Settings tab +local api_check = minetest.settings:get_bool("vehicle_mash.api_mode") + +-- Set to default (false) if nil, because all options are normally +-- nil. This will also help with the boolean checks below. +if api_check == nil then + minetest.settings:set_bool("vehicle_mash.api_mode", false) end --- *********************** --- load vehicles down here --- *********************** +if api_check then -- Now we can safely check if this option is enabled + -- load framework + dofile(mpath .. "/framework.lua") --- ** CAR01s ** ------------------------------------------------------------------------------- --- create CAR01 common def -local car01_def = { - -- adjust to change how vehicle reacts while driving - terrain_type = 1, -- 0 = air, 1 = land, 2 = liquid, 3 = land + liquid - max_speed_forward = 10, - max_speed_reverse = 7, - accel = 2, - braking = 4, - turn_speed = 2, - stepheight = 1.1, - -- model specific stuff - visual = "mesh", - mesh = "car.x", - visual_size = {x=1, y=1}, - wield_scale = {x=1, y=1, z=1}, - collisionbox = {-0.6, -0.05, -0.6, 0.6, 1, 0.6}, - onplace_position_adj = -0.45, - -- player specific stuff - player_rotation = {x=0,y=90,z=0}, - driver_attach_at = {x=3.5,y=3.7,z=3.5}, - driver_eye_offset = {x=-4, y=0, z=0}, - number_of_passengers = 3, - passenger_attach_at = {x=3.5,y=3.7,z=-3.5}, - passenger_eye_offset = {x=4, y=0, z=0}, + -- load crafts + if craft_check or craft_check == nil then + dofile(mpath .. "/crafts.lua") + end +else + -- load framework + dofile(mpath .. "/framework.lua") - passenger2_attach_at = {x=-4,y=3.7,z=3.5}, - passenger2_eye_offset = {x=-4, y=3, z=0}, + -- load crafts + if craft_check or craft_check == nil then + dofile(mpath .. "/crafts.lua") + end - passenger3_attach_at = {x=-4,y=3.7,z=-3.5}, - passenger3_eye_offset = {x=4, y=3, z=0}, + -- *********************** + -- load vehicles down here + -- *********************** - -- drop and recipe - drop_on_destroy = {"vehicle_mash:tire 2", "vehicle_mash:windshield", - "vehicle_mash:battery", "vehicle_mash:motor"}, - recipe = nil -} + -- ** CAR01s ** + ------------------------------------------------------------------------------ + -- create CAR01 common def + local car01_def = { + -- adjust to change how vehicle reacts while driving + terrain_type = 1, -- 0 = air, 1 = land, 2 = liquid, 3 = land + liquid + max_speed_forward = 10, + max_speed_reverse = 7, + accel = 2, + braking = 4, + turn_speed = 2, + stepheight = 1.1, + -- model specific stuff + visual = "mesh", + mesh = "car.x", + visual_size = {x=1, y=1}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-0.6, -0.05, -0.6, 0.6, 1, 0.6}, + onplace_position_adj = -0.45, + -- player specific stuff + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=3.5,y=3.7,z=3.5}, + driver_eye_offset = {x=-4, y=0, z=0}, + number_of_passengers = 3, + passenger_attach_at = {x=3.5,y=3.7,z=-3.5}, + passenger_eye_offset = {x=4, y=0, z=0}, -local car01_names = { - "black", "blue", "brown", "cyan", - "dark_green", "dark_grey", "green", - "grey", "magenta", "orange", - "pink", "red", "violet", - "white", "yellow", "hot_rod", - "nyan_ride", "oerkki_bliss", "road_master", -} + passenger2_attach_at = {x=-4,y=3.7,z=3.5}, + passenger2_eye_offset = {x=-4, y=3, z=0}, + + passenger3_attach_at = {x=-4,y=3.7,z=-3.5}, + passenger3_eye_offset = {x=4, y=3, z=0}, + + -- drop and recipe + drop_on_destroy = {"vehicle_mash:tire 2", "vehicle_mash:windshield", + "vehicle_mash:battery", "vehicle_mash:motor"}, + recipe = nil + } + + local car01_names = { + "black", "blue", "brown", "cyan", + "dark_green", "dark_grey", "green", + "grey", "magenta", "orange", + "pink", "red", "violet", + "white", "yellow", "hot_rod", + "nyan_ride", "oerkki_bliss", "road_master", + } -- Load all CAR01's cars if enabled -for _, name in ipairs(car01_names) do - local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name .. "_car") - if check_enabled or check_enabled == nil then - loadfile(mpath .. "/car01s/" .. name .. ".lua")(table.copy(car01_def)) + for _, name in ipairs(car01_names) do + local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name .. "_car") + if check_enabled or check_enabled == nil then + loadfile(mpath .. "/car01s/" .. name .. ".lua")(table.copy(car01_def)) + end end -end --- ** MeseCars ** ------------------------------------------------------------------------------- --- create Mesecar common def -local mesecar_def = { - -- adjust to change how vehicle reacts while driving - terrain_type = 1, - max_speed_forward = 10, - max_speed_reverse = 7, - accel = 3, - braking = 6, - turn_speed = 4, - stepheight = 0.6, - -- model specific stuff - visual = "cube", - mesh = "", - visual_size = {x=1.5, y=1.5}, - wield_scale = {x=1, y=1, z=1}, - collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, - onplace_position_adj = 0.25, - -- player specific stuff - player_rotation = {x=0,y=0,z=0}, - driver_attach_at = {x=0,y=0,z=-2.0}, - driver_eye_offset = {x=0, y=0, z=0}, - number_of_passengers = 0, - passenger_attach_at = {x=0,y=0,z=0}, - passenger_eye_offset = {x=0, y=0, z=0}, + -- ** MeseCars ** + ------------------------------------------------------------------------------ + -- create Mesecar common def + local mesecar_def = { + -- adjust to change how vehicle reacts while driving + terrain_type = 1, + max_speed_forward = 10, + max_speed_reverse = 7, + accel = 3, + braking = 6, + turn_speed = 4, + stepheight = 0.6, + -- model specific stuff + visual = "cube", + mesh = "", + visual_size = {x=1.5, y=1.5}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75}, + onplace_position_adj = 0.25, + -- player specific stuff + player_rotation = {x=0,y=0,z=0}, + driver_attach_at = {x=0,y=0,z=-2.0}, + driver_eye_offset = {x=0, y=0, z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, - passenger2_attach_at = {x=0,y=0,z=0}, - passenger2_eye_offset = {x=0, y=0, z=0}, + passenger2_attach_at = {x=0,y=0,z=0}, + passenger2_eye_offset = {x=0, y=0, z=0}, - passenger3_attach_at = {x=0,y=0,z=0}, - passenger3_eye_offset = {x=0, y=0, z=0}, + passenger3_attach_at = {x=0,y=0,z=0}, + passenger3_eye_offset = {x=0, y=0, z=0}, - -- drop and recipe - drop_on_destroy = {"vehicle_mash:motor", "vehicle_mash:battery"}, - recipe = nil -} + -- drop and recipe + drop_on_destroy = {"vehicle_mash:motor", "vehicle_mash:battery"}, + recipe = nil + } -local mesecar_names = { - "mese_blue", - "mese_pink", - "mese_purple", - "mese_yellow", -} + local mesecar_names = { + "mese_blue", + "mese_pink", + "mese_purple", + "mese_yellow", + } --- Load all Mese Cars if enabled -for _, name in ipairs(mesecar_names) do - local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name .. "_car") - if check_enabled or check_enabled == nil then - loadfile(mpath .. "/mesecars/" .. name .. ".lua")(table.copy(mesecar_def)) + -- Load all Mese Cars if enabled + for _, name in ipairs(mesecar_names) do + local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name .. "_car") + if check_enabled or check_enabled == nil then + loadfile(mpath .. "/mesecars/" .. name .. ".lua")(table.copy(mesecar_def)) + end end -end --- ** Boats ** ------------------------------------------------------------------------------- --- create boats common def -local boat_def = { - -- adjust to change how vehicle reacts while driving - terrain_type = 2, - max_speed_forward = 3, - max_speed_reverse = 3, - accel = 3, - braking = 3, - turn_speed = 3, - stepheight = 0, - -- model specific stuff - visual = "mesh", - visual_size = {x=1, y=1}, - wield_scale = {x=1, y=1, z=1}, - collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, - onplace_position_adj = 0, - textures = {"default_wood.png"}, - -- player specific stuff - player_rotation = {x=0, y=0, z=0}, - driver_attach_at = {x=0.5,y=1,z=-3}, - driver_eye_offset = {x=0, y=0, z=0}, - number_of_passengers = 0, - passenger_attach_at = {x=0,y=0,z=0}, - passenger_eye_offset = {x=0, y=0, z=0}, + -- ** Boats ** + ------------------------------------------------------------------------------ + -- create boats common def + local boat_def = { + -- adjust to change how vehicle reacts while driving + terrain_type = 2, + max_speed_forward = 3, + max_speed_reverse = 3, + accel = 3, + braking = 3, + turn_speed = 3, + stepheight = 0, + -- model specific stuff + visual = "mesh", + visual_size = {x=1, y=1}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, + onplace_position_adj = 0, + textures = {"default_wood.png"}, + -- player specific stuff + player_rotation = {x=0, y=0, z=0}, + driver_attach_at = {x=0.5,y=1,z=-3}, + driver_eye_offset = {x=0, y=0, z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, - passenger2_attach_at = {x=0,y=0,z=0}, - passenger2_eye_offset = {x=0, y=0, z=0}, + passenger2_attach_at = {x=0,y=0,z=0}, + passenger2_eye_offset = {x=0, y=0, z=0}, - passenger3_attach_at = {x=0,y=0,z=0}, - passenger3_eye_offset = {x=0, y=0, z=0} -} + passenger3_attach_at = {x=0,y=0,z=0}, + passenger3_eye_offset = {x=0, y=0, z=0} + } -local boat_names = { - "boat", - "rowboat", -} + local boat_names = { + "boat", + "rowboat", + } --- Load boats if enabled -for _, name in ipairs(boat_names) do - local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name) - if check_enabled or check_enabled == nil then - loadfile(mpath .. "/boats/" .. name .. ".lua")(table.copy(boat_def)) + -- Load boats if enabled + for _, name in ipairs(boat_names) do + local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name) + if check_enabled or check_enabled == nil then + loadfile(mpath .. "/boats/" .. name .. ".lua")(table.copy(boat_def)) + end end -end --- ** Hovercraft ** ------------------------------------------------------------------------------- --- create hovercraft common def -local hover_def = { - -- adjust to change how vehicle reacts while driving - terrain_type = 3, - max_speed_forward = 10, - max_speed_reverse = 0, - accel = 3, - braking = 1, - turn_speed = 2, - stepheight = 1.1, - -- model specific stuff - visual = "mesh", - mesh = "hovercraft.x", - visual_size = {x=1, y=1}, - wield_scale = {x=1, y=1, z=1}, - collisionbox = {-0.8, -0.25, -0.8, 0.8, 1.2, 0.8}, - onplace_position_adj = -0.25, - -- player specific stuff - player_rotation = {x=0,y=90,z=0}, - driver_attach_at = {x=-2,y=6.3,z=0}, - driver_eye_offset = {x=0, y=0, z=0}, - number_of_passengers = 0, - passenger_attach_at = {x=0,y=0,z=0}, - passenger_eye_offset = {x=0, y=0, z=0}, + -- ** Hovercraft ** + ------------------------------------------------------------------------------ + -- create hovercraft common def + local hover_def = { + -- adjust to change how vehicle reacts while driving + terrain_type = 3, + max_speed_forward = 10, + max_speed_reverse = 0, + accel = 3, + braking = 1, + turn_speed = 2, + stepheight = 1.1, + -- model specific stuff + visual = "mesh", + mesh = "hovercraft.x", + visual_size = {x=1, y=1}, + wield_scale = {x=1, y=1, z=1}, + collisionbox = {-0.8, -0.25, -0.8, 0.8, 1.2, 0.8}, + onplace_position_adj = -0.25, + -- player specific stuff + player_rotation = {x=0,y=90,z=0}, + driver_attach_at = {x=-2,y=6.3,z=0}, + driver_eye_offset = {x=0, y=0, z=0}, + number_of_passengers = 0, + passenger_attach_at = {x=0,y=0,z=0}, + passenger_eye_offset = {x=0, y=0, z=0}, - passenger2_attach_at = {x=0,y=0,z=0}, - passenger2_eye_offset = {x=0, y=0, z=0}, + passenger2_attach_at = {x=0,y=0,z=0}, + passenger2_eye_offset = {x=0, y=0, z=0}, - passenger3_attach_at = {x=0,y=0,z=0}, - passenger3_eye_offset = {x=0, y=0, z=0}, + passenger3_attach_at = {x=0,y=0,z=0}, + passenger3_eye_offset = {x=0, y=0, z=0}, - -- recipe - recipe = nil -} + -- recipe + recipe = nil + } -local hover_names = { - "hover_blue", - "hover_green", - "hover_red", - "hover_yellow", -} + local hover_names = { + "hover_blue", + "hover_green", + "hover_red", + "hover_yellow", + } --- Load hovercrafts if enabled -for _, name in ipairs(hover_names) do - local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name) - if check_enabled or check_enabled == nil then - loadfile(mpath .. "/hovers/" .. name .. ".lua")(table.copy(hover_def)) + -- Load hovercrafts if enabled + for _, name in ipairs(hover_names) do + local check_enabled = minetest.settings:get_bool("vehicle_mash.enable_" .. name) + if check_enabled or check_enabled == nil then + loadfile(mpath .. "/hovers/" .. name .. ".lua")(table.copy(hover_def)) + end end end diff --git a/mods/vehicle_mash/settingtypes.txt b/mods/vehicle_mash/settingtypes.txt index 402b5bbf..f5674435 100644 --- a/mods/vehicle_mash/settingtypes.txt +++ b/mods/vehicle_mash/settingtypes.txt @@ -2,6 +2,11 @@ vehicle_mash.enable_crafts (Allows crafting vehicles) bool true +# When enabled, all vehicles are disabled and this mod will be only +# used for API functions/purpose. Because this mod has very good API functions +# for registering vehicles, somebody may use this option in their server. +vehicle_mash.api_mode (Disables all vehicles and only enables API functions) bool false + # CAR01's cars vehicle_mash.enable_black_car (Enables black car) bool true