From ce1176f8251b929f0d3b1296b398b89d71f94ca5 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 2 Jun 2019 21:55:40 +0200 Subject: [PATCH] added parameters to locale texts --- buildings.lua | 2 +- chat_commands.lua | 4 +- locale/de.txt | 92 ++++++++++++++++++++++++++++++++++++++ locale/fr.txt | 24 +++++----- locale/template.txt | 28 ++++++------ map_of_world.lua | 2 +- mapgen.lua | 2 +- nodes.lua | 2 +- plotmarker_formspec.lua | 99 +++++++++++++++++++++-------------------- protection.lua | 16 +++---- 10 files changed, 183 insertions(+), 88 deletions(-) create mode 100644 locale/de.txt diff --git a/buildings.lua b/buildings.lua index eeec7cd..b513858 100644 --- a/buildings.lua +++ b/buildings.lua @@ -325,7 +325,7 @@ mg_villages.add_building = function( building_data ) or building_data.sizex == 0 or building_data.sizez==0) then -- no village will use it - mg_villages.print( mg_villages.DEBUG_LEVEL_INFO, S("No schematic found for building").." \'"..tostring( building_data.scm ).."\'. "..S("Will not use that building.")); + mg_villages.print( mg_villages.DEBUG_LEVEL_INFO, S("No schematic found for building \'@1\'. Will not use that building.", tostring( building_data.scm ))); building_data.weight = {}; building_data.not_available = 1; return false; diff --git a/chat_commands.lua b/chat_commands.lua index 4dca8a1..3c49ccb 100644 --- a/chat_commands.lua +++ b/chat_commands.lua @@ -226,7 +226,7 @@ minetest.register_chatcommand( 'visit', { -- we have found the village if( v and v.nr == nr ) then - minetest.chat_send_player( name, S("Initiating transfer to village no.")..' '..tostring( v.nr )..", "..S("called ")..( tostring( v.name or 'unknown')).."."); + minetest.chat_send_player( name, S("Initiating transfer to village no. @1, called @2.", tostring( v.nr ), tostring( v.name or 'unknown'))); local player = minetest.get_player_by_name( name ); player:move_to( { x=v.vx, y=(v.vh+1), z=v.vz }, false); return; @@ -276,6 +276,6 @@ minetest.register_chatcommand( 'village_mob_repopulate', { end end -- no village found - minetest.chat_send_player( name, S("There is no village with the number")..' '..tostring( param ).." ("..S("yet").."?)"); + minetest.chat_send_player( name, S("There is no village with the number @1 (Yet?)."), tostring( param )); end }); diff --git a/locale/de.txt b/locale/de.txt new file mode 100644 index 0000000..208cce1 --- /dev/null +++ b/locale/de.txt @@ -0,0 +1,92 @@ +SKIPPING = Überspringe +Error: Village type = Fehler: Dorftpy +lacks size information. = besitzt keine Größeninformationen. +due to village type not supported. = weil Dorftyp nicht unterstützt. +due to import failure. = weil der Import scheiterte. +No schematic found for building @1. Will not use that building. = Keine Vorlage für Gebäude @1 gefunden. Gebäude wird ausgelassen. +due to missing weight information. = aufgrund fehlender Gewichtung. +Allows to teleport to villages via = Erlaubt das Teleportieren mittels Befehl +Shows a list of all known villages. = Zeigt eine Liste aller bekannten Dörfer. +Teleports you to a known village. = Teleportiert dich zu einem bekannten Dorf. +You need the 'mg_villages' priv in order to teleport to villages using this command. = Du brauchst das 'mg_villages'-Privileg um mit diesem Befehl zu einem Dorf zu teleportieren. +Which village do you want to visit? Please provide the village number! = Welches Dorf möchtest du besuchen? Bitte gib die Nummer des Dorfes an! +Initiating transfer to village no. @1, called @2. = Initialisiere Transport zu Dorf Nr. @1, genannt @2. +There is no village with the number @1 (Yet?). = +called = genannt +Will create villages of the following types = Werde Dörfer folgenden Typs generieren: +CHANGING HEIGHT from @1 to @2. = ÄNDERE DIE HÖHE von @1 auf @2. +TIME ELAPSED = ZEIT VERGANGEN +Villages shown on this map = Dörfer, die auf dieser Karte gezeigt werden: +Shows a map of all known villages withhin @1 blocks. = Zeigt eine Karte mit allen bekannten Dörfern im Umkreis von @1 Blöcken. +Abandoned building = Gebäude aufgeben +House = Haus +Village Road = Dorfstraße +Soil found on a field = Ackerland +Desert Sand = Wüstensand +Torch = Fackel +Plot marker = Grundstücks-Markierer +Lava Source (tame) = Lavaquelle (zahm) +Flowing Lava (tame) = Fließende Lava (zahm) +Error: This area does not belong to a village. = Fehler: Dieses Gebiet gehört nicht zu einem Dorf. +You are inside of the area of the village @1. The inhabitants do not allow you any modifications. = Du befindest dich innerhalb der Grenzen des Dorfes @1. Die Bewohner erlauben dir nicht, Änderungen an ihrem Dorf vorzunehmen. +Error. This plot marker is not configured correctly. = Fehler. Dieser Grundstücks-Markierer ist nicht richtig konfiguriert. +the village community = Die Dorfgemeinschaft +for sale = zu verkaufen +Plot No.: @1, with @2 = Grundstück Nr.: @1, mit @2 +Plot No. @1 with @2 (owned by @3) = Grundstück Nr. @1 mit @2 +Plot No. @1 with @2 (owned by @3) = Grundstück Nr. @1 mit @2 (Eigentümer: @3) +Plot No. = Grundstück Nr. +Located at = Zu finden: +Part of village = Teil des Dorfes +, which is = , welches sich +m away = m +from the village center = vom Dorfzentrum entfernt befindet +name unknown = Unbekannter Name +Owned by = Besitzer +owned by = im Besitz von +Click on a menu entry to select it = Klicke auf einen Menüeintrag um ihn auszuwählen +Some traders live here. One works as a = Einige Händler arbeiten hier. Einer arbeitet als +Another trader works as a = Ein anderer Händler arbeitet als +A trader lives here. He works as a = Ein Händler arbeitet hier. Er arbeitet als +No trader currently works at this place. = Hier wohnt aktuell kein Händler. +You are visiting the = Du besuchst den Händler +trader, who is supposed to be somewhere here. He might also be on a floor above you. = , der hier irgendwo herumlaufen sollte. Er könnte sich auch eine Etage über dir befinden. +Back = Zurück +You need the 'protection_bypass' priv in order to use this function. = Du brauchst das 'protection_bypass'-Privileg um diese Funktion nutzen zu können. +The plot has been cleared. = Das Grundstück wurde bereinigt. +The building has been reset. = Das Gebäude wurde zurückgesetzt. +Change materials used = Ändere Materialien +Show materials used = Zeige Materialien +Create backup of current stage = Erzeuge Backup des akt. Zustandes +Reset building = Gebäude zurücksetzen +Remove building = Gebäude entfernen +Unsupported village type = Unbekannter Dorftyp +for house at = für das Haus bei +adding SINGLE HOUSE of type = platziere EINZELNES HAUS des Typs +to map at = auf der Map bei +Sorry. You already have a plot in this village. = Fehler: Du besitzt bereits ein Grundstück in diesem Dorf. +Congratulations! You have bought this plot. = Glückwunsch! Du hast dieses Grundstück gekauft. +with = mit +Owners of this plot count as village inhabitants. = Besitzer dieses Grundstücks zählen als Dorfbewohner. +Sorry. You are not able to pay the price. = Du hast leider nicht genug Geld. +You are allowed to modify the common village area. = Du darfst die gemeinsam genutzte Dorffläche bearbeiten. +This is your plot. You have bought it. = Dies ist dein Grundstück. Du hast es erworben. +Add/Remove Players = Spieler verwalten +Abandon plot = Grundstück aufgeben +You have abandoned this plot. = Du hast dieses Grundstück aufgegeben. +Trusted Players = Vertrauenswürdige Spieler +Save = Speichern +owns this plot = ist Eigentümer dieses Grundstücks +You can buy this plot for = Du kannst dies Grundstück kaufen. Preis: +Building = Gebäude +Buy plot = Grundstück kaufen +Info = Info +Exit = Ende +Hire a new random trader = Zufälligen Händler einstellen +visit = besuchen +call = rufen +fire = entlassen +Error. Unkown building. = Fehler. Unbekanntes Gebäude. +(mirrored) = (gespiegelt) +Who lives here = Wer wohnt hier +Error = Fehler diff --git a/locale/fr.txt b/locale/fr.txt index ec95937..306fad3 100644 --- a/locale/fr.txt +++ b/locale/fr.txt @@ -3,25 +3,21 @@ Error: Village type = Erreur : le type de village lacks size information. = l'information 'size' est manquante. due to village type not supported. = car le type de village n'est pas supporté. due to import failure. = car l'importation a echoué -No schematic found for building = Pas de schéma pour ce batiment -Will not use that building. = Ce batiment ne sera pas utilisé. +No schematic found for building @1. Will not use that building. = Pas de schéma pour ce batiment @1. Ce batiment ne sera pas utilisé. due to missing weight information. = car l'information 'weight' est manquante. Allows to teleport to villages via = Permet de se téléporter dans les villages via la commande Shows a list of all known villages. = Affiche une liste des villages connus. Teleports you to a known village. = Vous téléporte dans un village connu. You need the 'mg_villages' priv in order to teleport to villages using this command. = Vous devez avoir le privilège 'mg_village' pour utiliser cette commande. Which village do you want to visit? Please provide the village number! = Quel village souhaitez-vous visiter ? Renseignez le numero du village s'il vous plait ! -Initiating transfer to village no. = Debut du tranfert vers le village no. -called = applellé -There is no village with the number = Il n'y a pas de village portant le numéro -yet = pas encore +Initiating transfer to village no. @1, called @2. = Debut du tranfert vers le village no. @1, applellé @2. +There is no village with the number @1 (Yet?). = Il n'y a pas de village portant le numéro @1 (pas encore?). Will create villages of the following types = Les types de villages suivants seront crées -CHANGING HEIGHT from = CHANGE LA HAUTEUR depuis +CHANGING HEIGHT from @1 to @2. = CHANGE LA HAUTEUR depuis @1 de @2. to = vers TIME ELAPSED = TEMPS ECOULE Villages shown on this map = Villages montrés sur cette carte -Shows a map of all known villages withhin = Affiche une carte des villages connus dans un rayon de -blocks. = blocs. +Shows a map of all known villages withhin @1 blocks. = Affiche une carte des villages connus dans un rayon de @1 blocs. Abandoned building = Batiment abandonné House = Maison village road = route de village @@ -32,12 +28,14 @@ Plot marker = Balise de parcelle Lava Source (tame) = Source de lave (inoffensive) Flowing Lava (tame) = Lave coulante (inoffensive) Error: This area does not belong to a village. = Erreur: Cettre zone n'appartient pas a un village. -You are inside of the area of the village = Cette zone appartient fait partie du village de -. The inhabitants do not allow you any modifications. = . Les habitants n'autorisent pas les modifications. +You are inside of the area of the village @1. The inhabitants do not allow you any modifications. = Cette zone appartient fait partie du village de @1. Les habitants n'autorisent pas les modifications. Error. This plot marker is not configured correctly. = Erreur. Cette balise de parcelle n'est pas correctement configurée. the village community = la municipalité for sale = a vendre Plot No. = Emplacement No. +Plot No.: @1, with @2 = Emplacement No.: @1, avec @2 +Plot No. @1 with @2 = Emplacement No. @1 avec @2 +Plot No. @1 with @2 (owned by @3) = Emplacement No. @1, avec @2 (appartient a @3) Located at = Situé a Part of village = Dans le village , which is = , soit a @@ -89,3 +87,7 @@ Hire a new random trader = Engager un nouveau vendeur aléatoire visit = Rendre visite call = Appeller fire = Congédier +Error. Unkown building. = +(mirrored) = +Who lives here = Qui habite ici +Error = Erreur diff --git a/locale/template.txt b/locale/template.txt index 2f4285b..55bf963 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -3,28 +3,24 @@ Error: Village type = lacks size information. = due to village type not supported. = due to import failure. = -No schematic found for building = -Will not use that building. = +No schematic found for building @1. Will not use that building. = due to missing weight information. = Allows to teleport to villages via = Shows a list of all known villages. = Teleports you to a known village. = You need the 'mg_villages' priv in order to teleport to villages using this command. = Which village do you want to visit? Please provide the village number! = -Initiating transfer to village no. = +Initiating transfer to village no. @1, called @2. = called = -There is no village with the number = -yet = +There is no village with the number @1 (Yet?). = Will create villages of the following types = -CHANGING HEIGHT from = -to = +CHANGING HEIGHT from @1 to @2. = TIME ELAPSED = Villages shown on this map = -Shows a map of all known villages withhin = -blocks. = +Shows a map of all known villages withhin @1 blocks. = Abandoned building = House = -village road = +Village Road = Soil found on a field = Desert Sand = Torch = @@ -32,12 +28,14 @@ Plot marker = Lava Source (tame) = Flowing Lava (tame) = Error: This area does not belong to a village. = -You are inside of the area of the village = -. The inhabitants do not allow you any modifications. = +You are inside of the area of the village @1. The inhabitants do not allow you any modifications. = Error. This plot marker is not configured correctly. = the village community = for sale = -Plot No. = +Plot No.: @1, with @2 = +Plot No. @1 with @2 = +Plot No. @1 with @2 (owned by @3) = +Plot No. = Located at = Part of village = , which is = @@ -89,3 +87,7 @@ Hire a new random trader = visit = call = fire = +Error. Unkown building. = +(mirrored) = (gespiegelt) +Who lives here = +Error = diff --git a/map_of_world.lua b/map_of_world.lua index f46e986..1232ce2 100644 --- a/map_of_world.lua +++ b/map_of_world.lua @@ -185,7 +185,7 @@ end minetest.register_chatcommand( 'vmap', { - description = S("Shows a map of all known villages withhin")..' '..tostring( mg_villages.MAP_RANGE )..' '..S("blocks."), + description = S("Shows a map of all known villages withhin @1 blocks.", tostring( mg_villages.MAP_RANGE )), privs = {}, func = function(name, param) minetest.show_formspec( name, 'mg:world_map', mg_villages.map_of_world( name )); diff --git a/mapgen.lua b/mapgen.lua index 9d7b985..bc24170 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -774,7 +774,7 @@ end mg_villages.change_village_height = function( village, new_height ) - mg_villages.print( mg_villages.DEBUG_LEVEL_TIMING, S("CHANGING HEIGHT from").." "..tostring( village.vh ).." "..S("to").." "..tostring( new_height )); + mg_villages.print( mg_villages.DEBUG_LEVEL_TIMING, S("CHANGING HEIGHT from @1 to @2.", tostring( village.vh ), tostring( new_height ))); for _, pos in ipairs(village.to_add_data.bpos) do pos.y = new_height; end diff --git a/nodes.lua b/nodes.lua index 55a174a..83ea132 100644 --- a/nodes.lua +++ b/nodes.lua @@ -3,7 +3,7 @@ local S = mg_villages.intllib -- slightly lower than a normal nodes for better look minetest.register_node("mg_villages:road", { - description = S("village road"), + description = S("Village Road"), tiles = {"default_gravel.png", "default_dirt.png"}, is_ground_content = false, -- will not be removed by the cave generator groups = {crumbly=2}, -- does not fall diff --git a/plotmarker_formspec.lua b/plotmarker_formspec.lua index 7cf5deb..ee5fb42 100644 --- a/plotmarker_formspec.lua +++ b/plotmarker_formspec.lua @@ -1,3 +1,4 @@ +local S = mg_villages.intllib -- used for buying plots, restoring buildings, getting information about mobs etc. mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) @@ -23,7 +24,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) or not( mg_villages.all_villages[ village_id ].to_add_data ) or not( mg_villages.all_villages[ village_id ].to_add_data.bpos ) or not( mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ] )) then - minetest.chat_send_player( pname, 'Error. This plot marker is not configured correctly.'..minetest.serialize({village_id,plot_nr })); + minetest.chat_send_player( pname, S('Error. This plot marker is not configured correctly.')..minetest.serialize({village_id,plot_nr })); return; end @@ -33,9 +34,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local owner_name = plot.owner; if( not( owner_name ) or owner_name == "" ) then if( plot.btype=="road" ) then - owner_name = "- the village community -"; + owner_name = "- "..S("the village community").." -"; else - owner_name = "- for sale -"; + owner_name = "- "..S("for sale").." -"; end end @@ -43,7 +44,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) if( not( plot.btype ) or not( mg_villages.BUILDINGS[ plot.btype ] ) or not( mg_villages.BUILDINGS[ plot.btype ].mts_path ) or not( mg_villages.BUILDINGS[ plot.btype ].scm )) then - minetest.chat_send_player( pname, 'Error. Unknown building. btype: '..tostring( plot.btype )); + minetest.chat_send_player( pname, S('Error. Unknown building.')..' btype: '..tostring( plot.btype )); return; end local building_name = mg_villages.BUILDINGS[ plot.btype ].mts_path..mg_villages.BUILDINGS[ plot.btype ].scm; @@ -65,17 +66,17 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local mirror_str = ""; if( plot.mirror ) then - mirror_str = minetest.formspec_escape(" (mirrored)"); + mirror_str = minetest.formspec_escape(" "..S("(mirrored)")); end -- create the header local formspec = "size[13,10]".. - "label[3.3,0.0;Plot No.: "..tostring( plot_nr )..", with "..tostring( mg_villages.BUILDINGS[ plot.btype ].scm ).."]".. - "label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).." m away]" - .."label[7.3,0.4;from the village center]".. - "label[0.3,0.8;Part of village:]" .."label[3.3,0.8;"..(village.name or "- name unknown -").."]" - .."label[7.3,0.8;located at "..(village_pos).."]".. + "label[3.3,0.0;"..S("Plot No.: @1, with @2", tostring( plot_nr ), tostring( mg_villages.BUILDINGS[ plot.btype ].scm )).."]".. + "label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..S(", which is ")..tostring( distance )..S(" m away").."]" + .."label[7.3,0.4;"..S("from the village center").."]".. + "label[0.3,0.8;Part of village:]" .."label[3.3,0.8;"..(village.name or "- "..S("name unknown").." -").."]" + .."label[7.3,0.8;"..S("located at").." "..(village_pos).."]".. "label[0.3,1.2;Owned by:]" .."label[3.3,1.2;"..(owner_name).."]".. - "label[3.3,1.6;Click on a menu entry to select it:]".. + "label[3.3,1.6;"..S("Click on a menu entry to select it")..":]".. "field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]"; build_chest.show_size_data( building_name ); @@ -131,7 +132,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) or (fields.replace_row_with and fields.replace_row_with ~= "") or (fields.replace_row_material and fields.replace_row_material ~= "")) then - formspec = formspec.."button[9.9,0.4;2,0.5;info;Back]"; + formspec = formspec.."button[9.9,0.4;2,0.5;info;"..S("Back").."]"; if( not( minetest.check_player_privs( pname, {protection_bypass=true}))) then -- do not allow any changes; just show the materials and their replacements minetest.show_formspec( pname, "mg_villages:formspec_plotmarker", @@ -146,11 +147,11 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) elseif( (fields.reset_building and fields.reset_building ~= "") or (fields.remove_building and fields.remove_building ~= "")) then - formspec = formspec.."button[9.9,0.4;2,0.5;back;Back]"; + formspec = formspec.."button[9.9,0.4;2,0.5;back;"..S("Back").."]"; if( not( minetest.check_player_privs( pname, {protection_bypass=true}))) then minetest.show_formspec( pname, "mg_villages:formspec_plotmarker", formspec.. - "label[3,3;You need the protection_bypass priv in order to use this functin.]" ); + "label[3,3;"..S("You need the 'protection_bypass' priv in order to use this function.").."]" ); return; end @@ -171,7 +172,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) handle_schematics.clear_area( start_pos, end_pos, pos.y-1); -- also clear the meta data to avoid strange effects handle_schematics.clear_meta( start_pos, end_pos ); - formspec = formspec.."label[3,3;The plot has been cleared.]"; + formspec = formspec.."label[3,3;"..S("The plot has been cleared.").."]"; else -- actually place it (disregarding mirroring) local error_msg = handle_schematics.place_building_from_file( @@ -181,27 +182,27 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) replacements, plot.o, build_chest.building[ building_name ].axis, plot.mirror, 1, true ); - formspec = formspec.."label[3,3;The building has been reset.]"; + formspec = formspec.."label[3,3;"..S("The building has been reset.").."]"; if( error_msg ) then - formspec = formspec..'label[4,3;Error: '..tostring( fields.error_msg ).."]"; + formspec = formspec..'label[4,3;'..S('Error:')..' '..tostring( fields.error_msg ).."]"; end end minetest.show_formspec( pname, "mg_villages:formspec_plotmarker", formspec ); return; elseif( fields.info and fields.info ~= "" ) then - local show_material_text = "Change materials used"; + local show_material_text = S("Change materials used"); if( not( minetest.check_player_privs( pname, {protection_bypass=true}))) then - show_material_text = "Show materials used"; + show_material_text = S("Show materials used"); end minetest.show_formspec( pname, "mg_villages:formspec_plotmarker", formspec.. - "button[9.9,0.4;2,0.5;back;Back]".. - "button[3,3;5,0.5;create_backup;Create backup of current stage]".. + "button[9.9,0.4;2,0.5;back;"..S("Back").."]".. + "button[3,3;5,0.5;create_backup;"..S("Create backup of current stage").."]".. "button[4,4;3,0.5;show_materials;"..show_material_text.."]".. - "button[4,5;3,0.5;reset_building;Reset building]".. - "button[4,6;3,0.5;remove_building;Remove building]"); + "button[4,5;3,0.5;reset_building;"..S("Reset building").."]".. + "button[4,6;3,0.5;remove_building;"..S("Remove building").."]"); return; end @@ -211,9 +212,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local original_formspec = "size[8,3]".. "button[7.0,0.0;1.0,0.5;info;Info]".. - "button[6.0,1.0;2.0,0.5;inhabitants;Who lives here]".. - "label[1.0,0.5;Plot No.: "..tostring( plot_nr ).."]".. - "label[2.5,0.5;Building:]".. + "button[6.0,1.0;2.0,0.5;inhabitants;"..S("Who lives here").."]".. + "label[1.0,0.5;"..S("Plot No.")..": "..tostring( plot_nr ).."]".. + "label[2.5,0.5;"..S("Building:").."]".. "label[3.5,0.5;"..tostring( mg_villages.BUILDINGS[btype].scm )..mirror_str.."]".. "field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]"; local formspec = ""; @@ -223,7 +224,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local price = "default:gold_ingot 2"; if (btype ~= 'road' and mg_villages.BUILDINGS[btype]) then - local plot_descr = 'Plot No. '..tostring( plot_nr ).. ' with '..tostring( mg_villages.BUILDINGS[btype].scm) + local plot_descr = S('Plot No.')..' '..tostring( plot_nr ).. ' '..S('with')..' '..tostring( mg_villages.BUILDINGS[btype].scm) if (mg_villages.BUILDINGS[btype].price) then price = mg_villages.BUILDINGS[btype].price; @@ -232,7 +233,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) end -- Get if is inhabitant house if (mg_villages.BUILDINGS[btype].inh and mg_villages.BUILDINGS[btype].inh > 0 ) then - ifinhabit = "label[1,1.5;Owners of this plot count as village inhabitants.]"; + ifinhabit = "label[1,1.5;"..S("Owners of this plot count as village inhabitants.").."]"; end end -- Determine price depending on building type @@ -243,12 +244,12 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) if (not(owner) or owner=='') then formspec = original_formspec .. - "label[1,1;You can buy this plot for]".. + "label[1,1;"..S("You can buy this plot for").."]".. "label[3.8,1;"..tostring( price_stack:get_count() ).." x ]".. "item_image[4.3,0.8;1,1;"..( price_stack:get_name() ).."]".. ifinhabit.. - "button[2,2.5;1.5,0.5;buy;Buy plot]".. - "button_exit[4,2.5;1.5,0.5;abort;Exit]"; + "button[2,2.5;1.5,0.5;buy;"..S("Buy plot").."]".. + "button_exit[4,2.5;1.5,0.5;abort;"..S("Exit").."]"; -- On Press buy button if (fields['buy']) then @@ -260,26 +261,26 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) -- Check if player already has a house in the village if mg_villages.all_villages[village_id].ownerlist[pname] then - formspec = formspec.."label[1,1.9;Sorry. You already have a plot in this village.]"; + formspec = formspec.."label[1,1.9;"..S("Sorry. You already have a plot in this village.").."]"; -- Check if the price can be paid elseif( inv and inv:contains_item( 'main', price_stack )) then formspec = original_formspec.. - "label[1,1;Congratulations! You have bought this plot.]".. - "button_exit[5.75,2.5;1.5,0.5;abort;Exit]"; + "label[1,1;"..S("Congratulations! You have bought this plot.").."]".. + "button_exit[5.75,2.5;1.5,0.5;abort;"..S("Exit").."]"; mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner = pname; if mg_villages.all_villages[village_id].ownerlist then mg_villages.all_villages[village_id].ownerlist[pname] = true; else mg_villages.all_villages[village_id].ownerlist[pname] = true; end - meta:set_string('infotext', 'Plot No. '..tostring( plot_nr ).. ' with '..tostring( mg_villages.BUILDINGS[btype].scm)..' (owned by '..tostring( pname )..')'); + meta:set_string('infotext', S('Plot No. @1 with @2 (owned by @3)', tostring( plot_nr ), tostring( mg_villages.BUILDINGS[btype].scm), tostring( pname ))); -- save the data so that it survives server restart mg_villages.save_data(); -- substract the price from the players inventory inv:remove_item( 'main', price_stack ); else - formspec = formspec.."label[1,1.9;Sorry. You are not able to pay the price.]"; + formspec = formspec.."label[1,1.9;"..S("Sorry. You are not able to pay the price.").."]"; end end @@ -292,28 +293,28 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) and mg_villages.BUILDINGS[btype].inh and mg_villages.BUILDINGS[btype].inh > 0 ) then - ifinhabit = "label[1,1.5;You are allowed to modify the common village area.]"; + ifinhabit = "label[1,1.5;"..S("You are allowed to modify the common village area.").."]"; end formspec = original_formspec.."size[8,3]".. - "label[1,1;This is your plot. You have bought it.]".. - "button[0.75,2.5;3,0.5;add_remove;Add/Remove Players]".. + "label[1,1;"..S("This is your plot. You have bought it.").."]".. + "button[0.75,2.5;3,0.5;add_remove;"..S("Add/Remove Players").."]".. ifinhabit.. - "button_exit[3.75,2.5;2.0,0.5;abandon;Abandon plot]".. - "button_exit[5.75,2.5;1.5,0.5;abort;Exit]"; + "button_exit[3.75,2.5;2.0,0.5;abandon;"..S("Abandon plot").."]".. + "button_exit[5.75,2.5;1.5,0.5;abort;"..S("Exit").."]"; -- If Player wants to abandon plot if(fields['abandon'] ) then formspec = original_formspec.. - "label[1,1;You have abandoned this plot.]".. - "button_exit[5.75,2.5;1.5,0.5;abort;Exit]"; + "label[1,1;"..S("You have abandoned this plot.").."]".. + "button_exit[5.75,2.5;1.5,0.5;abort;"..S("Exit").."]"; mg_villages.all_villages[village_id].ownerlist[pname] = nil; mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].can_edit = {} mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner = nil; -- Return price to player local inv = player:get_inventory(); inv:add_item( 'main', price_stack ); - meta:set_string('infotext', 'Plot No. '..tostring( plot_nr ).. ' with '..tostring( mg_villages.BUILDINGS[btype].scm) ); + meta:set_string('infotext', S('Plot No. @1 with @2', tostring( plot_nr ), tostring( mg_villages.BUILDINGS[btype].scm))); mg_villages.save_data(); end @@ -330,8 +331,8 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) end formspec = "size[8,3]".. "field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]".. - "textarea[0.3,0.2;8,2.5;ownerplayers;Trusted Players;"..output.."]".. - "button[3.25,2.5;1.5,0.5;savetrustees;Save]"; + "textarea[0.3,0.2;8,2.5;ownerplayers;"..S("Trusted Players")..";"..output.."]".. + "button[3.25,2.5;1.5,0.5;savetrustees;"..S("Save").."]"; mg_villages.save_data() end @@ -354,8 +355,8 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) -- If A different Player owns plot else - formspec = original_formspec.."label[1,1;"..tostring( owner ).." owns this plot.]".. - "button_exit[3,2.5;1.5,0.5;abort;Exit]"; + formspec = original_formspec.."label[1,1;"..tostring( owner ).." "..S("owns this plot")..".]".. + "button_exit[3,2.5;1.5,0.5;abort;"..S("Exit").."]"; end minetest.show_formspec( pname, "mg_villages:formspec_plotmarker", formspec ); @@ -379,7 +380,7 @@ mg_villages.form_input_handler = function( player, formname, fields) -- teleport the player to the target position player:move_to( { x=pos.x, y=(pos.y+1), z=pos.z }, false); else - minetest.chat_sned_player( pname, "Sorry. You do not have the teleport privilege."); + minetest.chat_sned_player( pname, S("Sorry. You do not have the teleport privilege.")); end -- do not abort; continue with showing the formspec end diff --git a/protection.lua b/protection.lua index 998f83b..39a5529 100644 --- a/protection.lua +++ b/protection.lua @@ -160,9 +160,7 @@ minetest.register_on_protection_violation( function(pos, name) return; end - minetest.chat_send_player( name, S("You are inside of the area of the village").." ".. - tostring( mg_villages.all_villages[ found ].name ).. - S(". The inhabitants do not allow you any modifications.")); + minetest.chat_send_player( name, S("You are inside of the area of the village @1. The inhabitants do not allow you any modifications.", tostring( mg_villages.all_villages[ found ].name ))) end ); @@ -186,7 +184,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) or not( mg_villages.all_villages[ village_id ].to_add_data ) or not( mg_villages.all_villages[ village_id ].to_add_data.bpos ) or not( mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ] )) then - minetest.chat_send_player( pname, S("Error. This plot marker is not configured correctly.")..minetest.serialize({village_id,plot_nr })); + minetest.chat_send_player( pname, S("Error. This plot marker is not configured correctly.").." "..minetest.serialize({village_id,plot_nr })); return; end @@ -214,7 +212,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) -- create the header local formspec = "size[9,8,true]".. default.gui_bg..default.gui_bg_img.. - "label[0.3,0.0;"..S("Plot No.").." : "..tostring( plot_nr )..", "..S("with")..' '..tostring( mg_villages.BUILDINGS[ plot.btype ].scm ).."]".. + "label[0.3,0.0;"..S("Plot No. : @1, with @2", tostring( plot_nr ), tostring( mg_villages.BUILDINGS[ plot.btype ].scm )).."]".. "label[0.3,0.4;"..S("Located at").." : ]" .. "label[2.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..S(", which is").."]".. "label[2.3,0.8;"..tostring( distance )..' '..S("m away")..' '..S("from the village center").."]".. @@ -228,9 +226,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) if( plot and plot.traders ) then if( #plot.traders > 1 ) then - formspec = formspec.."label[0.3,4.8;"..S("Some traders live here. One works as a")..' '..tostring(plot.traders[1].typ)..".]"; + formspec = formspec.."label[0.3,4.8;"..S("Some traders live here. One works as a")..' '..S(tostring(plot.traders[1].typ))..".]"; for i=2,#plot.traders do - formspec = formspec.."label[0.3,"..(4.5+i).."; "..S("Another trader works as a")..' '..tostring(plot.traders[i].typ)..".]"; + formspec = formspec.."label[0.3,"..(4.5+i).."; "..S("Another trader works as a")..' '..S(tostring(plot.traders[i].typ))..".]"; end elseif( plot.traders[1] and plot.traders[1].typ) then formspec = formspec.. @@ -251,7 +249,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) if( fields[ "visit_trader_"..i ] ) then player:moveto( {x=trader.x, y=(village.vh+1), z=trader.z} ); - minetest.chat_send_player( pname, S("You are visiting the")..' '..tostring( trader.typ )..' '.. + minetest.chat_send_player( pname, S("You are visiting the")..' '..S(tostring( trader.typ ))..' '.. S("trader, who is supposed to be somewhere here. He might also be on a floor above you.")); return; end @@ -415,7 +413,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local price = "default:gold_ingot 2"; if (btype ~= 'road' and mg_villages.BUILDINGS[btype]) then - local plot_descr = S("Plot No.")..' '..tostring( plot_nr )..' '..S("with")..' '..tostring( mg_villages.BUILDINGS[btype].scm) + local plot_descr = S("Plot No. : @1, with @2", tostring( plot_nr ), tostring( mg_villages.BUILDINGS[btype].scm)) if (mg_villages.BUILDINGS[btype].price) then price = mg_villages.BUILDINGS[btype].price;