From 15e6d0fcd96acd02250fc6a5bff6590c118cb8a1 Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Fri, 25 Jan 2019 22:26:16 -0500 Subject: store api keys and client settings in secrets.lua --- translate-widget/translate.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'translate-widget') diff --git a/translate-widget/translate.lua b/translate-widget/translate.lua index fe242b4..2b64bf8 100644 --- a/translate-widget/translate.lua +++ b/translate-widget/translate.lua @@ -14,8 +14,8 @@ local naughty = require("naughty") local wibox = require("wibox") local gears = require("gears") local gfs = require("gears.filesystem") +local secrets = require("awesome-wm-widgets.secrets") -local API_KEY = '' local BASE_URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate' local ICON = '/usr/share/icons/Papirus-Dark/48x48/apps/gnome-translate.svg' @@ -88,7 +88,7 @@ w:setup { --- Main function - takes the user input and shows the widget with translation -- @param request_string - user input (dog enfr) local function translate(to_translate, lang) - local urll = BASE_URL .. '?lang=' .. lang .. '&text=' .. urlencode(to_translate) .. '&key=' .. API_KEY + local urll = BASE_URL .. '?lang=' .. lang .. '&text=' .. urlencode(to_translate) .. '&key=' .. secrets.translate_widget_api_key local resp_json, code = https.request(urll) if (code == 200 and resp_json ~= nil) then -- cgit v1.2.3