examples/*.lua - cleaned up translatable messages
This commit is contained in:
@@ -27,8 +27,6 @@ local dt = require "darktable"
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("api_version", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msg)
|
local function _(msg)
|
||||||
return gettext(msg)
|
return gettext(msg)
|
||||||
end
|
end
|
||||||
@@ -41,7 +39,7 @@ end
|
|||||||
|
|
||||||
local result = dt.configuration.api_version_string
|
local result = dt.configuration.api_version_string
|
||||||
dt.print_log("API Version: " .. result)
|
dt.print_log("API Version: " .. result)
|
||||||
dt.print(string.format(_("API version: %s"), result))
|
dt.print("API " .. _("version") .. ": " .. result)
|
||||||
|
|
||||||
-- set the destroy routine so that script_manager can call it when
|
-- set the destroy routine so that script_manager can call it when
|
||||||
-- it's time to destroy the script and then return the data to
|
-- it's time to destroy the script and then return the data to
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
|
|||||||
-- - - - - - - - - - - - - - - - - - - - - - - -
|
-- - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("darkroom_demo", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
end
|
end
|
||||||
@@ -93,7 +91,7 @@ dt.gui.current_view(dt.gui.views.darkroom)
|
|||||||
|
|
||||||
local max_images = 10
|
local max_images = 10
|
||||||
|
|
||||||
dt.print(_("showing images, with a pause in between each"))
|
dt.print(_("showing images, with a pause between each"))
|
||||||
sleep(1500)
|
sleep(1500)
|
||||||
|
|
||||||
-- display first 10 images of collection pausing for a second between each
|
-- display first 10 images of collection pausing for a second between each
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ dt.print_error("Hello World!")
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("gettextExample", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
-- Translate a string using the darktable textdomain
|
-- Translate a string using the darktable textdomain
|
||||||
dt.print_error(gettext("image"))
|
dt.print_error(gettext("image"))
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ local NaN = 0/0
|
|||||||
local wg = {}
|
local wg = {}
|
||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
dt.gettext.bindtextdomain("gui_action", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
@@ -29,37 +28,37 @@ script_data.show = nil -- only required for libs since the destroy_method only h
|
|||||||
|
|
||||||
wg.action = dt.new_widget("entry"){
|
wg.action = dt.new_widget("entry"){
|
||||||
text = "lib/filter/view",
|
text = "lib/filter/view",
|
||||||
placeholder = "action path",
|
placeholder = _("action path"),
|
||||||
tooltip = "enter the full path of an action, for example 'lib/filter/view'"
|
tooltip = _("enter the full path of an action, for example 'lib/filter/view'")
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.instance = dt.new_widget("combobox"){
|
wg.instance = dt.new_widget("combobox"){
|
||||||
label = "instance",
|
label = _("instance"),
|
||||||
tooltip = "the instance of an image processing module to execute action on",
|
tooltip = _("the instance of an image processing module to execute action on"),
|
||||||
"0", "+1", "-1", "+2", "-2", "+3", "-3", "+4", "-4", "+5", "-5", "+6", "-6", "+7", "-7", "+8", "-8", "+9", "-9"
|
"0", "+1", "-1", "+2", "-2", "+3", "-3", "+4", "-4", "+5", "-5", "+6", "-6", "+7", "-7", "+8", "-8", "+9", "-9"
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.element = dt.new_widget("entry"){
|
wg.element = dt.new_widget("entry"){
|
||||||
text = "",
|
text = "",
|
||||||
placeholder = "action element",
|
placeholder = _("action element"),
|
||||||
tooltip = "enter the element of an action, for example 'selection', or leave empty for default"
|
tooltip = _("enter the element of an action, for example 'selection', or leave empty for default")
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.effect = dt.new_widget("entry"){
|
wg.effect = dt.new_widget("entry"){
|
||||||
text = "next",
|
text = "next",
|
||||||
placeholder = "action effect",
|
placeholder = _("action effect"),
|
||||||
tooltip = "enter the effect of an action, for example 'next', or leave empty for default"
|
tooltip = _("enter the effect of an action, for example 'next', or leave empty for default")
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.speed = dt.new_widget("entry"){
|
wg.speed = dt.new_widget("entry"){
|
||||||
text = "1",
|
text = "1",
|
||||||
placeholder = "action speed",
|
placeholder = _("action speed"),
|
||||||
tooltip = "enter the speed to use in action execution, or leave empty to only read state"
|
tooltip = _("enter the speed to use in action execution, or leave empty to only read state")
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.check = dt.new_widget("check_button"){
|
wg.check = dt.new_widget("check_button"){
|
||||||
label = 'perform action',
|
label = _('perform action'),
|
||||||
tooltip = 'perform action or only read return',
|
tooltip = _('perform action or only read return'),
|
||||||
clicked_callback = function()
|
clicked_callback = function()
|
||||||
wg.speed.sensitive = wg.check.value
|
wg.speed.sensitive = wg.check.value
|
||||||
end,
|
end,
|
||||||
@@ -73,7 +72,7 @@ wg.return_value = dt.new_widget("entry"){
|
|||||||
|
|
||||||
dt.register_lib(
|
dt.register_lib(
|
||||||
"execute_action", -- Module name
|
"execute_action", -- Module name
|
||||||
"execute gui actions", -- name
|
_("execute gui actions"), -- name
|
||||||
true, -- expandable
|
true, -- expandable
|
||||||
false, -- resetable
|
false, -- resetable
|
||||||
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER", 100},
|
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER", 100},
|
||||||
@@ -85,33 +84,33 @@ dt.register_lib(
|
|||||||
dt.new_widget("box")
|
dt.new_widget("box")
|
||||||
{
|
{
|
||||||
orientation = "horizontal",
|
orientation = "horizontal",
|
||||||
dt.new_widget("label"){label = "action path", halign = "start"},
|
dt.new_widget("label"){label = _("action path"), halign = "start"},
|
||||||
wg.action
|
wg.action
|
||||||
},
|
},
|
||||||
wg.instance,
|
wg.instance,
|
||||||
dt.new_widget("box")
|
dt.new_widget("box")
|
||||||
{
|
{
|
||||||
orientation = "horizontal",
|
orientation = "horizontal",
|
||||||
dt.new_widget("label"){label = "element", halign = "start"},
|
dt.new_widget("label"){label = _("element"), halign = "start"},
|
||||||
wg.element
|
wg.element
|
||||||
},
|
},
|
||||||
dt.new_widget("box")
|
dt.new_widget("box")
|
||||||
{
|
{
|
||||||
orientation = "horizontal",
|
orientation = "horizontal",
|
||||||
dt.new_widget("label"){label = "effect", halign = "start"},
|
dt.new_widget("label"){label = _("effect"), halign = "start"},
|
||||||
wg.effect
|
wg.effect
|
||||||
},
|
},
|
||||||
wg.check,
|
wg.check,
|
||||||
dt.new_widget("box")
|
dt.new_widget("box")
|
||||||
{
|
{
|
||||||
orientation = "horizontal",
|
orientation = "horizontal",
|
||||||
dt.new_widget("label"){label = "speed", halign = "start"},
|
dt.new_widget("label"){label = _("speed"), halign = "start"},
|
||||||
wg.speed
|
wg.speed
|
||||||
},
|
},
|
||||||
dt.new_widget("button")
|
dt.new_widget("button")
|
||||||
{
|
{
|
||||||
label = "execute action",
|
label = _("execute action"),
|
||||||
tooltip = "execute the action specified in the fields above",
|
tooltip = _("execute the action specified in the fields above"),
|
||||||
clicked_callback = function(_)
|
clicked_callback = function(_)
|
||||||
local sp = NaN
|
local sp = NaN
|
||||||
if wg.check.value then sp = wg.speed.text end
|
if wg.check.value then sp = wg.speed.text end
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ du.check_min_api_version("2.0.0", "hello_world")
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("hello_world", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msg)
|
local function _(msg)
|
||||||
return gettext(msg)
|
return gettext(msg)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ du.check_min_api_version("7.0.0", "moduleExample")
|
|||||||
-- https://www.darktable.org/lua-api/index.html#darktable_gettext
|
-- https://www.darktable.org/lua-api/index.html#darktable_gettext
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("moduleExample", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
end
|
end
|
||||||
@@ -87,7 +85,7 @@ local function install_module()
|
|||||||
orientation = "vertical",
|
orientation = "vertical",
|
||||||
dt.new_widget("button")
|
dt.new_widget("button")
|
||||||
{
|
{
|
||||||
label = _("my button"),
|
label = _("my ") .. "button",
|
||||||
clicked_callback = function (_)
|
clicked_callback = function (_)
|
||||||
dt.print(_("button clicked"))
|
dt.print(_("button clicked"))
|
||||||
end
|
end
|
||||||
@@ -112,10 +110,10 @@ local function restart()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- https://www.darktable.org/lua-api/types_lua_check_button.html
|
-- https://www.darktable.org/lua-api/types_lua_check_button.html
|
||||||
local check_button = dt.new_widget("check_button"){label = _("my check_button"), value = true}
|
local check_button = dt.new_widget("check_button"){label = _("my ") .. "check_button", value = true}
|
||||||
|
|
||||||
-- https://www.darktable.org/lua-api/types_lua_combobox.html
|
-- https://www.darktable.org/lua-api/types_lua_combobox.html
|
||||||
local combobox = dt.new_widget("combobox"){label = _("my combobox"), value = 2, "8", "16", "32"}
|
local combobox = dt.new_widget("combobox"){label = _("my ") .. "combobox", value = 2, "8", "16", "32"}
|
||||||
|
|
||||||
-- https://www.darktable.org/lua-api/types_lua_entry.html
|
-- https://www.darktable.org/lua-api/types_lua_entry.html
|
||||||
local entry = dt.new_widget("entry")
|
local entry = dt.new_widget("entry")
|
||||||
@@ -131,14 +129,14 @@ local entry = dt.new_widget("entry")
|
|||||||
-- https://www.darktable.org/lua-api/types_lua_file_chooser_button.html
|
-- https://www.darktable.org/lua-api/types_lua_file_chooser_button.html
|
||||||
local file_chooser_button = dt.new_widget("file_chooser_button")
|
local file_chooser_button = dt.new_widget("file_chooser_button")
|
||||||
{
|
{
|
||||||
title = _("my file_chooser_button"), -- The title of the window when choosing a file
|
title = _("my ") .. "file_chooser_button", -- The title of the window when choosing a file
|
||||||
value = "", -- The currently selected file
|
value = "", -- The currently selected file
|
||||||
is_directory = false -- True if the file chooser button only allows directories to be selecte
|
is_directory = false -- True if the file chooser button only allows directories to be selecte
|
||||||
}
|
}
|
||||||
|
|
||||||
-- https://www.darktable.org/lua-api/types_lua_label.html
|
-- https://www.darktable.org/lua-api/types_lua_label.html
|
||||||
local label = dt.new_widget("label")
|
local label = dt.new_widget("label")
|
||||||
label.label = _("my label") -- This is an alternative way to the "{}" syntax to set a property
|
label.label = _("my ") .. "label" -- This is an alternative way to the "{}" syntax to set a property
|
||||||
|
|
||||||
-- https://www.darktable.org/lua-api/types_lua_separator.html
|
-- https://www.darktable.org/lua-api/types_lua_separator.html
|
||||||
local separator = dt.new_widget("separator"){}
|
local separator = dt.new_widget("separator"){}
|
||||||
@@ -146,7 +144,7 @@ local separator = dt.new_widget("separator"){}
|
|||||||
-- https://www.darktable.org/lua-api/types_lua_slider.html
|
-- https://www.darktable.org/lua-api/types_lua_slider.html
|
||||||
local slider = dt.new_widget("slider")
|
local slider = dt.new_widget("slider")
|
||||||
{
|
{
|
||||||
label = _("my slider"),
|
label = _("my ") .. "slider",
|
||||||
soft_min = 10, -- The soft minimum value for the slider, the slider can't go beyond this point
|
soft_min = 10, -- The soft minimum value for the slider, the slider can't go beyond this point
|
||||||
soft_max = 100, -- The soft maximum value for the slider, the slider can't go beyond this point
|
soft_max = 100, -- The soft maximum value for the slider, the slider can't go beyond this point
|
||||||
hard_min = 0, -- The hard minimum value for the slider, the user can't manually enter a value beyond this point
|
hard_min = 0, -- The hard minimum value for the slider, the user can't manually enter a value beyond this point
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ local dtsys = require "lib/dtutils.system" -- system utilities
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("multi_os", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
end
|
end
|
||||||
@@ -215,7 +213,7 @@ end
|
|||||||
if dt.configuration.running_os ~= "linux" then
|
if dt.configuration.running_os ~= "linux" then
|
||||||
local executable = "ufraw-batch"
|
local executable = "ufraw-batch"
|
||||||
local ufraw_batch_path_widget = dt.new_widget("file_chooser_button"){
|
local ufraw_batch_path_widget = dt.new_widget("file_chooser_button"){
|
||||||
title = _("select ufraw-batch[.exe] executable"),
|
title = string.format(_("select %s executable"), "ufraw-batch[.exe]"),
|
||||||
value = df.get_executable_path_preference(executable),
|
value = df.get_executable_path_preference(executable),
|
||||||
is_directory = false,
|
is_directory = false,
|
||||||
changed_callback = function(self)
|
changed_callback = function(self)
|
||||||
@@ -226,7 +224,7 @@ if dt.configuration.running_os ~= "linux" then
|
|||||||
}
|
}
|
||||||
dt.preferences.register("executable_paths", "ufraw-batch", -- name
|
dt.preferences.register("executable_paths", "ufraw-batch", -- name
|
||||||
"file", -- type
|
"file", -- type
|
||||||
_('multi_os: ufraw-batch location'), -- label
|
'multi_os: ufraw-batch ' .. _('location'), -- label
|
||||||
_('installed location of ufraw-batch, requires restart to take effect.'), -- tooltip
|
_('installed location of ufraw-batch, requires restart to take effect.'), -- tooltip
|
||||||
"ufraw-batch", -- default
|
"ufraw-batch", -- default
|
||||||
ufraw_batch_path_widget
|
ufraw_batch_path_widget
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/"
|
|||||||
-- - - - - - - - - - - - - - - - - - - - - - - -
|
-- - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("panels_demo", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
end
|
end
|
||||||
@@ -95,11 +93,11 @@ dt.gui.panel_show_all()
|
|||||||
|
|
||||||
-- hide center_top, center_bottom, left, top, right, bottom in order
|
-- hide center_top, center_bottom, left, top, right, bottom in order
|
||||||
|
|
||||||
dt.print(_("hiding all panels, one at a tme"))
|
dt.print(_("hiding all panels, one at a time"))
|
||||||
sleep(1500)
|
sleep(1500)
|
||||||
|
|
||||||
for i = 1, #panels do
|
for i = 1, #panels do
|
||||||
dt.print(_("hiding " .. panels[i]))
|
dt.print(string.format(_("hiding %s"), panels[i]))
|
||||||
dt.gui.panel_hide(panels[i])
|
dt.gui.panel_hide(panels[i])
|
||||||
sleep(1500)
|
sleep(1500)
|
||||||
end
|
end
|
||||||
@@ -110,7 +108,7 @@ end
|
|||||||
sleep(1500)
|
sleep(1500)
|
||||||
|
|
||||||
for i = #panels, 1, -1 do
|
for i = #panels, 1, -1 do
|
||||||
dt.print(_("showing " .. panels[i]))
|
dt.print(string.format(_("showing %s"), panels[i]))
|
||||||
dt.gui.panel_show(panels[i])
|
dt.gui.panel_show(panels[i])
|
||||||
sleep(1500)
|
sleep(1500)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ local du = require "lib/dtutils"
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("preferenceExamples", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msg)
|
local function _(msg)
|
||||||
return gettext(msg)
|
return gettext(msg)
|
||||||
end
|
end
|
||||||
@@ -49,22 +47,22 @@ du.check_min_api_version("2.0.1", "preferenceExamples")
|
|||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesString", -- name
|
"preferenceExamplesString", -- name
|
||||||
"string", -- type
|
"string", -- type
|
||||||
_("example string"), -- label
|
_("example") .. " string", -- label
|
||||||
_("example string tooltip"), -- tooltip
|
_("example") .. " string " .. _("tooltip"), -- tooltip
|
||||||
"String") -- default
|
"String") -- default
|
||||||
|
|
||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesBool", -- name
|
"preferenceExamplesBool", -- name
|
||||||
"bool", -- type
|
"bool", -- type
|
||||||
_("example boolean"), -- label
|
_("example") .. " boolean", -- label
|
||||||
_("example boolean tooltip"), -- tooltip
|
_("example") .. " boolean " .. _("tooltip"), -- tooltip
|
||||||
true) -- default
|
true) -- default
|
||||||
|
|
||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesInteger", -- name
|
"preferenceExamplesInteger", -- name
|
||||||
"integer", -- type
|
"integer", -- type
|
||||||
_("example integer"), -- label
|
_("example") .. " integer", -- label
|
||||||
_("example integer tooltip"), -- tooltip
|
_("example") .. " integer " .. _("tooltip"), -- tooltip
|
||||||
2, -- default
|
2, -- default
|
||||||
1, -- min
|
1, -- min
|
||||||
99) -- max
|
99) -- max
|
||||||
@@ -72,8 +70,8 @@ dt.preferences.register("preferenceExamples", -- script: This is a string
|
|||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesFloat", -- name
|
"preferenceExamplesFloat", -- name
|
||||||
"float", -- type
|
"float", -- type
|
||||||
_("example float"), -- label
|
_("example") .. " float", -- label
|
||||||
_("example float tooltip"), -- tooltip
|
_("example") .. " float " .. _("tooltip"), -- tooltip
|
||||||
1.3, -- default
|
1.3, -- default
|
||||||
1, -- min
|
1, -- min
|
||||||
99, -- max
|
99, -- max
|
||||||
@@ -82,22 +80,22 @@ dt.preferences.register("preferenceExamples", -- script: This is a string
|
|||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesFile", -- name
|
"preferenceExamplesFile", -- name
|
||||||
"file", -- type
|
"file", -- type
|
||||||
_("example file"), -- label
|
_("example") .. " file", -- label
|
||||||
_("example file tooltip"), -- tooltip
|
_("example") .. " file " .. _("tooltip"), -- tooltip
|
||||||
"") -- default
|
"") -- default
|
||||||
|
|
||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesDirectory", -- name
|
"preferenceExamplesDirectory", -- name
|
||||||
"directory", -- type
|
"directory", -- type
|
||||||
_("example directory"), -- label
|
_("example") .. " directory", -- label
|
||||||
_("example directory tooltip"), -- tooltip
|
_("example") .. " directory " .. _("tooltip"), -- tooltip
|
||||||
"") -- default
|
"") -- default
|
||||||
|
|
||||||
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
|
||||||
"preferenceExamplesEnum", -- name
|
"preferenceExamplesEnum", -- name
|
||||||
"enum", -- type
|
"enum", -- type
|
||||||
_("example enum"), -- label
|
_("example") .. " enum", -- label
|
||||||
_("example enum tooltip"), -- tooltip
|
_("example") .. " enum " .. _("tooltip"), -- tooltip
|
||||||
"Enum 1", -- default
|
"Enum 1", -- default
|
||||||
"Enum 1", "Enum 2") -- values
|
"Enum 1", "Enum 2") -- values
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ du.check_min_api_version("5.0.0", "printExamples")
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("printExamples", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msg)
|
local function _(msg)
|
||||||
return gettext(msg)
|
return gettext(msg)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ du.check_min_api_version("5.0.0", "running_os")
|
|||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
|
|
||||||
dt.gettext.bindtextdomain("running_os", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msg)
|
local function _(msg)
|
||||||
return gettext(msg)
|
return gettext(msg)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ local du = require "lib/dtutils"
|
|||||||
du.check_min_api_version("9.2.0", "x-touch")
|
du.check_min_api_version("9.2.0", "x-touch")
|
||||||
|
|
||||||
local gettext = dt.gettext.gettext
|
local gettext = dt.gettext.gettext
|
||||||
dt.gettext.bindtextdomain("gui_action", dt.configuration.config_dir .."/lua/locale/")
|
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext(msgid)
|
return gettext(msgid)
|
||||||
|
|||||||
Reference in New Issue
Block a user