From fac8b518c940176f4d644638b1c801c2c113f872 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 23 Jan 2017 21:29:59 +0100 Subject: Add intllib support and German translation --- advtrains/advtrains_train_steam/init.lua | 23 +++++++++++++++-------- advtrains/advtrains_train_steam/locale/de.txt | 6 ++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 advtrains/advtrains_train_steam/locale/de.txt (limited to 'advtrains/advtrains_train_steam') diff --git a/advtrains/advtrains_train_steam/init.lua b/advtrains/advtrains_train_steam/init.lua index 22f525f..ca366db 100644 --- a/advtrains/advtrains_train_steam/init.lua +++ b/advtrains/advtrains_train_steam/init.lua @@ -1,3 +1,10 @@ +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end +end + advtrains.register_wagon("newlocomotive", { mesh="advtrains_engine_steam.b3d", textures = {"advtrains_engine_steam.png"}, @@ -6,13 +13,13 @@ advtrains.register_wagon("newlocomotive", { max_speed=10, seats = { { - name="Driver Stand (left)", + name=S("Driver Stand (left)"), attach_offset={x=-5, y=10, z=-10}, view_offset={x=0, y=6, z=0}, driving_ctrl_access=true, }, { - name="Driver Stand (right)", + name=S("Driver Stand (right)"), attach_offset={x=5, y=10, z=-10}, view_offset={x=0, y=6, z=0}, driving_ctrl_access=true, @@ -55,7 +62,7 @@ advtrains.register_wagon("newlocomotive", { }) end, drops={"default:steelblock 4"}, -}, "Steam Engine", "advtrains_engine_steam_inv.png") +}, S("Steam Engine"), "advtrains_engine_steam_inv.png") advtrains.register_wagon("detailed_steam_engine", { mesh="advtrains_detailed_steam_engine.b3d", @@ -65,13 +72,13 @@ advtrains.register_wagon("detailed_steam_engine", { max_speed=10, seats = { { - name="Driver Stand (left)", + name=S("Driver Stand (left)"), attach_offset={x=-5, y=10, z=-10}, view_offset={x=0, y=6, z=0}, driving_ctrl_access=true, }, { - name="Driver Stand (right)", + name=S("Driver Stand (right)"), attach_offset={x=5, y=10, z=-10}, view_offset={x=0, y=6, z=0}, driving_ctrl_access=true, @@ -114,7 +121,7 @@ advtrains.register_wagon("detailed_steam_engine", { }) end, drops={"default:steelblock 4"}, -}, "Detailed Steam Engine", "advtrains_engine_steam_inv.png") +}, S("Detailed Steam Engine"), "advtrains_engine_steam_inv.png") advtrains.register_wagon("wagon_default", { mesh="advtrains_passenger_wagon.b3d", @@ -147,7 +154,7 @@ advtrains.register_wagon("wagon_default", { wagon_span=3.1, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, drops={"default:steelblock 4"}, -}, "Passenger Wagon", "advtrains_wagon_inv.png") +}, S("Passenger Wagon"), "advtrains_wagon_inv.png") advtrains.register_wagon("wagon_box", { mesh="advtrains_wagon.b3d", textures = {"advtrains_wagon_box.png"}, @@ -168,7 +175,7 @@ advtrains.register_wagon("wagon_box", { inventory_list_sizes = { box=8*6, }, -}, "Box Wagon", "advtrains_wagon_box_inv.png") +}, S("Box Wagon"), "advtrains_wagon_box_inv.png") minetest.register_craft({ output = 'advtrains:newlocomotive', diff --git a/advtrains/advtrains_train_steam/locale/de.txt b/advtrains/advtrains_train_steam/locale/de.txt new file mode 100644 index 0000000..ac06e20 --- /dev/null +++ b/advtrains/advtrains_train_steam/locale/de.txt @@ -0,0 +1,6 @@ +Driver Stand (left) = Führerstand Links +Driver Stand (right) = Führerstand Rechts +Steam Engine = Dampflokomotive +Detailed Steam Engine = detaillierte Dampflokomotive +Passenger Wagon = Passagierwaggon +Box wagon = Güterwaggon \ No newline at end of file -- cgit v1.2.3