all scripts - added bindtextdomain back in because 4.8 isn't ready to

handle the translations yet.  In 5.0 this will be removed
              and darktable will handle translating the strings.
This commit is contained in:
Bill Ferguson
2024-05-14 22:39:22 -04:00
parent 231e9b352b
commit cd3788f012
60 changed files with 120 additions and 3 deletions

View File

@@ -27,6 +27,8 @@ local dt = require "darktable"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("api_version", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end

View File

@@ -40,7 +40,7 @@ local du = require "lib/dtutils"
-- V E R S I O N C H E C K
-- - - - - - - - - - - - - - - - - - - - - - - -
du.check_min_api_version("5.0.2", "darkroom_mode") -- darktable 3.0
du.check_min_api_version("5.0.2", "darkroom_demo") -- darktable 3.0
-- script_manager integration to allow a script to be removed
-- without restarting darktable
@@ -52,7 +52,7 @@ end
-- C O N S T A N T S
-- - - - - - - - - - - - - - - - - - - - - - - -
local MODULE_NAME = "darkroom"
local MODULE_NAME = "darkroom_demo"
local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- - - - - - - - - - - - - - - - - - - - - - - -
@@ -60,6 +60,8 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- - - - - - - - - - - - - - - - - - - - - - - -
local gettext = dt.gettext.gettext
gettext.bindtextdomain("darkroom_demo", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -69,6 +69,8 @@ dt.print_error("Hello World!")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("gettextExample", dt.configuration.config_dir .."/lua/locale/")
-- Translate a string using the darktable textdomain
dt.print_error(gettext("image"))

View File

@@ -35,6 +35,8 @@ du.check_min_api_version("2.0.0", "hello_world")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("hello_world", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end

View File

@@ -61,6 +61,8 @@ end
-- - - - - - - - - - - - - - - - - - - - - - - -
local gettext = dt.gettext.gettext
gettext.bindtextdomain("lighttable_demo", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -49,6 +49,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
-- https://www.darktable.org/lua-api/index.html#darktable_gettext
local gettext = dt.gettext.gettext
gettext.bindtextdomain("moduleExample", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -72,6 +72,8 @@ local dtsys = require "lib/dtutils.system" -- system utilities
local gettext = dt.gettext.gettext
gettext.bindtextdomain("multi_os", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -53,7 +53,7 @@ end
-- C O N S T A N T S
-- - - - - - - - - - - - - - - - - - - - - - - -
local MODULE_NAME = "panels"
local MODULE_NAME = "panels_demo"
local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- - - - - - - - - - - - - - - - - - - - - - - -
@@ -61,6 +61,8 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- - - - - - - - - - - - - - - - - - - - - - - -
local gettext = dt.gettext.gettext
gettext.bindtextdomain("panels_demo", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -28,6 +28,8 @@ local du = require "lib/dtutils"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("preferenceExamples", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end

View File

@@ -28,6 +28,8 @@ du.check_min_api_version("5.0.0", "printExamples")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("printExamples", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end

View File

@@ -34,6 +34,8 @@ du.check_min_api_version("5.0.0", "running_os")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("running_os", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end