More tooltips and translations.

This commit is contained in:
RealBadAngel
2014-06-22 00:34:35 +02:00
parent 810f342458
commit f800f39083
7 changed files with 178 additions and 88 deletions

View File

@ -29,7 +29,7 @@ trash:set_size("main", 1)
unified_inventory.register_button("craft", {
type = "image",
image = "ui_craft_icon.png",
tooltip = S("Crafting Menu")
tooltip = S("Crafting Grid")
})
unified_inventory.register_button("craftguide", {
@ -50,8 +50,7 @@ unified_inventory.register_button("home_gui_set", {
minetest.sound_play("dingdong",
{to_player=player_name, gain = 1.0})
minetest.chat_send_player(player_name,
"Home position set to: "
..minetest.pos_to_string(home))
S("Home position set to: %s"):format(minetest.pos_to_string(home)))
end
end,
})
@ -78,11 +77,10 @@ unified_inventory.register_button("misc_set_day", {
{to_player=player_name, gain = 1.0})
minetest.set_timeofday((6000 % 24000) / 24000)
minetest.chat_send_player(player_name,
"Time of day set to 6am")
S("Time of day set to 6am"))
else
minetest.chat_send_player(player_name,
"You don't have the"
.." settime priviledge!")
S("You don't have the settime priviledge!"))
end
end,
})
@ -98,11 +96,10 @@ unified_inventory.register_button("misc_set_night", {
{to_player=player_name, gain = 1.0})
minetest.set_timeofday((21000 % 24000) / 24000)
minetest.chat_send_player(player_name,
"Time of day set to 9pm")
S("Time of day set to 9pm"))
else
minetest.chat_send_player(player_name,
"You don't have the"
.." settime priviledge!")
S("You don't have the settime priviledge!"))
end
end,
})
@ -115,10 +112,10 @@ unified_inventory.register_button("clear_inv", {
local player_name = player:get_player_name()
if not unified_inventory.is_creative(player_name) then
minetest.chat_send_player(player_name,
"This button has been disabled outside"
S("This button has been disabled outside"
.." of creative mode to prevent"
.." accidental inventory trashing."
.." Use the trash slot instead.")
.."\nUse the trash slot instead."))
return
end
player:get_inventory():set_list("main", {})
@ -137,10 +134,10 @@ unified_inventory.register_page("craft", {
formspec = formspec.."listcolors[#00000000;#00000000]"
formspec = formspec.."list[current_player;craftpreview;6,1;1,1;]"
formspec = formspec.."list[current_player;craft;2,1;3,3;]"
formspec = formspec.."label[7,2.5;Trash:]"
formspec = formspec.."label[7,2.5;" .. S("Trash:") .. "]"
formspec = formspec.."list[detached:trash;main;7,3;1,1;]"
if unified_inventory.is_creative(player_name) then
formspec = formspec.."label[0,2.5;Refill:]"
formspec = formspec.."label[0,2.5;" .. S("Refill:") .. "]"
formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."refill;main;0,3;1,1;]"
end
return {formspec=formspec}
@ -204,7 +201,7 @@ unified_inventory.register_page("craftguide", {
local player_name = player:get_player_name()
local formspec = ""
formspec = formspec.."background[0,4.5;8,4;ui_main_inventory.png]"
formspec = formspec.."label[0,0;Crafting Guide]"
formspec = formspec.."label[0,0;" .. S("Crafting Guide") .. "]"
formspec = formspec.."listcolors[#00000000;#00000000]"
local item_name = unified_inventory.current_item[player_name]
if not item_name then return {formspec=formspec} end
@ -232,7 +229,7 @@ unified_inventory.register_page("craftguide", {
local craft_type = unified_inventory.registered_craft_types[craft.type] or
unified_inventory.craft_type_defaults(craft.type, {})
formspec = formspec.."label[6,3.35;Method:]"
formspec = formspec.."label[6,3.35;" .. S("Method:") .. "]"
formspec = formspec.."label[6,3.75;"
..minetest.formspec_escape(craft_type.description).."]"
formspec = formspec..stack_image_button(6, 1, 1.1, 1.1, "item_button_usage_", ItemStack(craft.output))
@ -263,17 +260,17 @@ unified_inventory.register_page("craftguide", {
end
if craft_type.uses_crafting_grid then
formspec = formspec.."label[6,1.95;Copy to craft grid:]"
formspec = formspec.."label[6,1.95;" .. S("Copy to craft grid:") .. "]"
.."button[6,2.5;0.6,0.5;craftguide_craft_1;1]"
.."button[6.6,2.5;0.6,0.5;craftguide_craft_10;10]"
.."button[7.2,2.5;0.6,0.5;craftguide_craft_max;All]"
.."button[7.2,2.5;0.6,0.5;craftguide_craft_max;" .. S("All") .. "]"
end
if alternates and alternates > 1 then
formspec = formspec.."label[0,2.6;"..recipe_text[dir].." "
..tostring(alternate).." of "
..tostring(alternates).."]"
.."button[0,3.15;2,1;alternate;Alternate]"
.."button[0,3.15;2,1;alternate;" .. S("Alternate") .. "]"
end
return {formspec = formspec}
end,