Skip to content

Commit b4b8290

Browse files
committed
copy_attach_detach_tags make script translateable and added german translation by Holger Klemm
1 parent e76a883 commit b4b8290

File tree

2 files changed

+97
-15
lines changed

2 files changed

+97
-15
lines changed

contrib/copy_attach_detach_tags.lua

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--[[
22
This file is part of darktable,
3-
copyright 2014-2016 by Christian Kanzian.
3+
Copyright 2014-2016 by Christian Kanzian
4+
Copyright 2016 by Holger Klemm
45
56
This program is free software: you can redistribute it and/or modify
67
it under the terms of the GNU General Public License as published by
@@ -36,8 +37,17 @@ USAGE
3637
]]
3738

3839
local dt = require "darktable"
40+
local gettext = dt.gettext
3941
dt.configuration.check_version(...,{3,0,0},{4,0,0})
4042

43+
-- Tell gettext where to find the .mo file translating messages for a particular domain
44+
gettext.bindtextdomain("copy_attach_detach_tags",dt.configuration.config_dir.."/lua/")
45+
46+
local function _(msgid)
47+
return gettext.dgettext("copy_attach_detach_tags", msgid)
48+
end
49+
50+
4151
local image_tags = {}
4252

4353

@@ -71,7 +81,7 @@ local function mcopy_tags()
7181
end
7282
end
7383

74-
dt.print("Image tags copied ...")
84+
dt.print(_('Image tags copied ...'))
7585

7686
--create UI tag list
7787
local taglist = ""
@@ -93,7 +103,7 @@ local function mcopy_tags()
93103
local function attach_tags()
94104

95105
if next(image_tags) == nil then
96-
dt.print("No tags to attached, please copy tags first.")
106+
dt.print(_('No tags to attached, please copy tags first.'))
97107
return true
98108
end
99109

@@ -117,7 +127,7 @@ local function attach_tags()
117127
end
118128
end
119129
end
120-
dt.print("Tags attached ...")
130+
dt.print(_('Tags attached ...'))
121131
end
122132

123133
local function detach_tags()
@@ -133,37 +143,37 @@ local function detach_tags()
133143
end
134144
end
135145
end
136-
dt.print("Tags removed from image(s).")
146+
dt.print(_('Tags removed from image(s).'))
137147
end
138148

139149
local function replace_tags()
140150
detach_tags()
141151
attach_tags()
142-
dt.print("Tags replaced")
152+
dt.print(_('Tags replaced'))
143153
end
144154

145155
-- create modul Tagging addons
146156
taglist_label.reset_callback = mcopy_tags
147157

148158
-- create buttons and elements
149159
local mc_button = dt.new_widget("button") {
150-
label = "multi copy tags",
160+
label = _('multi copy tags'),
151161
clicked_callback = mcopy_tags}
152162

153163
local p_button = dt.new_widget("button") {
154-
label = "paste tags",
164+
label = _('paste tags'),
155165
clicked_callback = attach_tags}
156166

157167
local rep_button = dt.new_widget("button") {
158-
label = "replace tags",
168+
label = _('replace tags'),
159169
clicked_callback = replace_tags}
160170

161171
local rem_button = dt.new_widget("button") {
162-
label = "remove all tags",
172+
label = _('remove all tags'),
163173
clicked_callback = detach_tags}
164174

165175
local taglabel = dt.new_widget("label") {
166-
label = "tag clipboard",
176+
label = _('tag clipboard'),
167177
selectable = false,
168178
ellipsize = "middle",
169179
halign = "start"}
@@ -191,22 +201,22 @@ dt.register_lib("tagging_addon","Tagging addon",true,false,{
191201
-- shortcut for copy
192202
dt.register_event("shortcut",
193203
mcopy_tags,
194-
"copy tags from selected image(s)")
204+
_('copy tags from selected image(s)'))
195205

196206
-- shortcut for attach
197207
dt.register_event("shortcut",
198208
attach_tags,
199-
"paste tags to selected image(s)")
209+
_('paste tags to selected image(s)'))
200210

201211
-- shortcut for detaching tags
202212
dt.register_event("shortcut",
203213
detach_tags,
204-
"remove tags from selected image(s)")
214+
_('remove tags from selected image(s)'))
205215

206216
-- shortcut for replace tags
207217
dt.register_event("shortcut",
208218
replace_tags,
209-
"replace tags from selected image(s)")
219+
_('replace tags from selected image(s)'))
210220

211221
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua
212222
-- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: Lua image path\n"
4+
"POT-Creation-Date: 2016-01-07 20:33+0100\n"
5+
"PO-Revision-Date: 2016-01-07 21:32+0100\n"
6+
"Last-Translator: Holger Klemm\n"
7+
"Language-Team: \n"
8+
"Language: de\n"
9+
"MIME-Version: 1.0\n"
10+
"Content-Type: text/plain; charset=UTF-8\n"
11+
"Content-Transfer-Encoding: 8bit\n"
12+
"X-Generator: Poedit 1.8.4\n"
13+
"X-Poedit-Basepath: .\n"
14+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
15+
"X-Poedit-KeywordsList: \n"
16+
"X-Poedit-SearchPath-0: .\n"
17+
18+
#: copy_attach_detach_tags.lua:10
19+
msgid "Image tags copied ..."
20+
msgstr "Bild Tags kopiert ..."
21+
22+
#: copy_attach_detach_tags.lua:10
23+
msgid "No tags to attached, please copy tags first."
24+
msgstr "Es wurden keine Tags eingefügt. Bitte zuerst die Tags kopieren."
25+
26+
#: copy_attach_detach_tags.lua:10
27+
msgid "Tags attached ..."
28+
msgstr "Tags anhängen ..."
29+
30+
#: copy_attach_detach_tags.lua:10
31+
msgid "Tags removed from image(s)."
32+
msgstr "Tags vom Bild wurden gelöscht."
33+
34+
#: copy_attach_detach_tags.lua:10
35+
msgid "Tags replaced"
36+
msgstr "Tag ersetzen"
37+
38+
#: copy_attach_detach_tags.lua:10
39+
msgid "multi copy tags"
40+
msgstr "Tags kopieren"
41+
42+
#: copy_attach_detach_tags.lua:10
43+
msgid "paste tags"
44+
msgstr "Tags anhängen"
45+
46+
#: copy_attach_detach_tags.lua:10
47+
msgid "replace tags"
48+
msgstr "Tags ersetzen"
49+
50+
#: copy_attach_detach_tags.lua:10
51+
msgid "remove all tags"
52+
msgstr "Tags löschen"
53+
54+
#: copy_attach_detach_tags.lua:10
55+
msgid "tag clipboard"
56+
msgstr "Zwischenablage"
57+
58+
#: copy_attach_detach_tags.lua:10
59+
msgid "copy tags from selected image(s)"
60+
msgstr "Tags vom ausgewählten Bild kopieren"
61+
62+
#: copy_attach_detach_tags.lua:10
63+
msgid "paste tags to selected image(s)"
64+
msgstr "Tags ans ausgewählte Bild anhängen"
65+
66+
#: copy_attach_detach_tags.lua:10
67+
msgid "remove tags from selected image(s)"
68+
msgstr "Tags vom ausgewählten Bild löschen"
69+
70+
#: copy_attach_detach_tags.lua:10
71+
msgid "replace tags from selected image(s)"
72+
msgstr "Tags vom ausgewählten Bild ersetzen"

0 commit comments

Comments
 (0)