Skip to content

Commit 3c77f2e

Browse files
authored
Merge branch 'master' into script_manager_new_ui
2 parents 4ff1111 + abfa8e9 commit 3c77f2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4035
-2133
lines changed

contrib/AutoGrouper.lua

Lines changed: 225 additions & 219 deletions
Large diffs are not rendered by default.

contrib/CollectHelper.lua

Lines changed: 260 additions & 254 deletions
Large diffs are not rendered by default.

contrib/HDRMerge.lua

Lines changed: 487 additions & 478 deletions
Large diffs are not rendered by default.

contrib/LabelsToTags.lua

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,25 @@ local du = require "lib/dtutils"
5252

5353
du.check_min_api_version("7.0.0", "LabelsToTags")
5454

55+
local gettext = darktable.gettext.gettext
56+
57+
darktable.gettext.bindtextdomain("LabelsToTags", darktable.configuration.config_dir .."/lua/locale/")
58+
59+
local function _(msgid)
60+
return gettext(msgid)
61+
end
62+
5563
-- return data structure for script_manager
5664

5765
local script_data = {}
5866

67+
script_data.metadata = {
68+
name = "LabelsToTags",
69+
purpose = _("allows the mass-application of tags using color labels and ratings as a guide"),
70+
author = "August Schwerdfeger ([email protected])",
71+
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/contrib/LabelsToTags"
72+
}
73+
5974
script_data.destroy = nil -- function to destory the script
6075
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet, otherwise leave as nil
6176
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
@@ -68,7 +83,7 @@ local ltt = {}
6883
ltt.module_installed = false
6984
ltt.event_registered = false
7085

71-
local LIB_ID = "LabelsToTags"
86+
local LIB_ID = _("LabelsToTags")
7287

7388
-- Helper functions: BEGIN
7489

@@ -109,23 +124,23 @@ end
109124

110125

111126
local initialAvailableMappings = {
112-
["Colors"] = { ["+*****"] = { "Red" },
113-
["*+****"] = { "Yellow" },
114-
["**+***"] = { "Green" },
115-
["***+**"] = { "Blue" },
116-
["****+*"] = { "Purple" } },
117-
["Single colors"] = { ["+----*"] = { "Red", "Only red" },
118-
["-+---*"] = { "Yellow", "Only yellow" },
119-
["--+--*"] = { "Green", "Only green" },
120-
["---+-*"] = { "Blue", "Only blue" },
121-
["----+*"] = { "Purple", "Only purple" } },
122-
["Ratings"] = { ["*****0"] = { "No stars", "Not rejected" },
123-
["*****1"] = { "One star", "Not rejected" },
124-
["*****2"] = { "Two stars", "Not rejected" },
125-
["*****3"] = { "Three stars", "Not rejected" },
126-
["*****4"] = { "Four stars", "Not rejected" },
127-
["*****5"] = { "Five stars", "Not rejected" },
128-
["*****R"] = { "Rejected" } }
127+
[_("colors")] = { ["+*****"] = { _("red") },
128+
["*+****"] = { _("yellow") },
129+
["**+***"] = { _("green") },
130+
["***+**"] = { _("blue") },
131+
["****+*"] = { _("purple") } },
132+
[_("single colors")] = { ["+----*"] = { _("red"), _("only red") },
133+
["-+---*"] = { _("Yellow"), _("only yellow") },
134+
["--+--*"] = { _("Green"), _("only green") },
135+
["---+-*"] = { _("Blue"), _("only blue") },
136+
["----+*"] = { _("Purple"), _("only purple") } },
137+
[_("ratings")] = { ["*****0"] = { _("no stars"), _("not rejected") },
138+
["*****1"] = { _("one star"), _("not rejected") },
139+
["*****2"] = { _("two stars"), _("not rejected") },
140+
["*****3"] = { _("three stars"), _("not rejected") },
141+
["*****4"] = { _("four stars"), _("not rejected") },
142+
["*****5"] = { _("five stars"), _("not rejected") },
143+
["*****R"] = { _("rejected") } }
129144
}
130145

131146
local availableMappings = {}
@@ -140,14 +155,14 @@ end
140155

141156
local function getComboboxTooltip()
142157
if availableMappings == nil or next(availableMappings) == nil then
143-
return("No registered mappings -- using defaults")
158+
return(_("no registered mappings -- using defaults"))
144159
else
145-
return("Select a label-to-tag mapping")
160+
return(_("select a label-to-tag mapping"))
146161
end
147162
end
148163

149164
local mappingComboBox = darktable.new_widget("combobox"){
150-
label = "mapping",
165+
label = _("mapping"),
151166
value = 1,
152167
tooltip = getComboboxTooltip(),
153168
reset_callback = function(selfC)
@@ -170,7 +185,7 @@ local mappingComboBox = darktable.new_widget("combobox"){
170185
}
171186

172187
local function doTagging(selfC)
173-
local job = darktable.gui.create_job(string.format("labels to tags (%d image" .. (#(darktable.gui.action_images) == 1 and "" or "s") .. ")",#(darktable.gui.action_images)),true)
188+
local job = darktable.gui.create_job(string.format(_("labels to tags (%d image%s)"), #(darktable.gui.action_images), (#(darktable.gui.action_images) == 1 and "" or "s")), true)
174189
job.percent = 0.0
175190
local pctIncrement = 1.0 / #(darktable.gui.action_images)
176191

0 commit comments

Comments
 (0)