mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-03-14 22:21:21 +00:00
24 lines
722 B
Lua
24 lines
722 B
Lua
|
local ngettext
|
||
|
|
||
|
--[[
|
||
|
local S = core.get_translator('testmod')
|
||
|
core.register_craftitem('testmod:test', {
|
||
|
description = S('I am a test object'),
|
||
|
inventory_image = 'default_stick.png^[brighten'
|
||
|
})
|
||
|
--]]
|
||
|
|
||
|
if core.get_modpath("intllib") then
|
||
|
if intllib.make_gettext_pair then
|
||
|
-- New method using gettext.
|
||
|
modComputing.translate, ngettext = intllib.make_gettext_pair()
|
||
|
else
|
||
|
-- Old method using text files.
|
||
|
modComputing.translate = intllib.Getter()
|
||
|
end
|
||
|
elseif core.get_translator ~= nil and core.get_current_modname ~= nil and core.get_modpath(core.get_current_modname()) then
|
||
|
modComputing.translate = core.get_translator(core.get_current_modname())
|
||
|
else
|
||
|
modComputing.translate = function(s) return s end
|
||
|
end
|