diff --git a/category.lua b/category.lua index 8807a48..d10a628 100644 --- a/category.lua +++ b/category.lua @@ -1,3 +1,4 @@ +local S = minetest.get_translator("unified_inventory") unified_inventory.registered_categories = {} unified_inventory.registered_category_items = {} @@ -7,13 +8,13 @@ function update_category_list() local category_list = {} table.insert(category_list, { name = "all", - label = "All Items", + label = S("All Items"), symbol = "ui_category_all.png", index = -2, }) table.insert(category_list, { name = "uncategorized", - label = "Misc. Items", + label = S("Misc. Items"), symbol = "ui_category_none.png", index = -1, }) diff --git a/default-categories.lua b/default-categories.lua index 2b71f60..57d3e88 100644 --- a/default-categories.lua +++ b/default-categories.lua @@ -1,27 +1,28 @@ +local S = minetest.get_translator("unified_inventory") unified_inventory.register_category('plants', { symbol = "flowers:tulip", - label = "Plant Life" + label = S("Plant Life") }) unified_inventory.register_category('building', { symbol = "default:brick", - label = "Building Materials" + label = S("Building Materials") }) unified_inventory.register_category('tools', { symbol = "default:pick_diamond", - label = "Tools" + label = S("Tools") }) unified_inventory.register_category('minerals', { symbol = "default:iron_lump", - label = "Minerals and Metals" + label = S("Minerals and Metals") }) unified_inventory.register_category('environment', { symbol = "default:dirt_with_grass", - label = "Environment and Worldgen" + label = S("Environment and Worldgen") }) unified_inventory.register_category('lighting', { symbol = "default:torch", - label = "Lighting" + label = S("Lighting") }) diff --git a/internal.lua b/internal.lua index b62d550..1c096a6 100644 --- a/internal.lua +++ b/internal.lua @@ -36,7 +36,7 @@ local function formspec_button(ui_peruser, name, image, offset, pos, scale, labe (offset.x or offset[1]) + ( ui_peruser.btn_spc * (pos.x or pos[1]) ) + spc, (offset.y or offset[2]) + ( ui_peruser.btn_spc * (pos.y or pos[2]) ) + spc, size, size, image, name) .. - string.format("tooltip[%s;%s]", name, F(S(label or name))) + string.format("tooltip[%s;%s]", name, F(label or name)) end function ui.get_formspec(player, page) @@ -157,12 +157,12 @@ function ui.get_formspec(player, page) end if category_count > ui_peruser.pagecols and scroll_offset > 0 then -- prev - formspec[n] = formspec_button(ui_peruser, "prev_category", "ui_left_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 2, 0}, 0.8, "Scroll categories left") + formspec[n] = formspec_button(ui_peruser, "prev_category", "ui_left_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 2, 0}, 0.8, S("Scroll categories left")) n = n + 1 end if category_count > ui_peruser.pagecols and category_count - scroll_offset > ui_peruser.pagecols then -- next - formspec[n] = formspec_button(ui_peruser, "next_category", "ui_right_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 1, 0}, 0.8, "Scroll categories right") + formspec[n] = formspec_button(ui_peruser, "next_category", "ui_right_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 1, 0}, 0.8, S("Scroll categories right")) n = n + 1 end