add_lens_info l10n

This commit is contained in:
Florian Tham
2025-05-06 15:32:23 +02:00
parent 9e5a63c8ca
commit d44355aeb8
3 changed files with 78 additions and 2 deletions

View File

@@ -73,10 +73,20 @@ du.check_min_api_version("7.0.0", MODULE) -- choose the minimum version that c
-- I 1 8 N
-- - - - - - - - - - - - - - - - - - - - - - - - - -
local gettext = dt.gettext.gettext
local os_path_seperator = "/"
local scriptfile = debug.getinfo( 1, "S" )
local localedir = dt.configuration.config_dir..'/lua/locale/'
if scriptfile ~= nil and scriptfile.source ~= nil then
local path = scriptfile.source:match( "[^@].*[/\\]" )
localedir = path..os_path_seperator..'locale'
end
dt.print_log( "localedir: "..localedir )
local gettext = dt.gettext
gettext.bindtextdomain(MODULE, localedir)
local function _(msgid)
return gettext(msgid)
return gettext.dgettext(MODULE, msgid)
end