updated example scripts to use darktable translation facilities

This commit is contained in:
Bill Ferguson
2024-01-19 18:57:18 -05:00
parent f9fe33f930
commit c11845cbf9
11 changed files with 87 additions and 58 deletions

View File

@@ -70,13 +70,10 @@ local dtsys = require "lib/dtutils.system" -- system utilities
translations, inserting this lays the groundwork for anyone who wants to translate the strings.
]]
local gettext = dt.gettext
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("multi_os",dt.configuration.config_dir.."/lua/locale/")
local gettext = dt.gettext.gettext
local function _(msgid)
return gettext.dgettext("multi_os", msgid)
return gettext(msgid)
end
--[[
@@ -187,7 +184,7 @@ local function extract_embedded_jpeg(images)
end
else
dt.print_error(image.filename .. " is not a raw file. No image can be extracted") -- print debugging error message
dt.print(image.filename .. " is not a raw file. No image can be extracted") -- print the error to the screen
dt.print(string.format(_("%s is not a raw file. No image can be extracted"), image.filename)) -- print the error to the screen
end
end
else
@@ -241,7 +238,7 @@ end
dt.gui.libs.image.register_action(
"multi_os", _("extract embedded jpeg"),
function(event, images) extract_embedded_jpeg(images) end,
"extract embedded jpeg"
_("extract embedded jpeg")
)
--[[
@@ -251,7 +248,7 @@ dt.gui.libs.image.register_action(
dt.register_event(
"multi_os", "shortcut",
function(event, shortcut) extract_embedded_jpeg(dt.gui.action_images) end,
"extract embedded jpeg"
_("extract embedded jpeg")
)
--[[