Skip to content

Commit 526e97a

Browse files
authored
Merge pull request #517 from wpferguson/contrib_g_to_o
contrib/[g-o]*.lua - clean up translatable strings
2 parents e359567 + 6484008 commit 526e97a

14 files changed

+32
-60
lines changed

contrib/HDRMerge.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ du.check_min_api_version("7.0.0", "HDRmerge")
5454
-- Tell gettext where to find the .mo file translating messages for a particular domain
5555
local gettext = dt.gettext.gettext
5656

57-
dt.gettext.bindtextdomain("HDRMerge", dt.configuration.config_dir .."/lua/locale/")
58-
5957
local function _(msgid)
6058
return gettext(msgid)
6159
end
@@ -218,7 +216,7 @@ local function main()
218216
PreCall({HDRM}) --check if furst run then check if install OK
219217
if HDRM.install_error then
220218
dt.print_error('HDRMerge install issue')
221-
dt.print(_('HDRMerge install issue, please ensure the binary path is proper'))
219+
dt.print(_('HDRMerge install issue, please ensure the binary path is correct'))
222220
return
223221
end
224222
images = dt.gui.selection() --get selected images
@@ -416,14 +414,14 @@ GUI.Target.copy_tags = dt.new_widget('check_button'){
416414
temp = dt.preferences.read(mod, 'active_add_tags', 'string')
417415
if temp == '' then temp = nil end
418416
GUI.Target.add_tags = dt.new_widget('entry'){
419-
tooltip = _('additional tags to be added on import, seperate with commas, all spaces will be removed'),
417+
tooltip = _('additional tags to be added on import, separate with commas, all spaces will be removed'),
420418
text = temp,
421-
placeholder = _('enter tags, seperated by commas'),
419+
placeholder = _('enter tags, separated by commas'),
422420
editable = true
423421
}
424422
GUI.run = dt.new_widget('button'){
425423
label = _('merge'),
426-
tooltip =_('run HDRMerge with the above specified settings'),
424+
tooltip =_('run HDRMerge with the above settings'),
427425
clicked_callback = function() main() end
428426
}
429427
GUI.exes.HDRMerge = dt.new_widget('file_chooser_button'){

contrib/LabelsToTags.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ du.check_min_api_version("7.0.0", "LabelsToTags")
5454

5555
local gettext = darktable.gettext.gettext
5656

57-
darktable.gettext.bindtextdomain("LabelsToTags", darktable.configuration.config_dir .."/lua/locale/")
58-
5957
local function _(msgid)
6058
return gettext(msgid)
6159
end
@@ -216,8 +214,8 @@ ltt.my_widget = darktable.new_widget("box") {
216214
orientation = "vertical",
217215
mappingComboBox,
218216
darktable.new_widget("button") {
219-
label = "start",
220-
tooltip = "Tag all selected images",
217+
label = _("start"),
218+
tooltip = _("tag all selected images"),
221219
clicked_callback = doTagging
222220
}
223221
}
@@ -247,7 +245,7 @@ end
247245

248246
local function install_module()
249247
if not ltt.module_installed then
250-
darktable.register_lib(LIB_ID,"labels to tags",true,true,{
248+
darktable.register_lib(LIB_ID,_("labels to tags"),true,true,{
251249
[darktable.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER",20},
252250
},ltt.my_widget,nil,nil)
253251
ltt.module_installed = true

contrib/OpenInExplorer.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ local gettext = dt.gettext.gettext
5656
--Check API version
5757
du.check_min_api_version("7.0.0", "OpenInExplorer")
5858

59-
dt.gettext.bindtextdomain("OpenInExplorer", dt.configuration.config_dir .."/lua/locale/")
60-
6159
local function _(msgid)
6260
return gettext(msgid)
6361
end

contrib/geoJSON_export.lua

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ local gettext = dt.gettext.gettext
4040

4141
du.check_min_api_version("7.0.0", "geoJSON_export")
4242

43-
dt.gettext.bindtextdomain("geoJSON_export", dt.configuration.config_dir .."/lua/locale/")
44-
4543
local function _(msgid)
4644
return gettext(msgid)
4745
end
@@ -92,19 +90,19 @@ end
9290

9391
local function create_geoJSON_file(storage, image_table, extra_data)
9492
if not df.check_if_bin_exists("mkdir") then
95-
dt.print_error(_("mkdir not found"))
93+
dt.print_error("mkdir not found")
9694
return
9795
end
9896
if not df.check_if_bin_exists("convert") then
99-
dt.print_error(_("convert not found"))
97+
dt.print_error("convert not found")
10098
return
10199
end
102100
if not df.check_if_bin_exists("xdg-open") then
103-
dt.print_error(_("xdg-open not found"))
101+
dt.print_error("xdg-open not found")
104102
return
105103
end
106104
if not df.check_if_bin_exists("xdg-user-dir") then
107-
dt.print_error(_("xdg-user-dir not found"))
105+
dt.print_error("xdg-user-dir not found")
108106
return
109107
end
110108

@@ -295,7 +293,7 @@ local function create_geoJSON_file(storage, image_table, extra_data)
295293
file:write(geoJSON_file)
296294
file:close()
297295

298-
dt.print("geoJSON file created in "..exportDirectory)
296+
dt.print(string.format(_("%s file created in %s"), "geoJSON", exportDirectory))
299297

300298
-- Open the file with the standard programm
301299
if ( dt.preferences.read("geoJSON_export","OpengeoJSONFile","bool") == true ) then

contrib/geoToolbox.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ local gettext = dt.gettext.gettext
3333

3434
du.check_min_api_version("7.0.0", "geoToolbox")
3535

36-
dt.gettext.bindtextdomain("geoToolbox", dt.configuration.config_dir .."/lua/locale/")
37-
3836
local function _(msgid)
3937
return gettext(msgid)
4038
end
@@ -77,7 +75,7 @@ local label_copy_gps_lon = dt.new_widget("check_button")
7775
}
7876
local label_copy_gps_ele = dt.new_widget("check_button")
7977
{
80-
label = _("elevation:"),
78+
label = _("elevation: "),
8179
value = true
8280
}
8381
-- </GUI>
@@ -372,12 +370,12 @@ end
372370
local function reverse_geocode()
373371

374372
if not df.check_if_bin_exists("curl") then
375-
dt.print_error(_("curl not found"))
373+
dt.print_error("curl not found")
376374
return
377375
end
378376

379377
if not df.check_if_bin_exists("jq") then
380-
dt.print_error(_("jq not found"))
378+
dt.print_error("jq not found")
381379
return
382380
end
383381

@@ -597,7 +595,7 @@ local function install_module()
597595
if not gT.module_installed then
598596
dt.register_lib(
599597
"geoToolbox", -- Module name
600-
"geo toolbox", -- name
598+
_("geo toolbox"), -- name
601599
true, -- expandable
602600
false, -- resetable
603601
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers

contrib/gimp.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ local gimp_widget = nil
7474

7575
du.check_min_api_version("7.0.0", "gimp")
7676

77-
dt.gettext.bindtextdomain("gimp", dt.configuration.config_dir .."/lua/locale/")
78-
7977
local function _(msgid)
8078
return gettext(msgid)
8179
end

contrib/gpx_export.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ local gettext = dt.gettext
2929

3030
dl.check_min_api_version("7.0.0", "gpx_export")
3131

32-
gettext.bindtextdomain("gpx_export", dt.configuration.config_dir .."/lua/locale/")
33-
3432
local function _(msgid)
3533
return gettext.dgettext("gpx_export", msgid)
3634
end
@@ -150,7 +148,7 @@ local function install_module()
150148
if not gpx.module_installed then
151149
dt.register_lib(
152150
"gpx_exporter",
153-
"gpx export",
151+
_("gpx export"),
154152
true, -- expandable
155153
true, -- resetable
156154
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers

contrib/harmonic_armature_guide.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ local gettext = dt.gettext.gettext
3636

3737
du.check_min_api_version("2.0.0", "harmonic_armature_guide")
3838

39-
dt.gettext.bindtextdomain("harmonic_armature_guide", dt.configuration.config_dir .."/lua/locale/")
40-
4139
local function _(msgid)
4240
return gettext(msgid)
4341
end

contrib/hif_group_leader.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ du.check_min_api_version("7.0.0", MODULE)
6464

6565
local gettext = dt.gettext.gettext
6666

67-
dt.gettext.bindtextdomain("hif_group_leader", dt.configuration.config_dir .."/lua/locale/")
68-
6967
local function _(msgid)
7068
return gettext(msgid)
7169
end
@@ -188,15 +186,15 @@ dt.register_event(MODULE .. "_collect", "shortcut",
188186
local images = dt.collection
189187
make_existing_hif_group_leader(images)
190188
end,
191-
_("make hif group leader for collection")
189+
string.format(_("make hif group leader for %s", _("collection")))
192190
)
193191

194192
dt.register_event(MODULE .. "_select", "shortcut",
195193
function(event, shortcut)
196194
local images = dt.gui.selection()
197195
make_existing_hif_group_leader(images)
198196
end,
199-
_("make hif group leader for selection")
197+
string.format(_("make hif group leader for %s", _("selection")))
200198
)
201199

202200
return script_data

contrib/hugin.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ local PQ = dt.configuration.running_os == "windows" and '"' or "'"
5656
-- works with darktable API version from 5.0.0 on
5757
du.check_min_api_version("7.0.0", "hugin")
5858

59-
dt.gettext.bindtextdomain("hugin", dt.configuration.config_dir .."/lua/locale/")
60-
6159
local function _(msgid)
6260
return gettext(msgid)
6361
end
@@ -85,7 +83,7 @@ end
8583

8684
local function show_status(storage, image, format, filename,
8785
number, total, high_quality, extra_data)
88-
dt.print("exporting to hugin: "..tostring(number).."/"..tostring(total))
86+
dt.print(string.format(_("exporting to hugin: %d / $d"), number, total))
8987
end
9088

9189
local function create_panorama(storage, image_table, extra_data) --finalize
@@ -146,7 +144,7 @@ local function create_panorama(storage, image_table, extra_data) --finalize
146144
end
147145

148146
if first_file == nil then
149-
dt.print("no file selected")
147+
dt.print(_("no file selected"))
150148
return
151149
end
152150

0 commit comments

Comments
 (0)