diff --git a/bags.lua b/bags.lua index 2a21d5d..c8c9199 100644 --- a/bags.lua +++ b/bags.lua @@ -3,15 +3,23 @@ -- Copyright (c) 2012 cornernote, Brett O'Donnell -- License: GPLv3 +-- Boilerplate to support localized strings if intllib mod is installed. +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.."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]" - formspec = formspec.."button[6,2;2,0.5;bag4;Bag 4]" + formspec = formspec.."label[0,0;"..S("Bags").."]" + formspec = formspec.."button[0,2;2,0.5;bag1;"..S("Bag 1").."]" + formspec = formspec.."button[2,2;2,0.5;bag2;"..S("Bag 2").."]" + formspec = formspec.."button[4,2;2,0.5;bag3;"..S("Bag 3").."]" + formspec = formspec.."button[6,2;2,0.5;bag4;"..S("Bag 4").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[detached:"..player_name.."_bags;bag1;0.5,1;1,1;]" formspec = formspec.."list[detached:"..player_name.."_bags;bag2;2.5,1;1,1;]" @@ -102,19 +110,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}, })