Add translator comments

This commit is contained in:
Wuzzy 2024-11-24 05:59:25 +01:00
parent b59c1e54d4
commit 34548637d5
18 changed files with 49 additions and 14 deletions

View File

@ -986,7 +986,7 @@ function achievements.get_formspec(name)
local aname = achievements.registered_achievements_list[row]
local def = achievements.registered_achievements[aname]
--[[~~~~~ TEXT LIST MODE ~~~~~]]
--[[----- TEXT LIST MODE -----]]
if userdata[name].mode == MODE_LIST then
-- Construct entries for text list
@ -1064,9 +1064,9 @@ function achievements.get_formspec(name)
form = form .. achievement_icon_frame(0, 0, aname, gotten)
form = form .. "container_end[]" -- icon container end
--[[~~~~~ END OF TEXT LIST MODE ~~~~~]]
--[[----- END OF TEXT LIST MODE -----]]
else
--[[~~~~~ SYMBOL LIST MODE ~~~~~]]
--[[----- SYMBOL LIST MODE -----]]
local SYMBOLS_PER_ROW = 4
@ -1125,7 +1125,7 @@ function achievements.get_formspec(name)
form = form .. "scroll_container_end[]"
end
--[[~~~~~ END OF SYMBOL LIST MODE ~~~~~]]
--[[----- END OF SYMBOL LIST MODE -----]]
-- Achievement progress summary

View File

@ -1,6 +1,6 @@
local S = minetest.get_translator("rp_armor")
--[[~~~~~ ARMOR REGISTRATIONS ~~~~~]]
--[[----- ARMOR REGISTRATIONS -----]]
armor.register_armor_set("rp_armor", "wood", {
craftitem = "group:planks",

View File

@ -312,6 +312,7 @@ creative.get_creative_formspec = function(player, start_i, pagenum)
page_label = ""
else
inventory_list = "list[detached:creative_"..player_name..";main;0,0;"..creative.slots_width..","..creative.slots_height..";"..tostring(start_i).."]"
--~ Creative inventory page counter. @1 is current page, @2 is maximum page
page_label = "label[8.95,0.75;"..FS("@1/@2", pagenum, pagemax).."]"
end
return
@ -382,6 +383,7 @@ creative.get_formspec = function(playername)
form = form .. "style[search_submit;border=false;noclip=true;bgimg=ui_button_search_submit_inactive.png]"
form = form .. "style[search_submit:pressed;border=false;noclip=true;bgimg=ui_button_search_submit_active.png]"
form = form .. "button["..(rp_formspec.default.size.x+2.134)..",1.6;0.77778,0.8;search_submit;]"
--~ Tooltip of button that submits an item search
form = form .. "tooltip[search_submit;"..minetest.formspec_escape(S("Submit")).."]"
form = form .. "field_close_on_enter[search_input;false]"
end

View File

@ -12,6 +12,7 @@ local msgs = {
NS("You took fatal damage from a block."),
},
["murder"] = {
--~ @1 is a player
NS("You were killed by @1."),
},
["murder_any"] = {
@ -34,22 +35,27 @@ local msgs = {
local mobkills = {
["rp_mobs_mobs:walker"] = {
NS("You were kicked to death by a walker."),
--~ @1 is a given name
NS("You were kicked to death by @1, a walker."),
},
["rp_mobs_mobs:boar"] = {
NS("You were killed by a boar."),
--~ @1 is a given name
NS("You were killed by @1, a boar."),
},
["rp_mobs_mobs:skunk"] = {
NS("You were killed by a skunk."),
--~ @1 is a given name
NS("You were killed by @1, a skunk."),
},
["rp_mobs_mobs:villager"] = {
NS("You were killed by a villager."),
--~ @1 is a given name
NS("You were killed by @1, a villager."),
},
["rp_mobs_mobs:mineturtle"] = {
NS("You were killed by a mine turtle."),
--~ @1 is a given name
NS("You were killed by @1, a mine turtle."),
},
}

View File

@ -29,7 +29,9 @@ end
local get_chest_infotext = function(meta)
local name = meta:get_string("name")
if name ~= "" then
return S("Chest") .. "\n" .. S('“@1”', name)
return S("Chest") .. "\n" ..
--~ Shown when hovering a named chest. @1 = name
S('“@1”', name)
else
return S("Chest")
end

View File

@ -54,6 +54,7 @@ minetest.register_node(
local meta = minetest.get_meta(pos)
meta:set_string("name", text)
if text ~= "" then
--~ @1 is a name given to a chest
meta:set_string("infotext", S("Chest “@1”", text))
else
meta:set_string("infotext", S("Chest"))
@ -102,6 +103,7 @@ minetest.register_node(
local meta = minetest.get_meta(pos)
meta:set_string("name", text)
if text ~= "" then
--~ @1 is a name given to a bookshelf
meta:set_string("infotext", S("Bookshelf “@1”", text))
else
meta:set_string("infotext", S("Bookshelf"))

View File

@ -363,6 +363,7 @@ minetest.register_abm(
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
--~ Furnace cook completion percentage, shown when hovering furnace
item_state = S("@1%", item_percent)
else
if srclist[1]:is_empty() then
@ -377,6 +378,7 @@ minetest.register_abm(
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
active = true
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
--~ Percentage showing remaining furnace fuel, shown when hovering furnace
fuel_state = S("@1%", fuel_percent)
formspec = default.furnace_active_formspec(fuel_percent, item_percent)
swap_node(pos, "rp_default:furnace_active")
@ -389,8 +391,10 @@ minetest.register_abm(
local infotext
if active then
--~ Shown when hovering furnace. @1 = cooked item, @2 = fuel percentage
infotext = S("Furnace active (Item: @1; Fuel: @2)", item_state, fuel_state)
else
--~ Shown when hovering furnace. @1 = cooked item, @2 = fuel percentage
infotext = S("Furnace inactive (Item: @1; Fuel: @2)", item_state, fuel_state)
end

View File

@ -7,7 +7,7 @@ achievements.register_achievement(
"farmer",
{
title = S("Farmer"),
-- "crop" as in "usable plant" / "plant for farming"
--~ Achievement description for Farmer achievement. "crop" as in "usable plant" / "plant for farming"
description = S("Plant a crop."),
times = 1,
placenode = "group:seed",

View File

@ -96,12 +96,13 @@ function gold.trade(trade, trade_type, player, trader, trade_index, all_trades)
-- Generate trading formspec caption
if trader._name then
-- Trader has a name: show name and profession
-- @1 = trader name, @2 = profession name
--~ Shown in trader menu. @1 = trader name, @2 = profession name
trader_name = S("@1 (@2)", trader._name, trade_name)
else
-- Trader has no name: show profession
trader_name = trade_name
end
--~ @1 is either a given name or a profession
local label = S("Trading with @1", trader_name)
local trade_wanted1 = inv:get_stack("gold_trade_wanted", 1)

View File

@ -4,6 +4,9 @@ local NEG_INFINITY = -1/0
loc = {}
--~ symbol representing infinity
local INF_SYMBOL = S("")
loc.num = function(numbr)
if type(numbr) == "string" then
numbr = tonumber(numbr)
@ -15,9 +18,10 @@ loc.num = function(numbr)
return tostring(numbr)
end
if numbr == INFINITY then
return S("")
return INF_SYMBOL
elseif numbr == NEG_INFINITY then
return S("@1", S(""))
--~ a negative whole number. @1 will be replaced by digits
return S("@1", INF_SYMBOL)
end
local negative
if numbr < 0 then
@ -30,11 +34,14 @@ loc.num = function(numbr)
if post ~= 0 then
post = string.sub(post, 3)
if negative then
--~ a negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the minus sign and decimal point with whatever is appropriate for your language.
str = S("@1.@2", pre, post)
else
--~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
str = S("@1.@2", pre, post)
end
elseif negative then
--~ a negative whole number. @1 will be replaced by digits
str = S("@1", numbr)
else
str = tostring(numbr)

View File

@ -10,6 +10,7 @@ local INFOTEXT_PUBLIC = NS("Locked Chest")
local INFOTEXT_OWNED = NS("Locked Chest (Owned by @1)")
local INFOTEXT_PUBLIC_CRACKED = NS("Locked Chest (cracked open)")
local INFOTEXT_OWNED_CRACKED = NS("Locked Chest (cracked open) (Owned by @1)")
--~ @1 is some block that can be owned (like a locked chest). @2 is an owner name.
local INFOTEXT_NAMED_OWNED = NS("@1 (Owned by @2)")
local GRAVITY = minetest.settings:get("movement_gravity") or 9.81
@ -26,6 +27,7 @@ local function update_infotext(meta)
local owner = meta:get_string("lock_owner")
local cracked = meta:get_int("lock_cracked") == 1
if text ~= "" then
--~ @1 is the name of a locked block
local namepart = S("“@1”", text)
if owner ~= "" then
if cracked then

View File

@ -80,7 +80,7 @@ rp_mobs.attempt_capture = function(self, clicker, capture_chances, force_take, r
-- Set mob name in description
if self._name and self._name ~= "" then
-- @1 = mob description, @2 = mob name (label)
--~ Tooltip of mob in item form. @1 = mob description, @2 = mob name (label)
mobitemmeta:set_string("description", S("@1: “@2”", mobitem:get_description(), minetest.colorize(MOB_NAME_COLOR_INV, self._name)))
end

View File

@ -361,7 +361,9 @@ local function talk_about_item(profession, iname, name, villager_name, has_works
say(S("Sleeping makes the night go past in the blink of an eye."), name, vn)
end
elseif iname == "rp_default:lump_bronze" then
-- Classic parody of Friedrich Schillers “Das Lied von der Glocke” (works best in German)
--~ Said by villager when showing them a bronze lump.
--~ Classic parody of Friedrich Schillers “Das Lied von der Glocke” in German:
--~ “Loch in Erde, Bronze rinn, Glocke fertig, bim, bim, bim!”
say(S("Hole in dirt, put bronze in. Bells complete, bim, bim, bim!"), name, vn)
elseif iname == "rp_default:apple" then
say(S("Apples are so tasty!"), name, vn)

View File

@ -80,7 +80,7 @@ local check_parachute_spawnable = function(pos, player)
local ray_end = vector.add(pos, off_end)
local ray = minetest.raycast(ray_start, ray_end, true, true)
local on_ground_only = true -- whether we stand on ground
local in_liquid = false -- whether we're in liquid (liquidtype~="none")
local in_liquid = false -- whether we're in liquid (liquidtype unqual to "none")
local collide = false -- whethe we collide
while true do
local thing = ray:next()

View File

@ -76,6 +76,7 @@ end
function player_effects.register_effect(ename, def)
local rd = {
title = def.title or ename, -- good-looking name of the effect
--~ Fallback description for a player effect, sloppy translations are OK. @1 is the technical effect identifier.
description = def.description or S("The @1 effect", ename), -- description of what the effect does
duration = def.duration or 1, -- how long the effect lasts, <0 is infinite and has to be disabled manually
physics = def.physics or {}, -- physics overrides for the player
@ -276,8 +277,10 @@ minetest.register_chatcommand(
for ename, endtime in pairs(player_effects.effects[name]) do
if endtime < 0 then
--~ @1 is a player effect name
s = s .. " " .. S("@1: unlimited", player_effects.registered_effects[ename].title) .. "\n"
else
--~ @1 is a player effect name, @2 is the number of seconds the effect is still active
s = s .. " " .. S("@1: @2 s remaining", player_effects.registered_effects[ename].title, (endtime - minetest.get_gametime())) .. "\n"
end

View File

@ -85,6 +85,7 @@ do
end
table.sort(fuels, sort_by_time)
for f=1, #fuels do
--~ List entry of fuel list for developer /list_fuels command. @1 = item name, @2 = fuel burn duration
minetest.chat_send_player(name, S("@1: @2", fuels[f][1], fuels[f][2]))
end
return true
@ -112,6 +113,7 @@ do
end
table.sort(recipes, sort_by_input)
for r=1, #recipes do
--~ List entry of cooking recipe list for the developer command /list_cookings. @1 = item to be cooked, @2 = item after cooking, @3 = cooking duration
minetest.chat_send_player(name, S("@1 → @2 (time=@3)", recipes[r][1], recipes[r][2]:to_string(), recipes[r][3]))
end
return true

View File

@ -7,7 +7,7 @@ minetest.register_chatcommand("villages", {
func = function(name, param)
local list = {}
for _, vill in pairs(village.villages) do
-- <Village name>: Coordinates>
--~ List entry for /villages command that lists all known villages. @1 = village name, @2 coordinates
table.insert(list, "" .. S("@1: @2", vill.name, minetest.pos_to_string(vill.pos)))
end
if #list == 0 then
@ -33,6 +33,7 @@ minetest.register_chatcommand("find_village", {
if not vill then
return true, S("No villages.")
end
--~ @1 = village name, @2 = coordinates
return true, S("Nearest village is @1 at @2.", vill.fname, minetest.pos_to_string(vill.pos))
end,
})

View File

@ -80,6 +80,7 @@ tt.register_snippet(function(itemstring)
if def._tt_food then
desc = S("Food item")
if def._tt_food_hp then
-- FIXME: doesn't support singular
local msg = S("+@1 food points", def._tt_food_hp)
desc = desc .. "\n" .. msg
end