Makes translatable some straggler-strings

That is, progressive mode notifications, backpack
names, and a couple of chat messages.
This commit is contained in:
Jaidyn Ann 2024-08-01 10:11:31 -05:00
parent 1ba3ff8d5d
commit 0ddcab3172
4 changed files with 24 additions and 9 deletions

View File

@ -14,10 +14,16 @@ Items=
There is already a bag= There is already a bag=
This is not a bag= This is not a bag=
@1 (@2% full)= @1 (@2% full)=
Small Backpack=
Medium Backpack=
Large Backpack=
Teleported to: @1= Teleported to: @1=
Waypoints limit reached (@1)=
You already have set a waypoint at this position= You already have set a waypoint at this position=
Welcome back home!= Welcome back home!=
'home' privilege missing=
Your Minetest client needs updating (www.minetest.net)= Your Minetest client needs updating (www.minetest.net)=
No home set=
Any dye= Any dye=
Any coal= Any coal=
Any sand= Any sand=
@ -82,7 +88,6 @@ No=
Home= Home=
Style= Style=
Sorting= Sorting=
No home set=
Set home= Set home=
Hide tabs= Hide tabs=
HUD description= HUD description=
@ -133,3 +138,6 @@ Collect items to reveal more recipes=
Click to hide= Click to hide=
Click to expand= Click to expand=
Bookmarks= Bookmarks=
Unlocked=
New recipe unlocked!=
@1 new recipes unlocked!=

View File

@ -156,11 +156,15 @@ local bag_recipes = {
}, },
} }
-- For detection by update_translations script.
-- S('Small Backpack')
-- S('Medium Backpack')
-- S('Large Backpack')
for size, item in pairs(bag_recipes) do for size, item in pairs(bag_recipes) do
local bagname = fmt("i4:bag_%s", size) local bagname = fmt("i4:bag_%s", size)
core.register_craftitem(bagname, { core.register_craftitem(bagname, {
description = fmt("%s Backpack", size:gsub("^%l", string.upper)), description = S(fmt("%s Backpack", size:gsub("^%l", string.upper))),
inventory_image = fmt("i3_bag_%s.png", size), inventory_image = fmt("i3_bag_%s.png", size),
groups = {bag = item.size}, groups = {bag = item.size},
stack_max = 1, stack_max = 1,

View File

@ -138,7 +138,7 @@ local function inv_fields(player, data, fields)
if #data.waypoints >= max_waypoints then if #data.waypoints >= max_waypoints then
play_sound(name, "i3_cannot", 0.8) play_sound(name, "i3_cannot", 0.8)
return msg(name, fmt("Waypoints limit reached (%u)", max_waypoints)) return msg(name, S("Waypoints limit reached (@1)", max_waypoints))
end end
local pos = player:get_pos() local pos = player:get_pos()
@ -392,13 +392,13 @@ local function home_footer_fields(player, data, fields)
-- Use minetest_games sethome API, if available. -- Use minetest_games sethome API, if available.
if sethome then if sethome then
if not sethome.go(name) then if not sethome.go(name) then
msg(name, "No home set") msg(name, S("No home set"))
else else
msg(name, S("Welcome back home!")) msg(name, S("Welcome back home!"))
end end
-- Otherwise, use i4s home. -- Otherwise, use i4s home.
elseif not data.home then elseif not data.home then
msg(name, "No home set") msg(name, S("No home set"))
elseif name then elseif name then
safe_teleport(player, str_to_pos(data.home)) safe_teleport(player, str_to_pos(data.home))
msg(name, S("Welcome back home!")) msg(name, S("Welcome back home!"))
@ -424,7 +424,7 @@ end
local function settings_footer_fields(player, data, fields) local function settings_footer_fields(player, data, fields)
local name = player:get_player_name() local name = player:get_player_name()
if fields.set_home and not check_privs(name, {home = true}) then if fields.set_home and not check_privs(name, {home = true}) then
return msg(name, "'home' privilege missing") return msg(name, S("'home' privilege missing"))
elseif fields.set_home then elseif fields.set_home then
if sethome then if sethome then
sethome.set(name, player:get_pos()) sethome.set(name, player:get_pos())

View File

@ -2,14 +2,14 @@ local set_fs = i4.set_fs
local hud_notif = i4.hud_notif local hud_notif = i4.hud_notif
local POLL_FREQ = 0.25 local POLL_FREQ = 0.25
IMPORT("reg_items", "reg_nodes", "fmt", "table_merge", "array_diff") IMPORT("reg_items", "reg_nodes", "fmt", "S", "table_merge", "array_diff")
IMPORT("is_group", "extract_groups", "item_has_groups", "apply_recipe_filters", "sort_by_category") IMPORT("is_group", "extract_groups", "item_has_groups", "apply_recipe_filters", "sort_by_category")
i4.remove_minitab"nodes" i4.remove_minitab"nodes"
i4.remove_minitab"items" i4.remove_minitab"items"
i4.new_minitab("unlocked", { i4.new_minitab("unlocked", {
description = "Unlocked", description = S("Unlocked"),
sorter = function(item, data) sorter = function(item, data)
return data.items_progress[item] return data.items_progress[item]
@ -142,7 +142,10 @@ local function poll_new_items(player, data, join)
data.discovered = data.known_recipes - oldknown data.discovered = data.known_recipes - oldknown
if data.discovered > 0 then if data.discovered > 0 then
local msg = fmt("%u new recipe%s unlocked!", data.discovered, data.discovered > 1 and "s" or "") local msg = S("New recipe unlocked!")
if data.discovered > 1 then
msg = S("@1 new recipes unlocked!", data.discovered)
end
local last_discovered = diff[1] local last_discovered = diff[1]
local img = reg_items[last_discovered].inventory_image local img = reg_items[last_discovered].inventory_image