summaryrefslogtreecommitdiff
path: root/bags.lua
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-06-21 12:44:31 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-06-21 12:44:31 +0200
commit002bcbb6d82efe299ba781726ddc44ce890dfc61 (patch)
tree77e23f451a8dac9dfb060f7982c1897277a4d89c /bags.lua
parent87f502a2592bbd41e99df9009a966111156f0181 (diff)
Add intllib support.
Some polish and german translations. Start adding tooltips.
Diffstat (limited to 'bags.lua')
-rw-r--r--bags.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/bags.lua b/bags.lua
index dce1b3b..10196f5 100644
--- a/bags.lua
+++ b/bags.lua
@@ -3,11 +3,18 @@
-- Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
-- License: GPLv3
+local S
+if intllib then
+ S = intllib.Getter()
+else
+ S = function(s) return s end
+end
+
unified_inventory.register_page("bags", {
get_formspec = function(player)
local player_name = player:get_player_name()
local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
- formspec = formspec.."label[0,0;Bags]"
+ formspec = formspec.."label[0,0;"..S("Bags").."]"
formspec = formspec.."button[0,2;2,0.5;bag1;Bag 1]"
formspec = formspec.."button[2,2;2,0.5;bag2;Bag 2]"
formspec = formspec.."button[4,2;2,0.5;bag3;Bag 3]"
@@ -24,6 +31,7 @@ unified_inventory.register_page("bags", {
unified_inventory.register_button("bags", {
type = "image",
image = "ui_bags_icon.png",
+ tooltip = S("Bags")
})
for i = 1, 4 do
@@ -103,19 +111,19 @@ end)
-- register bag tools
minetest.register_tool("unified_inventory:bag_small", {
- description = "Small Bag",
+ description = S("Small Bag"),
inventory_image = "bags_small.png",
groups = {bagslots=8},
})
minetest.register_tool("unified_inventory:bag_medium", {
- description = "Medium Bag",
+ description = S("Medium Bag"),
inventory_image = "bags_medium.png",
groups = {bagslots=16},
})
minetest.register_tool("unified_inventory:bag_large", {
- description = "Large Bag",
+ description = S("Large Bag"),
inventory_image = "bags_large.png",
groups = {bagslots=24},
})