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

@@ -53,6 +53,7 @@ script_data.restart = nil -- how to restart the (lib) script after it's been hid
script_data.show = nil -- only required for libs since the destroy_method only hides them
local gettext = dt.gettext.gettext
gettext.bindtextdomain(MOD, dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)

View File

@@ -62,6 +62,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("CollectHelper", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -69,6 +69,8 @@ local CURR_API_STRING = dt.configuration.api_version_string
-- Tell gettext where to find the .mo file translating messages for a particular domain
local gettext = dt.gettext.gettext
gettext.bindtextdomain("HDRMerge", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -54,6 +54,8 @@ du.check_min_api_version("7.0.0", "LabelsToTags")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("LabelsToTags", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -65,6 +65,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("OpenInExplorer", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -80,6 +80,8 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- translation
local gettext = dt.gettext.gettext
gettext.bindtextdomain("RL_out_sharp", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -43,6 +43,7 @@ local filelib = require "lib/dtutils.file"
du.check_min_api_version("7.0.0", "autostyle")
local gettext = darktable.gettext.gettext
gettext.bindtextdomain("autostyle", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)

View File

@@ -40,6 +40,8 @@ local gettext = dt.gettext.gettext
local MODULE = "change_group_leader"
gettext.bindtextdomain(MODULE, dt.configuration.config_dir .."/lua/locale/")
du.check_min_api_version("3.0.0", MODULE)
-- return data structure for script_manager

View File

@@ -49,6 +49,7 @@ script_data.restart = nil -- how to restart the (lib) script after it's been hid
script_data.show = nil -- only required for libs since the destroy_method only hides them
local gettext = dt.gettext.gettext
gettext.bindtextdomain("clear_GPS", dt.configuration.config_dir .."/lua/locale/")
-- not a number
local NaN = 0/0

View File

@@ -54,6 +54,8 @@ du.check_min_api_version("7.0.0", "color_profile_manager")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("color_profile_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -53,6 +53,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("copy_attach_detach_tags", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -39,6 +39,8 @@ du.check_min_api_version("7.0.0", "cr2hdr")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("cr2hdr", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -71,6 +71,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
local gettext = dt.gettext.gettext
gettext.bindtextdomain("cycle_group_leader", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -79,6 +79,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
-- Tell gettext where to find the .mo file translating messages for a particular domain
local gettext = dt.gettext.gettext
gettext.bindtextdomain("enfuseAdvanced", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -44,6 +44,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
local gettext = dt.gettext.gettext
gettext.bindtextdomain("exportLUT", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -97,6 +97,8 @@ ee.widgets = {}
-- translation
local gettext = dt.gettext.gettext
gettext.bindtextdomain("ext_editor", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -69,6 +69,8 @@ local fc = {}
fc.module_installed = false
fc.event_registered = false
gettext.bindtextdomain("face_recognition", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -39,6 +39,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("fujifilm_ratings", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -48,6 +48,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("geoJSON_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -41,6 +41,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("geoToolbox", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -83,6 +83,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("gimp", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -38,6 +38,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("gpx_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext.dgettext("gpx_export", msgid)
end

View File

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

View File

@@ -75,6 +75,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
local gettext = dt.gettext.gettext
gettext.bindtextdomain("hif_group_leader", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -65,6 +65,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("hugin", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -82,6 +82,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("image_stack", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -126,6 +126,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
gettext.bindtextdomain("image_time", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -75,6 +75,8 @@ script_data.show = nil -- only required for libs since the destroy_method only h
local gettext = dt.gettext.gettext
gettext.bindtextdomain("jpg_group_leader", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -54,6 +54,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("kml_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

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

View File

@@ -44,6 +44,8 @@ local df = require "lib/dtutils.file"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("pdf_slideshow", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -64,6 +64,8 @@ exporter.max_width = 224
-- helper functions
gettext.bindtextdomain("photils", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -64,6 +64,8 @@ qt.widget_table = {}
local gettext = dt.gettext.gettext
gettext.bindtextdomain("quicktag", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -46,6 +46,8 @@ du.check_min_api_version("7.0.0", "rate_group")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("rate_group", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -38,6 +38,8 @@ du.deprecated("contrib/rename-tags.lua","darktable release 4.0")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("rename-tags", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -48,6 +48,8 @@ du.check_min_api_version("7.0.0", "rename_images")
local gettext = dt.gettext.gettext
gettext.bindtextdomain("rename_images", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -31,6 +31,8 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("select_non_existing", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -33,6 +33,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("select_untagged", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -40,6 +40,8 @@ script_data.destroy_method = nil -- set to hide for libs since we can't destroy
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
gettext.bindtextdomain("slideshowMusic", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -96,6 +96,8 @@ local PATH_SEGMENT_REGEX = "(" .. PATH_SEPARATOR .. "?)([^" .. PATH_SEPARATOR ..
unpack = unpack or table.unpack
gmatch = string.gfind or string.gmatch
gettext.bindtextdomain("transfer_hierarchy", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return darktable.gettext.gettext(msgid)
end

View File

@@ -54,6 +54,8 @@ local MODULE_NAME = "video_ffmpeg"
local PS = dt.configuration.running_os == "windows" and "\\" or "/"
gettext.bindtextdomain("video_ffmpeg", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

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

View File

@@ -58,6 +58,8 @@ local publisher = ""
local rights = ""
local tags = {}
gettext.bindtextdomain("copy_paste_metadata", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

@@ -57,6 +57,8 @@ enf.event_registered = false
enf.module_installed = false
enf.lib_widgets = {}
gettext.bindtextdomain("enfuse", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end

View File

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

View File

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

View File

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

View File

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

View File

@@ -55,6 +55,8 @@ exec_man.event_registered = false
-- F U N C T I O N S
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
gettext.bindtextdomain("executable_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end

View File

@@ -60,6 +60,8 @@ local debug = require "darktable.debug"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("script_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end