From c6ced0b1eac1a1173116df736cc12e704f4c9d2c Mon Sep 17 00:00:00 2001 From: chrik5 Date: Wed, 5 Oct 2016 16:33:13 +0200 Subject: [PATCH 01/21] first version of a quicktag modul --- contrib/quicktag.lua | 142 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 contrib/quicktag.lua diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua new file mode 100644 index 0000000..38677a0 --- /dev/null +++ b/contrib/quicktag.lua @@ -0,0 +1,142 @@ +--[[ + This file is part of darktable, + copyright 2016 by Christian Kanzian. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +]] + +--[[ + QUICKTAGS + This script that will create shortcuts and add a modul in lighttable mode to quickly attach tags. You have to create this tags before in the tagging module + +INSTALATION + * copy this file in $CONFIGDIR/lua/ where CONFIGDIR is your darktable configuration directory + * add the following line in the file $CONFIGDIR/luarc require "quicktag" + +USAGE + * set the shortcuts your in the preferences dialog + * change the entries as needed + +TODO + * make number of quicktag entries dynamic + * store tag entries in the hidden preferences + +]] + + +local dt = require "darktable" +dt.configuration.check_version(...,{4,0,0}) + +-- register number of quicktags +--dt.preferences.register("quickTag", +-- "quickTagnumber", +-- "integer", -- type +-- "number of quick tag fields", -- label +-- "number of quick tag fields from 2 to 10", -- tooltip +-- 3, -- default +-- 2, -- min +-- 10) + +--local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") + +-- set number of entries static now because i do not know howto create the modul dynamic +local qnr = 5 + +-- quicktag function to attach tags +local function tagattach(tag) + if tag == nil then + return true + end + + local tagnr = dt.tags.find(tag) + + if tagnr == nil then + dt.print("quick tag \""..tag.."\" not found in your taglist, please add it first!") + return true + end + + local sel_images = dt.gui.action_images + + for _,image in ipairs(sel_images) do + dt.tags.attach(tagnr,image) + end + dt.print("tag \""..tag.."\" attached") +end + + +-- quicktag module + +local tagentries = {} + +for j=1,qnr do + tagentries[#tagentries+1] = dt.new_widget("entry") + { + text = "qtest", + placeholder = "placeholder", + is_password = true, + editable = true, + tooltip = "Tooltip Text", + reset_callback = function(self) self.text = "test" end + } +end + +local label = dt.new_widget("label") +label.label = "MyLabel" -- This is an alternative way to the "{}" syntax to set a property +--end + +local button_tab = {} + +for j=1,qnr do + button_tab[#button_tab+1] = dt.new_widget("button") { + label = "tag "..j, + clicked_callback = function () tagattach(tostring(tagentries[j].text)) end} +end + + +--create modul static. it would be nice to place button and entry side by side +dt.register_lib( + "quicktag", -- Module name + "quick tag", -- name + true, -- expandable + false, -- resetable + {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 490}}, -- containers + + dt.new_widget("box"){ + orientation = "vertical", + button_tab[1], + tagentries[1], + button_tab[2], + tagentries[2], + button_tab[3], + tagentries[3], + button_tab[4], + tagentries[4], + button_tab[5], + tagentries[5]}, + nil,-- view_enter + nil -- view_leave +) + +print(tostring(tagentries.text)) + +--local testtag = "qtest" +-- create shortcuts +for i=1,qnr do + dt.register_event("shortcut", + function(event, shortcut) tagattach(tostring(tagentries[i].text)) end, + "quick tag "..i) +end + +-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua +-- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on; \ No newline at end of file From de823f043086c5df3fb6002a0396e837fe2942f0 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Thu, 6 Oct 2016 11:02:00 +0200 Subject: [PATCH 02/21] quicktag module make tag entries dynamic --- contrib/quicktag.lua | 146 +++++++++++++++++++++++++++---------------- 1 file changed, 93 insertions(+), 53 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 38677a0..4423e11 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -1,6 +1,9 @@ --[[ This file is part of darktable, - copyright 2016 by Christian Kanzian. + Copyright (C) 2016 by Christian Kanzian + + Thanks to + Copyright (C) 2016 Bill Ferguson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,40 +21,59 @@ --[[ QUICKTAGS - This script that will create shortcuts and add a modul in lighttable mode to quickly attach tags. You have to create this tags before in the tagging module + This script that will create shortcuts, a list of tag entries in the preferences and + add a modul in lighttable mode to quickly attach tags. If the tags do not exist in your databse, + you have to create them in the tagging module. -INSTALATION - * copy this file in $CONFIGDIR/lua/ where CONFIGDIR is your darktable configuration directory - * add the following line in the file $CONFIGDIR/luarc require "quicktag" + INSTALATION + * copy this file in $CONFIGDIR/lua/ where CONFIGDIR is your darktable configuration directory + * add the following line in the file $CONFIGDIR/luarc require "quicktag" USAGE - * set the shortcuts your in the preferences dialog - * change the entries as needed + * set the shortcuts and prefered tags your in the preferences dialog + * use the shortcuts or the buttons to attach the tags to selected images + * change the entries as needed + * use the "save taglist" button to update your preferences TODO - * make number of quicktag entries dynamic - * store tag entries in the hidden preferences - -]] + * enhance button and entry layout in the module + * autosave tag entries + ]] local dt = require "darktable" dt.configuration.check_version(...,{4,0,0}) -- register number of quicktags ---dt.preferences.register("quickTag", --- "quickTagnumber", --- "integer", -- type --- "number of quick tag fields", -- label --- "number of quick tag fields from 2 to 10", -- tooltip --- 3, -- default --- 2, -- min --- 10) +dt.preferences.register("quickTag", + "quickTagnumber", + "integer", -- type + "number of quick tag fields", -- label + "number of quick tag fields from 2 to 10 - needs a restart", -- tooltip + 3, -- default + 2, -- min + 10) ---local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") +local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") + +-- set quicktag in the preferences +for j=1,qnr do + dt.preferences.register("quickTag", + "quicktag"..j, + "string", -- type + "quick tag "..j, -- label + "please create the tags before in the tagging module", -- tooltip + "" -- default + ) +end + +-- get quicktags from the preferences +local quicktag_table = {} + +for j=1,qnr do + quicktag_table[j] = dt.preferences.read("quickTag", "quicktag"..j, "string") +end --- set number of entries static now because i do not know howto create the modul dynamic -local qnr = 5 -- quicktag function to attach tags local function tagattach(tag) @@ -68,41 +90,69 @@ local function tagattach(tag) local sel_images = dt.gui.action_images - for _,image in ipairs(sel_images) do - dt.tags.attach(tagnr,image) + if next(sel_images) == nil then + dt.print("no images selected") + return true end - dt.print("tag \""..tag.."\" attached") + + local counter = 0 + + for _,image in ipairs(sel_images) do + dt.tags.attach(tagnr,image) + counter = counter+1 + end + dt.print("tag \""..tag.."\" attached to "..counter.." images") end --- quicktag module - +-- quicktag module elements local tagentries = {} for j=1,qnr do tagentries[#tagentries+1] = dt.new_widget("entry") { - text = "qtest", - placeholder = "placeholder", + text = quicktag_table[j], + placeholder = "your tag "..j, is_password = true, editable = true, - tooltip = "Tooltip Text", - reset_callback = function(self) self.text = "test" end + tooltip = "enter your tag here", + -- would be nice if the tags gets autosaved to the preferences? + -- reset_callback = } end -local label = dt.new_widget("label") -label.label = "MyLabel" -- This is an alternative way to the "{}" syntax to set a property ---end -local button_tab = {} +local button = {} for j=1,qnr do - button_tab[#button_tab+1] = dt.new_widget("button") { - label = "tag "..j, - clicked_callback = function () tagattach(tostring(tagentries[j].text)) end} + button[#button+1] = dt.new_widget("button") { + label = "apply tag "..j, + clicked_callback = function() tagattach(tostring(tagentries[j].text)) end} end +-- back UI elements in a table +-- thanks to wpferguson for the hint +local widget_table = {} + +for i=1,qnr do + widget_table[#widget_table + 1] = tagentries[i] + widget_table[#widget_table + 1] = button[i] +end + +local dump_to_preferences = dt.new_widget("button") { + label = "save taglist", + tooltip = "update the taglist in the preferences", + clicked_callback = function() + for j=1,qnr do + dt.preferences.write("quickTag", "quicktag"..j, "string", tagentries[j].text) + end + end} + +-- add to dump button to widget_table +widget_table[#widget_table + 1] = dt.new_widget("separator"){} +widget_table[#widget_table + 1] = dump_to_preferences + + --create modul static. it would be nice to place button and entry side by side dt.register_lib( @@ -110,27 +160,17 @@ dt.register_lib( "quick tag", -- name true, -- expandable false, -- resetable - {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 490}}, -- containers + {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 490}}, dt.new_widget("box"){ orientation = "vertical", - button_tab[1], - tagentries[1], - button_tab[2], - tagentries[2], - button_tab[3], - tagentries[3], - button_tab[4], - tagentries[4], - button_tab[5], - tagentries[5]}, + table.unpack(widget_table), + + }, nil,-- view_enter nil -- view_leave ) -print(tostring(tagentries.text)) - ---local testtag = "qtest" -- create shortcuts for i=1,qnr do dt.register_event("shortcut", @@ -139,4 +179,4 @@ for i=1,qnr do end -- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua --- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on; \ No newline at end of file +-- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on; From ae8727ad96a26b5c64efa2cf61e36215caca42bb Mon Sep 17 00:00:00 2001 From: chrik5 Date: Sun, 9 Oct 2016 14:44:44 +0200 Subject: [PATCH 03/21] Mark module quicktag as add API 3 compatible --- contrib/quicktag.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 4423e11..6176d91 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -42,7 +42,7 @@ TODO local dt = require "darktable" -dt.configuration.check_version(...,{4,0,0}) +dt.configuration.check_version(...,{3,0,0},{4,0,0}) -- register number of quicktags dt.preferences.register("quickTag", From 1e0424a83f59fb146f184fbb3ffda3e3538b9edd Mon Sep 17 00:00:00 2001 From: chrik5 Date: Tue, 27 Dec 2016 15:28:43 +0100 Subject: [PATCH 04/21] quicktag module: place entry field and buttons side-by-side, button labels are now the quicktags --- contrib/quicktag.lua | 51 ++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 6176d91..aabbbd5 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -42,6 +42,8 @@ TODO local dt = require "darktable" +local debug = require "darktable.debug" + dt.configuration.check_version(...,{3,0,0},{4,0,0}) -- register number of quicktags @@ -52,7 +54,7 @@ dt.preferences.register("quickTag", "number of quick tag fields from 2 to 10 - needs a restart", -- tooltip 3, -- default 2, -- min - 10) + 10) local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") @@ -65,19 +67,23 @@ for j=1,qnr do "please create the tags before in the tagging module", -- tooltip "" -- default ) -end + end -- get quicktags from the preferences local quicktag_table = {} -for j=1,qnr do - quicktag_table[j] = dt.preferences.read("quickTag", "quicktag"..j, "string") -end +local function read_pref_tags() + for j=1,qnr do + quicktag_table[j] = dt.preferences.read("quickTag", "quicktag"..j, "string") + end + end + -- quicktag function to attach tags -local function tagattach(tag) - if tag == nil then +local function tagattach(tag,qtagnr) + if tag == "" then + dt.print("quicktag "..qtagnr.." empty, please set a tag") return true end @@ -105,9 +111,13 @@ local function tagattach(tag) end --- quicktag module elements +-- create quicktag module elements + local tagentries = {} +-- read tags from preferences for initialization +read_pref_tags() + for j=1,qnr do tagentries[#tagentries+1] = dt.new_widget("entry") { @@ -124,19 +134,31 @@ end local button = {} +-- function to create buttons with tags as lables for j=1,qnr do - button[#button+1] = dt.new_widget("button") { - label = "apply tag "..j, - clicked_callback = function() tagattach(tostring(tagentries[j].text)) end} -end + button[#button+1] = dt.new_widget("button") { + label = j..": "..quicktag_table[j], + clicked_callback = function() tagattach(tostring(tagentries[j].text),j) end} + end + +local function update_buttons_lables() + read_pref_tags() + for i=1,qnr do + button[i].label = i..": "..quicktag_table[i] + end + end + -- back UI elements in a table -- thanks to wpferguson for the hint local widget_table = {} + for i=1,qnr do - widget_table[#widget_table + 1] = tagentries[i] - widget_table[#widget_table + 1] = button[i] + widget_table[#widget_table + 1] = dt.new_widget ("box") { + orientation = "horizontal", + tagentries[i], + button[i]} end local dump_to_preferences = dt.new_widget("button") { @@ -146,6 +168,7 @@ local dump_to_preferences = dt.new_widget("button") { for j=1,qnr do dt.preferences.write("quickTag", "quicktag"..j, "string", tagentries[j].text) end + update_buttons_lables() end} -- add to dump button to widget_table From 91c62e208b63a7f1a473c6a85c0d11f9d0526c29 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Wed, 28 Dec 2016 12:32:05 +0100 Subject: [PATCH 05/21] quicktag: rework of modul layout and behaviour * long tags are stil a problem * maybe two colums of tag buttons saves high, if someone wants to have many tags * option to create non existing tags will be nice I guess --- contrib/quicktag.lua | 93 ++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index aabbbd5..6dc4e99 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -32,12 +32,13 @@ USAGE * set the shortcuts and prefered tags your in the preferences dialog * use the shortcuts or the buttons to attach the tags to selected images - * change the entries as needed - * use the "save taglist" button to update your preferences + * use the "set quicktag" button to update your quicktag and preferences TODO * enhance button and entry layout in the module - * autosave tag entries + * option to add non existing tags + * abbrevate button labels + * maybe two colums of buttons ]] @@ -112,25 +113,9 @@ end -- create quicktag module elements - -local tagentries = {} - -- read tags from preferences for initialization read_pref_tags() -for j=1,qnr do - tagentries[#tagentries+1] = dt.new_widget("entry") - { - text = quicktag_table[j], - placeholder = "your tag "..j, - is_password = true, - editable = true, - tooltip = "enter your tag here", - -- would be nice if the tags gets autosaved to the preferences? - -- reset_callback = - } -end - local button = {} @@ -138,42 +123,64 @@ local button = {} for j=1,qnr do button[#button+1] = dt.new_widget("button") { label = j..": "..quicktag_table[j], - clicked_callback = function() tagattach(tostring(tagentries[j].text),j) end} + clicked_callback = function() tagattach(tostring(quicktag_table[j]),j) end} end -local function update_buttons_lables() - read_pref_tags() - for i=1,qnr do - button[i].label = i..": "..quicktag_table[i] - end + +local old_quicktag = dt.new_widget("combobox"){ + label = "old quicktag:", + tooltip = "select the quicktag to replace" +} + +local function update_quicktag_list() + -- read_pref_tags() + for j=1,qnr do + button[j].label = j..": "..quicktag_table[j] + old_quicktag[j] = j..": "..quicktag_table[j] end +end + +update_quicktag_list() + +local new_quicktag = dt.new_widget("entry"){ + text = "", + placeholder = "new quicktag ", + is_password = true, + editable = true, + tooltip = "enter your tag here" +} + +local set_quicktag_button = dt.new_widget("button") { + label = "set quicktag", + clicked_callback = function() + local old_tag = quicktag_table[old_quicktag.selected] + quicktag_table[old_quicktag.selected] = new_quicktag.text + dt.preferences.write("quickTag", "quicktag"..old_quicktag.selected, "string", new_quicktag.text) + dt.print("quicktag \""..old_tag.."\" replaced by \""..new_quicktag.text.."\"") + update_quicktag_list() + new_quicktag.text = "" + end, +} + +local new_qt_widget = dt.new_widget ("box") { + orientation = "horizontal", + dt.new_widget("label") { label = "new quicktag" }, + new_quicktag, + set_quicktag_button +} -- back UI elements in a table -- thanks to wpferguson for the hint local widget_table = {} - for i=1,qnr do - widget_table[#widget_table + 1] = dt.new_widget ("box") { - orientation = "horizontal", - tagentries[i], - button[i]} + widget_table[#widget_table + 1] = button[i] end -local dump_to_preferences = dt.new_widget("button") { - label = "save taglist", - tooltip = "update the taglist in the preferences", - clicked_callback = function() - for j=1,qnr do - dt.preferences.write("quickTag", "quicktag"..j, "string", tagentries[j].text) - end - update_buttons_lables() - end} - --- add to dump button to widget_table widget_table[#widget_table + 1] = dt.new_widget("separator"){} -widget_table[#widget_table + 1] = dump_to_preferences +widget_table[#widget_table + 1] = old_quicktag +widget_table[#widget_table + 1] = new_qt_widget @@ -197,7 +204,7 @@ dt.register_lib( -- create shortcuts for i=1,qnr do dt.register_event("shortcut", - function(event, shortcut) tagattach(tostring(tagentries[i].text)) end, + function(event, shortcut) tagattach(tostring(quicktag_table[i])) end, "quick tag "..i) end From 0590beb876bbccf245886033c638c5006469ea75 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Tue, 24 Jan 2017 20:56:07 +0100 Subject: [PATCH 06/21] quicktag - add tags if they not exist in the taglist of darktable --- contrib/quicktag.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 6dc4e99..3ab7ded 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -36,7 +36,6 @@ USAGE TODO * enhance button and entry layout in the module - * option to add non existing tags * abbrevate button labels * maybe two colums of buttons ]] @@ -89,10 +88,11 @@ local function tagattach(tag,qtagnr) end local tagnr = dt.tags.find(tag) - + +--create tag if it does not exist if tagnr == nil then - dt.print("quick tag \""..tag.."\" not found in your taglist, please add it first!") - return true + dt.tags.create(tag) + tagnr = dt.tags.find(tag) end local sel_images = dt.gui.action_images From e389420f074b52f9c46414a5ed0a118dcec503f1 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Tue, 24 Jan 2017 21:02:53 +0100 Subject: [PATCH 07/21] quicktag - make API 5.0.0 compatible --- contrib/quicktag.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 3ab7ded..d7eb5d0 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -44,7 +44,7 @@ TODO local dt = require "darktable" local debug = require "darktable.debug" -dt.configuration.check_version(...,{3,0,0},{4,0,0}) +dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0}) -- register number of quicktags dt.preferences.register("quickTag", From c887a0d2b5834250c1c095e421e6f4ffbd4a7457 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Thu, 16 Feb 2017 16:13:55 +0100 Subject: [PATCH 08/21] [quicktag] remove tag list from preferences dialog, because the tags can be set from the modul now --- contrib/quicktag.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index d7eb5d0..99379b8 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -59,7 +59,8 @@ dt.preferences.register("quickTag", local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") -- set quicktag in the preferences -for j=1,qnr do +-- remove this for now, because the taglist can be set from within the modul now +--[[for j=1,qnr do dt.preferences.register("quickTag", "quicktag"..j, "string", -- type @@ -68,6 +69,7 @@ for j=1,qnr do "" -- default ) end +]] -- get quicktags from the preferences local quicktag_table = {} From d1f34ec1362bf845cd0c3b42a752dd2264086ef1 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Thu, 16 Feb 2017 16:18:19 +0100 Subject: [PATCH 09/21] [quicktag] fix and update some comments --- .../de_DE/LC_MESSAGES/copy_attach_detach_tags.mo | Bin 0 -> 1543 bytes contrib/quicktag.lua | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo diff --git a/contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo b/contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo new file mode 100644 index 0000000000000000000000000000000000000000..0db9f369002fdf8a1a9a7aa0f9738fb46f99ac49 GIT binary patch literal 1543 zcma)*y>A>v7{&((gd72s2!s$wya^x@C9~|>1gteimK`Uu;)GK;AWApheQ$TTy_wVO zoG*4mgG56K4H8`n3hGpd0{;W4DN@tYQS!|0Ud|y%WTe^Od_3>h?97AH$9@oKFQdPS z{yq9@=qI1T2dxBO1vPjP{2Dw3{sO)M{sz7X{s9vBCm4L4cv^@a_&WF&_zoD>FN0^n z0eBLefp3G~fWgnt;C=YG2Zp%c9us06{0Te_J^;^xe}TdNm1l)`4?F_~`)%+g@JsMr zaM-PX2L|1b-Te1%ejg0_zd?j;+6x^6Le8ND-w4^XmNyH>ee^qu_*`OEEGe!;HR)}*vERc$pi zQNHZ;KOM+T$I4? z#7ofa;6UWSDN|R2&S2GIULugTRlo`BF4$m)48%ok;mlU~P&ievKTk8mDxX z-8dMGa+W$-F*4_Mj3eucg*K&}d)K$GZ!L;UqPVwdjc0>g_9rOH^Bw;_&QF_F%1Y&G z_G_OHuE>>zF62C9C$~&yb8U*0R(7@T-I76h}n8lOXvj( Date: Fri, 17 Feb 2017 10:25:06 +0100 Subject: [PATCH 10/21] [quicktag] update and fix description --- contrib/quicktag.lua | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index e153ce7..36c2bac 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -1,6 +1,6 @@ --[[ This file is part of darktable, - Copyright (C) 2016 by Christian Kanzian + Copyright (C) 2017 by Christian Kanzian Thanks to Copyright (C) 2016 Bill Ferguson @@ -20,25 +20,29 @@ ]] --[[ - QUICKTAGS - This script that will create shortcuts, a list of tag entries in the preferences and - add a modul in lighttable mode to quickly attach tags. If the tags do not exist in your databse, - you have to create them in the tagging module. +QUICKTAG + For faster attaching your favorite tags, the script adds shortcuts and + the module "quicktag" in lighttable mode with a changeable number of buttons. + To each button a tag can be assigned. If the tags do not exist in your database, + they are added to the database once they get the first time attached to an image. - INSTALATION + The number of buttons/shortcuts can be changed in the lua preferences. + Changes in the number require a restart of darktable. + +INSTALATION * copy this file in $CONFIGDIR/lua/ where CONFIGDIR is your darktable configuration directory * add the following line in the file $CONFIGDIR/luarc require "quicktag" USAGE - * set the shortcuts and prefered tags your in the preferences dialog - * use the shortcuts or the buttons to attach the tags to selected images - * use the "set quicktag" button to update your quicktag and preferences - + * set the number of quicktags between 2 and 10 in the preferences dialog and restart darktable + * if wanted set the shortcuts in the preferences dialog + * to add or change a quicktag, first select the old tag with the combobox "old quicktag", + enter a new tag in the "new quicktag" filed and press "set quicktag" + * use a shortcut or button to attach the tag to selected images + TODO - * enhance button and entry layout in the module - * abbrevate button labels - * maybe two colums of buttons - ]] + * abbrevate button labels + ]] local dt = require "darktable" From 5af200a29de401ca6adfe57095b92f8654b8e961 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Fri, 17 Feb 2017 10:32:06 +0100 Subject: [PATCH 11/21] [quicktag] don't allow to set empty tags --- contrib/quicktag.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 36c2bac..8363eea 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -160,11 +160,15 @@ local set_quicktag_button = dt.new_widget("button") { label = "set quicktag", clicked_callback = function() local old_tag = quicktag_table[old_quicktag.selected] - quicktag_table[old_quicktag.selected] = new_quicktag.text - dt.preferences.write("quickTag", "quicktag"..old_quicktag.selected, "string", new_quicktag.text) - dt.print("quicktag \""..old_tag.."\" replaced by \""..new_quicktag.text.."\"") - update_quicktag_list() - new_quicktag.text = "" + if new_quicktag.text == "" then + dt.print("new quicktag is empty!") + else + quicktag_table[old_quicktag.selected] = new_quicktag.text + dt.preferences.write("quickTag", "quicktag"..old_quicktag.selected, "string", new_quicktag.text) + dt.print("quicktag \""..old_tag.."\" replaced by \""..new_quicktag.text.."\"") + update_quicktag_list() + new_quicktag.text = "" + end end, } From 61687677668c236c65ee6dbed3ea6e3216a18eac Mon Sep 17 00:00:00 2001 From: chrik5 Date: Fri, 17 Feb 2017 13:36:49 +0100 Subject: [PATCH 12/21] remove accidently added *.mo file --- .../de_DE/LC_MESSAGES/copy_attach_detach_tags.mo | Bin 1543 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo diff --git a/contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo b/contrib/de_DE/LC_MESSAGES/copy_attach_detach_tags.mo deleted file mode 100644 index 0db9f369002fdf8a1a9a7aa0f9738fb46f99ac49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1543 zcma)*y>A>v7{&((gd72s2!s$wya^x@C9~|>1gteimK`Uu;)GK;AWApheQ$TTy_wVO zoG*4mgG56K4H8`n3hGpd0{;W4DN@tYQS!|0Ud|y%WTe^Od_3>h?97AH$9@oKFQdPS z{yq9@=qI1T2dxBO1vPjP{2Dw3{sO)M{sz7X{s9vBCm4L4cv^@a_&WF&_zoD>FN0^n z0eBLefp3G~fWgnt;C=YG2Zp%c9us06{0Te_J^;^xe}TdNm1l)`4?F_~`)%+g@JsMr zaM-PX2L|1b-Te1%ejg0_zd?j;+6x^6Le8ND-w4^XmNyH>ee^qu_*`OEEGe!;HR)}*vERc$pi zQNHZ;KOM+T$I4? z#7ofa;6UWSDN|R2&S2GIULugTRlo`BF4$m)48%ok;mlU~P&ievKTk8mDxX z-8dMGa+W$-F*4_Mj3eucg*K&}d)K$GZ!L;UqPVwdjc0>g_9rOH^Bw;_&QF_F%1Y&G z_G_OHuE>>zF62C9C$~&yb8U*0R(7@T-I76h}n8lOXvj( Date: Fri, 17 Feb 2017 13:40:39 +0100 Subject: [PATCH 13/21] [quicktag] remove dead code --- contrib/quicktag.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 8363eea..0fe89d1 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -62,19 +62,6 @@ dt.preferences.register("quickTag", local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") --- set quicktag in the preferences --- remove this for now, because the taglist can be set from within the modul now ---[[for j=1,qnr do - dt.preferences.register("quickTag", - "quicktag"..j, - "string", -- type - "quick tag "..j, -- label - "please create the tags before in the tagging module", -- tooltip - "" -- default - ) - end -]] - -- get quicktags from the preferences local quicktag_table = {} From 5021e512b98a843a90d96bade528da9ecf213e56 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Fri, 17 Feb 2017 16:21:23 +0100 Subject: [PATCH 14/21] [quicktag] make script tranlateable --- contrib/quicktag.lua | 46 ++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 0fe89d1..cf2315e 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -48,17 +48,29 @@ TODO local dt = require "darktable" local debug = require "darktable.debug" + +local gettext = dt.gettext + dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0}) +-- Tell gettext where to find the .mo file translating messages for a particular domain +gettext.bindtextdomain("quicktag",dt.configuration.config_dir.."/lua/") + +local function _(msgid) + return gettext.dgettext("quicktag", msgid) +end + + + -- register number of quicktags dt.preferences.register("quickTag", "quickTagnumber", "integer", -- type - "number of quick tag fields", -- label - "number of quick tag fields from 2 to 10 - needs a restart", -- tooltip - 3, -- default + _("number of quicktag fields"), -- label + _("may range from 2 to 20 - needs a restart"), -- tooltip + 5, -- default 2, -- min - 10) + 20) local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") @@ -76,7 +88,7 @@ local function read_pref_tags() -- quicktag function to attach tags local function tagattach(tag,qtagnr) if tag == "" then - dt.print("quicktag "..qtagnr.." empty, please set a tag") + dt.print(_("quicktag").." "..qtagnr.." ".. _("empty, please set a tag")) return true end @@ -91,7 +103,7 @@ local function tagattach(tag,qtagnr) local sel_images = dt.gui.action_images if next(sel_images) == nil then - dt.print("no images selected") + dt.print(_("no images selected")) return true end @@ -101,7 +113,7 @@ local function tagattach(tag,qtagnr) dt.tags.attach(tagnr,image) counter = counter+1 end - dt.print("tag \""..tag.."\" attached to "..counter.." images") + dt.print(_("tag").." \""..tag.."\" ".._("attached to").." "..counter.." ".._("image(s)")) end @@ -121,8 +133,8 @@ for j=1,qnr do local old_quicktag = dt.new_widget("combobox"){ - label = "old quicktag:", - tooltip = "select the quicktag to replace" + label = _("old quicktag"), + tooltip = _("select the quicktag to replace") } local function update_quicktag_list() @@ -137,22 +149,22 @@ update_quicktag_list() local new_quicktag = dt.new_widget("entry"){ text = "", - placeholder = "new quicktag ", + placeholder = _("new quicktag"), is_password = true, editable = true, - tooltip = "enter your tag here" + tooltip = _("enter your tag here") } local set_quicktag_button = dt.new_widget("button") { - label = "set quicktag", + label = _("set quicktag"), clicked_callback = function() local old_tag = quicktag_table[old_quicktag.selected] if new_quicktag.text == "" then - dt.print("new quicktag is empty!") + dt.print(_("new quicktag is empty!")) else quicktag_table[old_quicktag.selected] = new_quicktag.text dt.preferences.write("quickTag", "quicktag"..old_quicktag.selected, "string", new_quicktag.text) - dt.print("quicktag \""..old_tag.."\" replaced by \""..new_quicktag.text.."\"") + dt.print(_("quicktag") .." \""..old_tag.."\" ".._("replaced by").." \""..new_quicktag.text.."\"") update_quicktag_list() new_quicktag.text = "" end @@ -161,7 +173,7 @@ local set_quicktag_button = dt.new_widget("button") { local new_qt_widget = dt.new_widget ("box") { orientation = "horizontal", - dt.new_widget("label") { label = "new quicktag" }, + dt.new_widget("label") { label = _("new quicktag") }, new_quicktag, set_quicktag_button } @@ -183,7 +195,7 @@ widget_table[#widget_table + 1] = new_qt_widget --create module dt.register_lib( "quicktag", -- Module name - "quick tag", -- name + "quicktag", -- name true, -- expandable false, -- resetable {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 490}}, @@ -201,7 +213,7 @@ dt.register_lib( for i=1,qnr do dt.register_event("shortcut", function(event, shortcut) tagattach(tostring(quicktag_table[i])) end, - "quick tag "..i) + _("quicktag").." "..i) end -- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua From b38e2964caede04e4a11565e9bb1a40022d95af7 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Fri, 17 Feb 2017 16:22:13 +0100 Subject: [PATCH 15/21] [quicktag] add German translation --- contrib/de_DE/LC_MESSAGES/quicktag.po | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 contrib/de_DE/LC_MESSAGES/quicktag.po diff --git a/contrib/de_DE/LC_MESSAGES/quicktag.po b/contrib/de_DE/LC_MESSAGES/quicktag.po new file mode 100644 index 0000000..aad167d --- /dev/null +++ b/contrib/de_DE/LC_MESSAGES/quicktag.po @@ -0,0 +1,79 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Christian Kanzian , 2017. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-17 14:32+0100\n" +"PO-Revision-Date: 2017-02-17 14:37+0100\n" +"Last-Translator: Christian Kanzian \n" +"Language-Team: German <>\n" +"Language: de_AT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 2.0\n" + +#: quicktag.lua:69 +msgid "number of quicktag fields" +msgstr "Anzahl von quicktag Feldern" + +#: quicktag.lua:70 +msgid "may range from 2 to 20 - needs a restart" +msgstr "Bereich von 2 bis 20 möglich - Neustart erforderlich" + +#: quicktag.lua:91 quicktag.lua:167 quicktag.lua:216 +msgid "quicktag" +msgstr "" + +#: quicktag.lua:91 +msgid "empty, please set a tag" +msgstr "Leer, bitte Tag eingeben" + +#: quicktag.lua:106 +msgid "no images selected" +msgstr "keine Bilder ausgewählt" + +#: quicktag.lua:116 +msgid "tag" +msgstr "Tag" + +#: quicktag.lua:116 +msgid "attached to" +msgstr "angehängt an" + +#: quicktag.lua:116 +msgid "image(s)" +msgstr "Bilder(n)" + +#: quicktag.lua:136 +msgid "old quicktag" +msgstr "Alter quicktag" + +#: quicktag.lua:137 +msgid "select the quicktag to replace" +msgstr "Wähle den quicktag der ersetzt werden soll" + +#: quicktag.lua:152 quicktag.lua:176 +msgid "new quicktag" +msgstr "Neuer quicktag" + +#: quicktag.lua:155 +msgid "enter your tag here" +msgstr "bitte Tag hier eingeben" + +#: quicktag.lua:159 +msgid "set quicktag" +msgstr "Setze Tag" + +#: quicktag.lua:163 +msgid "new quicktag is empty!" +msgstr "Neuer Tag ist leer!" + +#: quicktag.lua:167 +msgid "replaced by" +msgstr "ersetzt durch" + From b4658ddf76793a72bba89d7d13d5fd5e869f6cf3 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 12:00:45 +0100 Subject: [PATCH 16/21] [quicktag] abbrevate tag button labels to a configurable length --- contrib/quicktag.lua | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index cf2315e..4ff66a1 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -60,11 +60,23 @@ local function _(msgid) return gettext.dgettext("quicktag", msgid) end +-- maximum length of button labels +dt.preferences.register("quickTag", + "labellength", + "integer", -- type + _("max length of button labels"), -- label + _("may range from 15 to 60 - needs a restart"), -- tooltip + 25, -- default + 15, -- min + 60) + +local max_label_length = dt.preferences.read("quickTag", "labellength", "integer") + -- register number of quicktags -dt.preferences.register("quickTag", - "quickTagnumber", +dt.preferences.register("quickTag", + "quickTagnumber", "integer", -- type _("number of quicktag fields"), -- label _("may range from 2 to 20 - needs a restart"), -- tooltip @@ -74,9 +86,12 @@ dt.preferences.register("quickTag", local qnr = dt.preferences.read("quickTag", "quickTagnumber", "integer") + + -- get quicktags from the preferences local quicktag_table = {} + local function read_pref_tags() for j=1,qnr do quicktag_table[j] = dt.preferences.read("quickTag", "quicktag"..j, "string") @@ -84,6 +99,22 @@ local function read_pref_tags() end +local quicktag_label = {} + + +local function abbrevate_tags(t) + for i=1,qnr do + local taglength = string.len(t[i]) + if taglength > max_label_length then + local max_2 = math.floor(max_label_length/2) + quicktag_label[i] = string.sub(t[i],0,max_2).."..."..string.sub(t[i],taglength - max_2) + else + quicktag_label[i] = t[i] + end + print(quicktag_label[i]) + end +end + -- quicktag function to attach tags local function tagattach(tag,qtagnr) @@ -120,6 +151,7 @@ end -- create quicktag module elements -- read tags from preferences for initialization read_pref_tags() +abbrevate_tags(quicktag_table) local button = {} @@ -138,9 +170,10 @@ local old_quicktag = dt.new_widget("combobox"){ } local function update_quicktag_list() - -- read_pref_tags() + -- abrevate long tags for the labels + abbrevate_tags(quicktag_table) for j=1,qnr do - button[j].label = j..": "..quicktag_table[j] + button[j].label = j..": "..quicktag_label[j] old_quicktag[j] = j..": "..quicktag_table[j] end end From 0ebc885eb1ff0268409ca1254dfb7febcc2fc3c9 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 12:11:06 +0100 Subject: [PATCH 17/21] [quicktag] update German translation --- contrib/de_DE/LC_MESSAGES/quicktag.po | 42 ++++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/contrib/de_DE/LC_MESSAGES/quicktag.po b/contrib/de_DE/LC_MESSAGES/quicktag.po index aad167d..92630f9 100644 --- a/contrib/de_DE/LC_MESSAGES/quicktag.po +++ b/contrib/de_DE/LC_MESSAGES/quicktag.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-17 14:32+0100\n" -"PO-Revision-Date: 2017-02-17 14:37+0100\n" +"POT-Creation-Date: 2017-02-20 12:05+0100\n" +"PO-Revision-Date: 2017-02-20 12:09+0100\n" "Last-Translator: Christian Kanzian \n" "Language-Team: German <>\n" "Language: de_AT\n" @@ -17,63 +17,71 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 2.0\n" -#: quicktag.lua:69 +#: quicktag.lua:67 +msgid "max length of button labels" +msgstr "Max. Länge der Schaltflächen-Beschriftung" + +#: quicktag.lua:68 +msgid "may range from 15 to 60 - needs a restart" +msgstr "Bereich von 15 bis 60 möglich - Neustart erforderlich" + +#: quicktag.lua:81 msgid "number of quicktag fields" msgstr "Anzahl von quicktag Feldern" -#: quicktag.lua:70 +#: quicktag.lua:82 msgid "may range from 2 to 20 - needs a restart" msgstr "Bereich von 2 bis 20 möglich - Neustart erforderlich" -#: quicktag.lua:91 quicktag.lua:167 quicktag.lua:216 +#: quicktag.lua:122 quicktag.lua:200 quicktag.lua:249 msgid "quicktag" msgstr "" -#: quicktag.lua:91 +#: quicktag.lua:122 msgid "empty, please set a tag" msgstr "Leer, bitte Tag eingeben" -#: quicktag.lua:106 +#: quicktag.lua:137 msgid "no images selected" msgstr "keine Bilder ausgewählt" -#: quicktag.lua:116 +#: quicktag.lua:147 msgid "tag" msgstr "Tag" -#: quicktag.lua:116 +#: quicktag.lua:147 msgid "attached to" msgstr "angehängt an" -#: quicktag.lua:116 +#: quicktag.lua:147 msgid "image(s)" msgstr "Bilder(n)" -#: quicktag.lua:136 +#: quicktag.lua:168 msgid "old quicktag" msgstr "Alter quicktag" -#: quicktag.lua:137 +#: quicktag.lua:169 msgid "select the quicktag to replace" msgstr "Wähle den quicktag der ersetzt werden soll" -#: quicktag.lua:152 quicktag.lua:176 +#: quicktag.lua:185 quicktag.lua:209 msgid "new quicktag" msgstr "Neuer quicktag" -#: quicktag.lua:155 +#: quicktag.lua:188 msgid "enter your tag here" msgstr "bitte Tag hier eingeben" -#: quicktag.lua:159 +#: quicktag.lua:192 msgid "set quicktag" msgstr "Setze Tag" -#: quicktag.lua:163 +#: quicktag.lua:196 msgid "new quicktag is empty!" msgstr "Neuer Tag ist leer!" -#: quicktag.lua:167 +#: quicktag.lua:200 msgid "replaced by" msgstr "ersetzt durch" From e4b189a06e3345deeb8250f9300bb45a6f28bb3d Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 12:11:52 +0100 Subject: [PATCH 18/21] [quicktag] update TODO list --- contrib/quicktag.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 4ff66a1..c5bf01f 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -39,10 +39,7 @@ USAGE * to add or change a quicktag, first select the old tag with the combobox "old quicktag", enter a new tag in the "new quicktag" filed and press "set quicktag" * use a shortcut or button to attach the tag to selected images - -TODO - * abbrevate button labels - ]] +]] local dt = require "darktable" @@ -64,7 +61,7 @@ end dt.preferences.register("quickTag", "labellength", "integer", -- type - _("max length of button labels"), -- label + _("max. length of button labels"), -- label _("may range from 15 to 60 - needs a restart"), -- tooltip 25, -- default 15, -- min From 4c34113f78cd35217376290791223bbcf8af8aef Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 15:42:48 +0100 Subject: [PATCH 19/21] [quicktag] use string.format in messages for better translation --- contrib/quicktag.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index c5bf01f..c38f43c 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -116,7 +116,7 @@ end -- quicktag function to attach tags local function tagattach(tag,qtagnr) if tag == "" then - dt.print(_("quicktag").." "..qtagnr.." ".. _("empty, please set a tag")) + dt.print(string.format(_("quicktag %i is empty, please set a tag"), qtagnr)) return true end @@ -141,7 +141,7 @@ local function tagattach(tag,qtagnr) dt.tags.attach(tagnr,image) counter = counter+1 end - dt.print(_("tag").." \""..tag.."\" ".._("attached to").." "..counter.." ".._("image(s)")) + dt.print(string.format(_("tag \"%s\" attached to %i image(s)"), tag, counter)) end @@ -194,7 +194,7 @@ local set_quicktag_button = dt.new_widget("button") { else quicktag_table[old_quicktag.selected] = new_quicktag.text dt.preferences.write("quickTag", "quicktag"..old_quicktag.selected, "string", new_quicktag.text) - dt.print(_("quicktag") .." \""..old_tag.."\" ".._("replaced by").." \""..new_quicktag.text.."\"") + dt.print(string.format(_("quicktag \"%s\" replaced by \"%s\""), old_tag, new_quicktag.text)) update_quicktag_list() new_quicktag.text = "" end @@ -243,7 +243,7 @@ dt.register_lib( for i=1,qnr do dt.register_event("shortcut", function(event, shortcut) tagattach(tostring(quicktag_table[i])) end, - _("quicktag").." "..i) + string.format(_("quicktag %i"),i)) end -- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua From 93796bf4a83b00d1643ccadd8dd603d30ec4446a Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 17:57:53 +0100 Subject: [PATCH 20/21] [quicktag] fix German translation and remove print output --- contrib/de_DE/LC_MESSAGES/quicktag.po | 75 +++++++++++++-------------- contrib/quicktag.lua | 2 +- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/contrib/de_DE/LC_MESSAGES/quicktag.po b/contrib/de_DE/LC_MESSAGES/quicktag.po index 92630f9..0562c05 100644 --- a/contrib/de_DE/LC_MESSAGES/quicktag.po +++ b/contrib/de_DE/LC_MESSAGES/quicktag.po @@ -6,82 +6,79 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-20 12:05+0100\n" -"PO-Revision-Date: 2017-02-20 12:09+0100\n" +"POT-Creation-Date: 2017-02-20 17:38+0100\n" +"PO-Revision-Date: 2017-02-20 17:50+0100\n" "Last-Translator: Christian Kanzian \n" -"Language-Team: German <>\n" -"Language: de_AT\n" +"Language-Team: German \n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 2.0\n" +"X-Generator: Lokalize 1.5\n" -#: quicktag.lua:67 -msgid "max length of button labels" +#: quicktag.lua:64 +msgid "max. length of button labels" msgstr "Max. Länge der Schaltflächen-Beschriftung" -#: quicktag.lua:68 +#: quicktag.lua:65 msgid "may range from 15 to 60 - needs a restart" msgstr "Bereich von 15 bis 60 möglich - Neustart erforderlich" -#: quicktag.lua:81 +#: quicktag.lua:78 msgid "number of quicktag fields" msgstr "Anzahl von quicktag Feldern" -#: quicktag.lua:82 +#: quicktag.lua:79 msgid "may range from 2 to 20 - needs a restart" msgstr "Bereich von 2 bis 20 möglich - Neustart erforderlich" -#: quicktag.lua:122 quicktag.lua:200 quicktag.lua:249 -msgid "quicktag" -msgstr "" +#: quicktag.lua:119 +#, lua-format +msgid "quicktag %i is empty, please set a tag" +msgstr "quicktag %i ist leer - bitte Tag eingeben" -#: quicktag.lua:122 -msgid "empty, please set a tag" -msgstr "Leer, bitte Tag eingeben" - -#: quicktag.lua:137 +#: quicktag.lua:134 msgid "no images selected" msgstr "keine Bilder ausgewählt" -#: quicktag.lua:147 -msgid "tag" -msgstr "Tag" +#: quicktag.lua:144 +#, lua-format +msgid "tag \"%s\" attached to %i image(s)" +msgstr "Tag \"%s\" an %i Bild(er) angehängt" -#: quicktag.lua:147 -msgid "attached to" -msgstr "angehängt an" - -#: quicktag.lua:147 -msgid "image(s)" -msgstr "Bilder(n)" - -#: quicktag.lua:168 +#: quicktag.lua:165 msgid "old quicktag" msgstr "Alter quicktag" -#: quicktag.lua:169 +#: quicktag.lua:166 msgid "select the quicktag to replace" msgstr "Wähle den quicktag der ersetzt werden soll" -#: quicktag.lua:185 quicktag.lua:209 +#: quicktag.lua:182 quicktag.lua:206 msgid "new quicktag" msgstr "Neuer quicktag" -#: quicktag.lua:188 +#: quicktag.lua:185 msgid "enter your tag here" -msgstr "bitte Tag hier eingeben" +msgstr "Bitte Tag hier eingeben" -#: quicktag.lua:192 +#: quicktag.lua:189 msgid "set quicktag" msgstr "Setze Tag" -#: quicktag.lua:196 +#: quicktag.lua:193 msgid "new quicktag is empty!" msgstr "Neuer Tag ist leer!" -#: quicktag.lua:200 -msgid "replaced by" -msgstr "ersetzt durch" +#: quicktag.lua:197 +#, lua-format +msgid "quicktag \"%s\" replaced by \"%s\"" +msgstr "quicktag \"%s\" ersetzt durch \"%s\" " + +#: quicktag.lua:246 +#, lua-format +msgid "quicktag %i" +msgstr "quicktag %i" + diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index c38f43c..5c86912 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -108,7 +108,7 @@ local function abbrevate_tags(t) else quicktag_label[i] = t[i] end - print(quicktag_label[i]) + -- print(quicktag_label[i]) end end From 81c5bb4d521bd148fcda017f80a0ea3515c40844 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Mon, 20 Feb 2017 18:00:59 +0100 Subject: [PATCH 21/21] [quicktag] update copyright --- contrib/quicktag.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 5c86912..13a0093 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -4,6 +4,7 @@ Thanks to Copyright (C) 2016 Bill Ferguson + Copyright (C) 2017 Tobias Jakobs This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by