diff options
author | ywang <yw05@forksworld.de> | 2021-04-23 14:53:09 +0200 |
---|---|---|
committer | ywang <yw05@forksworld.de> | 2021-05-25 19:18:57 +0200 |
commit | 6b4492846f4803b62ba0242dfc6bcfc69056f62a (patch) | |
tree | 35aa7a73df9f32c32a630e5a145e58876e293bd8 | |
parent | 488a5a1bda0b069218fe449c4d7fe01051321874 (diff) | |
download | advtrains-6b4492846f4803b62ba0242dfc6bcfc69056f62a.tar.gz advtrains-6b4492846f4803b62ba0242dfc6bcfc69056f62a.tar.bz2 advtrains-6b4492846f4803b62ba0242dfc6bcfc69056f62a.zip |
Add strings for translation
-rw-r--r-- | advtrains/copytool.lua | 16 | ||||
-rw-r--r-- | advtrains/locale/template.txt | 17 | ||||
-rw-r--r-- | advtrains/protection.lua | 6 |
3 files changed, 28 insertions, 11 deletions
diff --git a/advtrains/copytool.lua b/advtrains/copytool.lua index 0c1cdfe..0b2aa52 100644 --- a/advtrains/copytool.lua +++ b/advtrains/copytool.lua @@ -26,7 +26,7 @@ minetest.register_tool("advtrains:copytool", { return itemstack end if not minetest.check_player_privs(placer, {train_operator = true }) then - minetest.chat_send_player(pname, "You don't have the train_operator privilege.") + minetest.chat_send_player(pname, attrans("You don't have the train_operator privilege.")) return itemstack end if not minetest.check_player_privs(placer, {train_admin = true }) and minetest.is_protected(pointed_thing.under, placer:get_player_name()) then @@ -38,7 +38,7 @@ minetest.register_tool("advtrains:copytool", { local prevpos = advtrains.get_adjacent_rail(pointed_thing.under, tconns, plconnid, {default=true}) if not prevpos then - minetest.chat_send_player(pname, "The track you are trying to place the wagon on is not long enough!") + minetest.chat_send_player(pname, attrans("The track you are trying to place the wagon on is not long enough!")) return end @@ -49,12 +49,12 @@ minetest.register_tool("advtrains:copytool", { end local clipboard = meta:get_string("clipboard") if (clipboard == "") then - minetest.chat_send_player(pname, "The clipboard is empty."); + minetest.chat_send_player(pname, attrans("The clipboard is empty.")); return end clipboard = minetest.deserialize(clipboard) if (clipboard.wagons == nil) then - minetest.chat_send_player(pname, "The clipboard is empty."); + minetest.chat_send_player(pname, attrans("The clipboard is empty.")); return end @@ -71,7 +71,7 @@ minetest.register_tool("advtrains:copytool", { local train = advtrains.trains[id] train.off_track = train.end_index<train.path_trk_b if (train.off_track) then - minetest.chat_send_player(pname, "Back of train would end up off track, cancelling.") + minetest.chat_send_player(pname, attrans("Back of train would end up off track, cancelling.")) advtrains.remove_train(id) return end @@ -89,19 +89,19 @@ minetest.register_tool("advtrains:copytool", { local le = pointed_thing.ref:get_luaentity() if (le == nil) then - minetest.chat_send_player(user:get_player_name(), "No such lua entity!") + minetest.chat_send_player(user:get_player_name(), attrans("No such lua entity!")) return end local wagon = advtrains.wagons[le.id] if (not (le.id and advtrains.wagons[le.id])) then - minetest.chat_send_player(user:get_player_name(), string.format("No such wagon: %s", le.id)) + minetest.chat_send_player(user:get_player_name(), attrans("No such wagon: @1", le.id)) return end local train = advtrains.trains[wagon.train_id] if (not train) then - minetest.chat_send_player(user:get_player_name(), string.format("No such train: %s", wagon.train_id)) + minetest.chat_send_player(user:get_player_name(), attrans("No such train: @1", wagon.train_id)) return end diff --git a/advtrains/locale/template.txt b/advtrains/locale/template.txt index c51770d..67e54eb 100644 --- a/advtrains/locale/template.txt +++ b/advtrains/locale/template.txt @@ -29,8 +29,25 @@ Use Sneak+rightclick to bypass closed doors!=Use Sneak+rightclick to bypass clos Lock couples=Lock couples Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off!=Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off! Access to @1=Access to @1 +You don't have the train_operator privilege.=You don't have the train_operator privilege. + +# Clipboard +The track you are trying to place the wagon on is not long enough!=The track you are trying to place the wagon on is not long enough! The clipboard couldn't access the metadata. Paste failed.=The clipboard couldn't access the metadata. Paste failed. The clipboard couldn't access the metadata. Copy failed.=The clipboard couldn't access the metadata. Copy failed. +The clipboard is empty.=The clipboard is empty. +Back of train would end up off track, cancelling.=Back of train would end up off track, cancelling. +No such lua entity!=No such lua entity! +No such wagon: @1=No such wagon: @1 +No such train: @1=No such train: @1 +Train copied!=Train copied! + +# Protection +You are not allowed to build tracks without the track_builder privilege=You are not allowed to build tracks without the track_builder privilege +You are not allowed to build near tracks without the track_builder privilege=You are not allowed to build near tracks without the track_builder privilege +You are not allowed to build tracks at this protected position=You are not allowed to build tracks at this protected position +You are not allowed to build near tracks at this protected position=You are not allowed to build tracks at this protected position +You are not allowed to operate turnouts and signals (missing railway_operator privilege)=You are not allowed to operate turnouts and signals (missing railway_operator privilege) # Train HUD/Formspecs Speed:=Speed: diff --git a/advtrains/protection.lua b/advtrains/protection.lua index 7474977..cca54a9 100644 --- a/advtrains/protection.lua +++ b/advtrains/protection.lua @@ -145,12 +145,12 @@ function advtrains.check_track_protection(pos, pname, near, prot_p) --atdebug("CTP: ",pos,pname,near,prot_p,"priv=",priv,"prot=",prot,"dprot=",dprot) if not priv and (not boo or prot or not dprot) then - minetest.chat_send_player(pname, "You are not allowed to build "..nears.."tracks without track_builder privilege") + minetest.chat_send_player(pname, attrans("You are not allowed to build "..nears.."tracks without the track_builder privilege")) minetest.log("action", pname.." tried to modify terrain "..nears.."track at "..minetest.pos_to_string(apos).." but is not permitted to (no privilege)") return false end if prot then - minetest.chat_send_player(pname, "You are not allowed to build "..nears.."tracks at protected position!") + minetest.chat_send_player(pname, attrans("You are not allowed to build "..nears.."tracks at this protected position")) minetest.record_protection_violation(pos, pname) minetest.log("action", pname.." tried to modify "..nears.."track at "..minetest.pos_to_string(apos).." but position is protected!") return false @@ -181,7 +181,7 @@ function advtrains.check_turnout_signal_protection(pos, pname) nocheck=false return true else - minetest.chat_send_player(pname, "You are not allowed to operate turnouts and signals (missing railway_operator privilege)") + minetest.chat_send_player(pname, attrans("You are not allowed to operate turnouts and signals (missing railway_operator privilege)")) minetest.log("action", pname.." tried to operate turnout/signal at "..minetest.pos_to_string(pos).." but does not have railway_operator") nocheck=false return false |