summaryrefslogtreecommitdiff
path: root/lua/visual.lua
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-04-11 13:02:31 +0200
committerLNJ <git@lnj.li>2017-04-11 13:02:31 +0200
commitcde5c46e449e49e1435ac649bf344234ccd61f80 (patch)
tree57e4d51c44d4c4a052d948f0fb73217050a58285 /lua/visual.lua
parentcb616b0df9e0a07b9e569898c1d3cc265e6c13bf (diff)
Add i18n support using intllib
Diffstat (limited to 'lua/visual.lua')
-rwxr-xr-xlua/visual.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/visual.lua b/lua/visual.lua
index 178b15f..e0e99de 100755
--- a/lua/visual.lua
+++ b/lua/visual.lua
@@ -24,6 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
+-- Load support for intllib.
+local MP = core.get_modpath(core.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
core.register_entity("drawers:visual", {
initial_properties = {
hp_max = 1,
@@ -179,7 +183,7 @@ core.register_entity("drawers:visual", {
self.itemName = ""
meta:set_string("name"..self.visualId, self.itemName)
self.texture = "blank.png"
- itemDescription = "Empty"
+ itemDescription = S("Empty")
end
local infotext = drawers.gen_info_text(itemDescription,
@@ -243,7 +247,7 @@ core.register_entity("drawers:visual", {
if core.registered_items[self.itemName] then
itemDescription = core.registered_items[self.itemName].description
else
- itemDescription = "Empty"
+ itemDescription = S("Empty")
end
local infotext = drawers.gen_info_text(itemDescription,
self.count, self.stackMaxFactor, self.itemStackMax)