From 38f3c986b2744645daef7ede75d057fc193d0c90 Mon Sep 17 00:00:00 2001 From: Xanthin Date: Fri, 21 Mar 2014 15:40:38 +0100 Subject: [PATCH] added support for intllib translation mod --- internal.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/internal.lua b/internal.lua index 3696cfc..3666199 100644 --- a/internal.lua +++ b/internal.lua @@ -1,3 +1,10 @@ +-- 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 function unified_inventory.get_formspec(player, page) if not player then @@ -73,9 +80,9 @@ function unified_inventory.get_formspec(player, page) end end end - formspec = formspec.."label[8.2,0;Page:]" - formspec = formspec.."label[9,0;"..page.." of "..pagemax.."]" - formspec = formspec.."label[8.2,0.4;Filter:]" + formspec = formspec.."label[8.2,0;"..S("Page:").."]" + formspec = formspec.."label[9,0;"..S("%s of %s"):format(page,pagemax).."]" + formspec = formspec.."label[8.2,0.4;"..S("Filter:").."]" formspec = formspec.."label[9,0.4;"..unified_inventory.activefilter[player_name].."]" return formspec end