mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-07-13 01:51:51 -04:00
This commit is contained in:
parent
98702d6780
commit
1ccfe86adf
6 changed files with 70 additions and 13 deletions
23
translate.lua
Normal file
23
translate.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue