Merge pull request #517 from wpferguson/contrib_g_to_o

contrib/[g-o]*.lua - clean up translatable strings
This commit is contained in:
wpferguson
2024-10-16 20:49:46 -04:00
committed by GitHub
14 changed files with 32 additions and 60 deletions

View File

@@ -54,8 +54,6 @@ du.check_min_api_version("7.0.0", "HDRmerge")
-- Tell gettext where to find the .mo file translating messages for a particular domain -- Tell gettext where to find the .mo file translating messages for a particular domain
local gettext = dt.gettext.gettext local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("HDRMerge", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -218,7 +216,7 @@ local function main()
PreCall({HDRM}) --check if furst run then check if install OK PreCall({HDRM}) --check if furst run then check if install OK
if HDRM.install_error then if HDRM.install_error then
dt.print_error('HDRMerge install issue') dt.print_error('HDRMerge install issue')
dt.print(_('HDRMerge install issue, please ensure the binary path is proper')) dt.print(_('HDRMerge install issue, please ensure the binary path is correct'))
return return
end end
images = dt.gui.selection() --get selected images images = dt.gui.selection() --get selected images
@@ -416,14 +414,14 @@ GUI.Target.copy_tags = dt.new_widget('check_button'){
temp = dt.preferences.read(mod, 'active_add_tags', 'string') temp = dt.preferences.read(mod, 'active_add_tags', 'string')
if temp == '' then temp = nil end if temp == '' then temp = nil end
GUI.Target.add_tags = dt.new_widget('entry'){ GUI.Target.add_tags = dt.new_widget('entry'){
tooltip = _('additional tags to be added on import, seperate with commas, all spaces will be removed'), tooltip = _('additional tags to be added on import, separate with commas, all spaces will be removed'),
text = temp, text = temp,
placeholder = _('enter tags, seperated by commas'), placeholder = _('enter tags, separated by commas'),
editable = true editable = true
} }
GUI.run = dt.new_widget('button'){ GUI.run = dt.new_widget('button'){
label = _('merge'), label = _('merge'),
tooltip =_('run HDRMerge with the above specified settings'), tooltip =_('run HDRMerge with the above settings'),
clicked_callback = function() main() end clicked_callback = function() main() end
} }
GUI.exes.HDRMerge = dt.new_widget('file_chooser_button'){ GUI.exes.HDRMerge = dt.new_widget('file_chooser_button'){

View File

@@ -54,8 +54,6 @@ du.check_min_api_version("7.0.0", "LabelsToTags")
local gettext = darktable.gettext.gettext local gettext = darktable.gettext.gettext
darktable.gettext.bindtextdomain("LabelsToTags", darktable.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -216,8 +214,8 @@ ltt.my_widget = darktable.new_widget("box") {
orientation = "vertical", orientation = "vertical",
mappingComboBox, mappingComboBox,
darktable.new_widget("button") { darktable.new_widget("button") {
label = "start", label = _("start"),
tooltip = "Tag all selected images", tooltip = _("tag all selected images"),
clicked_callback = doTagging clicked_callback = doTagging
} }
} }
@@ -247,7 +245,7 @@ end
local function install_module() local function install_module()
if not ltt.module_installed then if not ltt.module_installed then
darktable.register_lib(LIB_ID,"labels to tags",true,true,{ darktable.register_lib(LIB_ID,_("labels to tags"),true,true,{
[darktable.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER",20}, [darktable.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER",20},
},ltt.my_widget,nil,nil) },ltt.my_widget,nil,nil)
ltt.module_installed = true ltt.module_installed = true

View File

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

View File

@@ -40,8 +40,6 @@ local gettext = dt.gettext.gettext
du.check_min_api_version("7.0.0", "geoJSON_export") du.check_min_api_version("7.0.0", "geoJSON_export")
dt.gettext.bindtextdomain("geoJSON_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -92,19 +90,19 @@ end
local function create_geoJSON_file(storage, image_table, extra_data) local function create_geoJSON_file(storage, image_table, extra_data)
if not df.check_if_bin_exists("mkdir") then if not df.check_if_bin_exists("mkdir") then
dt.print_error(_("mkdir not found")) dt.print_error("mkdir not found")
return return
end end
if not df.check_if_bin_exists("convert") then if not df.check_if_bin_exists("convert") then
dt.print_error(_("convert not found")) dt.print_error("convert not found")
return return
end end
if not df.check_if_bin_exists("xdg-open") then if not df.check_if_bin_exists("xdg-open") then
dt.print_error(_("xdg-open not found")) dt.print_error("xdg-open not found")
return return
end end
if not df.check_if_bin_exists("xdg-user-dir") then if not df.check_if_bin_exists("xdg-user-dir") then
dt.print_error(_("xdg-user-dir not found")) dt.print_error("xdg-user-dir not found")
return return
end end
@@ -295,7 +293,7 @@ local function create_geoJSON_file(storage, image_table, extra_data)
file:write(geoJSON_file) file:write(geoJSON_file)
file:close() file:close()
dt.print("geoJSON file created in "..exportDirectory) dt.print(string.format(_("%s file created in %s"), "geoJSON", exportDirectory))
-- Open the file with the standard programm -- Open the file with the standard programm
if ( dt.preferences.read("geoJSON_export","OpengeoJSONFile","bool") == true ) then if ( dt.preferences.read("geoJSON_export","OpengeoJSONFile","bool") == true ) then

View File

@@ -33,8 +33,6 @@ local gettext = dt.gettext.gettext
du.check_min_api_version("7.0.0", "geoToolbox") du.check_min_api_version("7.0.0", "geoToolbox")
dt.gettext.bindtextdomain("geoToolbox", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -77,7 +75,7 @@ local label_copy_gps_lon = dt.new_widget("check_button")
} }
local label_copy_gps_ele = dt.new_widget("check_button") local label_copy_gps_ele = dt.new_widget("check_button")
{ {
label = _("elevation:"), label = _("elevation: "),
value = true value = true
} }
-- </GUI> -- </GUI>
@@ -372,12 +370,12 @@ end
local function reverse_geocode() local function reverse_geocode()
if not df.check_if_bin_exists("curl") then if not df.check_if_bin_exists("curl") then
dt.print_error(_("curl not found")) dt.print_error("curl not found")
return return
end end
if not df.check_if_bin_exists("jq") then if not df.check_if_bin_exists("jq") then
dt.print_error(_("jq not found")) dt.print_error("jq not found")
return return
end end
@@ -597,7 +595,7 @@ local function install_module()
if not gT.module_installed then if not gT.module_installed then
dt.register_lib( dt.register_lib(
"geoToolbox", -- Module name "geoToolbox", -- Module name
"geo toolbox", -- name _("geo toolbox"), -- name
true, -- expandable true, -- expandable
false, -- resetable false, -- resetable
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers

View File

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

View File

@@ -29,8 +29,6 @@ local gettext = dt.gettext
dl.check_min_api_version("7.0.0", "gpx_export") dl.check_min_api_version("7.0.0", "gpx_export")
gettext.bindtextdomain("gpx_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext.dgettext("gpx_export", msgid) return gettext.dgettext("gpx_export", msgid)
end end
@@ -150,7 +148,7 @@ local function install_module()
if not gpx.module_installed then if not gpx.module_installed then
dt.register_lib( dt.register_lib(
"gpx_exporter", "gpx_exporter",
"gpx export", _("gpx export"),
true, -- expandable true, -- expandable
true, -- resetable true, -- resetable
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, -- containers

View File

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

View File

@@ -64,8 +64,6 @@ du.check_min_api_version("7.0.0", MODULE)
local gettext = dt.gettext.gettext local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("hif_group_leader", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -188,7 +186,7 @@ dt.register_event(MODULE .. "_collect", "shortcut",
local images = dt.collection local images = dt.collection
make_existing_hif_group_leader(images) make_existing_hif_group_leader(images)
end, end,
_("make hif group leader for collection") string.format(_("make hif group leader for %s", _("collection")))
) )
dt.register_event(MODULE .. "_select", "shortcut", dt.register_event(MODULE .. "_select", "shortcut",
@@ -196,7 +194,7 @@ dt.register_event(MODULE .. "_select", "shortcut",
local images = dt.gui.selection() local images = dt.gui.selection()
make_existing_hif_group_leader(images) make_existing_hif_group_leader(images)
end, end,
_("make hif group leader for selection") string.format(_("make hif group leader for %s", _("selection")))
) )
return script_data return script_data

View File

@@ -56,8 +56,6 @@ local PQ = dt.configuration.running_os == "windows" and '"' or "'"
-- works with darktable API version from 5.0.0 on -- works with darktable API version from 5.0.0 on
du.check_min_api_version("7.0.0", "hugin") du.check_min_api_version("7.0.0", "hugin")
dt.gettext.bindtextdomain("hugin", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -85,7 +83,7 @@ end
local function show_status(storage, image, format, filename, local function show_status(storage, image, format, filename,
number, total, high_quality, extra_data) number, total, high_quality, extra_data)
dt.print("exporting to hugin: "..tostring(number).."/"..tostring(total)) dt.print(string.format(_("exporting to hugin: %d / $d"), number, total))
end end
local function create_panorama(storage, image_table, extra_data) --finalize local function create_panorama(storage, image_table, extra_data) --finalize
@@ -146,7 +144,7 @@ local function create_panorama(storage, image_table, extra_data) --finalize
end end
if first_file == nil then if first_file == nil then
dt.print("no file selected") dt.print(_("no file selected"))
return return
end end

View File

@@ -73,8 +73,6 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
-- works with LUA API version 5.0.0 -- works with LUA API version 5.0.0
du.check_min_api_version("7.0.0", "image_stack") du.check_min_api_version("7.0.0", "image_stack")
dt.gettext.bindtextdomain("image_stack", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -141,19 +139,19 @@ local chkbtn_will_align = dt.new_widget("check_button"){
local chkbtn_radial_distortion = dt.new_widget("check_button"){ local chkbtn_radial_distortion = dt.new_widget("check_button"){
label = _('optimize radial distortion for all images'), label = _('optimize radial distortion for all images'),
value = dt.preferences.read("align_image_stack", "def_radial_distortion", "bool"), value = dt.preferences.read("align_image_stack", "def_radial_distortion", "bool"),
tooltip = _('optimize radial distortion for all images, \nexcept for first'), tooltip = _('optimize radial distortion for all images, \nexcept the first'),
} }
local chkbtn_optimize_field = dt.new_widget("check_button"){ local chkbtn_optimize_field = dt.new_widget("check_button"){
label = _('optimize field of view for all images'), label = _('optimize field of view for all images'),
value = dt.preferences.read("align_image_stack", "def_optimize_field", "bool"), value = dt.preferences.read("align_image_stack", "def_optimize_field", "bool"),
tooltip =_('optimize field of view for all images, except for first. \nUseful for aligning focus stacks (DFF) with slightly \ndifferent magnification.'), tooltip =_('optimize field of view for all images, except the first. \nUseful for aligning focus stacks (DFF) with slightly \ndifferent magnification.'),
} }
local chkbtn_optimize_image_center = dt.new_widget("check_button"){ local chkbtn_optimize_image_center = dt.new_widget("check_button"){
label = _('optimize image center shift for all images'), label = _('optimize image center shift for all images'),
value = dt.preferences.read("align_image_stack", "def_optimize_image_center", "bool"), value = dt.preferences.read("align_image_stack", "def_optimize_image_center", "bool"),
tooltip =_('optimize image center shift for all images, \nexcept for first.'), tooltip =_('optimize image center shift for all images, \nexcept the first.'),
} }
local chkbtn_auto_crop = dt.new_widget("check_button"){ local chkbtn_auto_crop = dt.new_widget("check_button"){
@@ -506,7 +504,7 @@ local function image_stack(storage, image_table, extra_data)
return return
end end
job = dt.gui.create_job("image stack", true, stop_job) job = dt.gui.create_job(_("image stack"), true, stop_job)
job.percent = job.percent + percent_step job.percent = job.percent + percent_step
-- align images if requested -- align images if requested

View File

@@ -116,8 +116,6 @@ img_time.event_registered = false
du.check_min_api_version("7.0.0", "image_time") du.check_min_api_version("7.0.0", "image_time")
dt.gettext.bindtextdomain("image_time", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -195,7 +193,7 @@ end
local function synchronize_time(images) local function synchronize_time(images)
local sign = 1 local sign = 1
if img_time.sdir.value == "subtract" then if img_time.sdir.value == _("subtract") then
sign = -1 sign = -1
end end
synchronize_times(images, tonumber(img_time.diff_entry.text) * sign) synchronize_times(images, tonumber(img_time.diff_entry.text) * sign)
@@ -511,7 +509,7 @@ img_time.stack = dt.new_widget("stack"){
dt.new_widget("box"){ dt.new_widget("box"){
orientation = "vertical", orientation = "vertical",
dt.new_widget("label"){label = _("set time")}, dt.new_widget("label"){label = _("set time")},
dt.new_widget("section_label"){label = _("date: ")}, dt.new_widget("section_label"){label = _("date:")},
img_time.sdy, img_time.sdy,
img_time.smo, img_time.smo,
img_time.syr, img_time.syr,

View File

@@ -64,8 +64,6 @@ du.check_min_api_version("7.0.0", MODULE)
local gettext = dt.gettext.gettext local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("jpg_group_leader", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -188,7 +186,7 @@ dt.register_event(MODULE .. "_collect", "shortcut",
local images = dt.collection local images = dt.collection
make_existing_jpg_group_leader(images) make_existing_jpg_group_leader(images)
end, end,
_("make jpg group leader for collection") string.format(_("make jpg group leader for %s", _("collection")))
) )
dt.register_event(MODULE .. "_select", "shortcut", dt.register_event(MODULE .. "_select", "shortcut",
@@ -196,7 +194,7 @@ dt.register_event(MODULE .. "_select", "shortcut",
local images = dt.gui.selection() local images = dt.gui.selection()
make_existing_jpg_group_leader(images) make_existing_jpg_group_leader(images)
end, end,
_("make jpg group leader for selection") string.format(_("make jpg group leader for %s", _("selection")))
) )
return script_data return script_data

View File

@@ -45,8 +45,6 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
du.check_min_api_version("7.0.0", "kml_export") du.check_min_api_version("7.0.0", "kml_export")
dt.gettext.bindtextdomain("kml_export", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid) local function _(msgid)
return gettext(msgid) return gettext(msgid)
end end
@@ -95,12 +93,12 @@ local function create_kml_file(storage, image_table, extra_data)
end end
if not df.check_if_bin_exists(magickPath) then if not df.check_if_bin_exists(magickPath) then
dt.print_error(_("magick not found")) dt.print_error("magick not found")
return return
end end
if dt.configuration.running_os == "linux" then if dt.configuration.running_os == "linux" then
if not df.check_if_bin_exists("xdg-user-dir") then if not df.check_if_bin_exists("xdg-user-dir") then
dt.print_error(_("xdg-user-dir not found")) dt.print_error("xdg-user-dir not found")
return return
end end
end end
@@ -110,7 +108,7 @@ local function create_kml_file(storage, image_table, extra_data)
if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true
and dt.configuration.running_os == "linux") then and dt.configuration.running_os == "linux") then
if not df.check_if_bin_exists("zip") then if not df.check_if_bin_exists("zip") then
dt.print_error(_("zip not found")) dt.print_error("zip not found")
return return
end end
exportDirectory = dt.configuration.tmp_dir exportDirectory = dt.configuration.tmp_dir