From 78fc9565c011d246c992eb5dd429c9a3a72107f6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 21 Mar 2019 11:35:53 +0100 Subject: [PATCH] Make sign formspec translatable --- mods/ITEMS/mcl_signs/init.lua | 3 ++- mods/ITEMS/mcl_signs/locale/mcl_signs.de.tr | 4 ++++ mods/ITEMS/mcl_signs/locale/template.txt | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index e878d16ea..4d0139990 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("mcl_signs") +local F = minetest.formspec_escape -- Font: 04.jp.org @@ -236,7 +237,7 @@ local show_formspec = function(player, pos) minetest.show_formspec( player:get_player_name(), "mcl_signs:set_text_"..pos.x.."_"..pos.y.."_"..pos.z, - "size[6,3]textarea[0.25,0.25;6,1.5;text;Edit sign text:;]label[0,1.5;Maximum line length: 15\nMaximum lines: 4]button_exit[0,2.5;6,1;submit;Done]" + "size[6,3]textarea[0.25,0.25;6,1.5;text;"..F(S("Edit sign text:"))..";]label[0,1.5;"..F(S("Maximum line length: 15")).."\n"..F(S("Maximum lines: 4")).."]button_exit[0,2.5;6,1;submit;"..F(S("Done")).."]" ) end diff --git a/mods/ITEMS/mcl_signs/locale/mcl_signs.de.tr b/mods/ITEMS/mcl_signs/locale/mcl_signs.de.tr index 27f06a9f8..dec4360cd 100644 --- a/mods/ITEMS/mcl_signs/locale/mcl_signs.de.tr +++ b/mods/ITEMS/mcl_signs/locale/mcl_signs.de.tr @@ -2,3 +2,7 @@ Sign=Schild Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them.=Schilder können beschrieben werden und kommen in zwei Varianten: Wandschild und stehendes Schild. Sie können auf und an den Seiten von anderen Blöclen platziert werden, aber nicht unter ihnen. After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again.=Nachdem das Schild platziert wurde, kann man etwas darauf schreiben. 4 Zeilen mit je 15 Zeichen pro Zeile sind verfügbar, alles darüber geht verloren. Es werden nicht alle Zeichen unterstützt. Der Text kann nicht geändert werden, sobald er geschrieben wurde; man muss das Schild erneut platzieren. +Edit sign text:=Schildtext bearbeiten: +Maximum line length: 15=Maximale Zeilenlänge: 15 +Maximum lines: 4=Maximale Zeilen: 4 +Done=Fertig diff --git a/mods/ITEMS/mcl_signs/locale/template.txt b/mods/ITEMS/mcl_signs/locale/template.txt index 2cf0ef998..e6d90b2db 100644 --- a/mods/ITEMS/mcl_signs/locale/template.txt +++ b/mods/ITEMS/mcl_signs/locale/template.txt @@ -2,3 +2,7 @@ Sign= Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them.= After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again.= +Edit sign text:= +Maximum line length: 15= +Maximum lines: 4= +Done=