aboutsummaryrefslogtreecommitdiff
path: root/advtrains/copytool.lua
diff options
context:
space:
mode:
authorywang <yw05@forksworld.de>2021-03-27 14:13:53 +0100
committerY. Wang <y5nw@protonmail.com>2024-11-04 17:17:08 +0100
commitbed66e0f901ae9f8e21675035f174292120fea4f (patch)
tree917b29a85c4b7c71d1d12a373df652de00e57afd /advtrains/copytool.lua
parent9ada994d5b3bd874e537b0bc9641b925058bdf51 (diff)
downloadadvtrains-bed66e0f901ae9f8e21675035f174292120fea4f.tar.gz
advtrains-bed66e0f901ae9f8e21675035f174292120fea4f.tar.bz2
advtrains-bed66e0f901ae9f8e21675035f174292120fea4f.zip
Rework translation system to use PO files
The French translations are provided by Tanavit. Unfortunately I was not able to keep this addition as a separate commit as the translation file was originally added as a .tr file that I then converted to .po file in the meantime. Also note that this commit is created from squashing 20+ commits from the l10n branch that preceded the transition to PO files. In addition to changes to the locale files (which were all included in the single commit for transitioning to PO files), these commits also included code that has now become obsolete for l10n work. In particular, it included a GUI program written in Tcl to edit .tr files; this program can now be found in the following repo: https://codeberg.org/y5nw/mt_tr_editor Co-authored-by: Tanavit <tanavit@posto.ovh>
Diffstat (limited to 'advtrains/copytool.lua')
-rw-r--r--advtrains/copytool.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/advtrains/copytool.lua b/advtrains/copytool.lua
index 0c1cdfe..7ad4330 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, S("You do not have the @1 privilege.", "train_operator"))
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