cleanup google translate widget

This commit is contained in:
Evgeny
2021-09-01 13:18:43 +03:00
parent ea079e220f
commit 6e4bd5c02d

View File

@@ -2,17 +2,18 @@
-- data_source = "https://translate.google.com"
-- type = "widget"
-- author = "Andrey Gavrilov"
-- version = "1.0"
-- version = "1.1"
local json = require "json"
local uri = "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto"
local text_from = ""
function on_alarm()
function on_resume()
ui:show_text("Tap to enter text")
end
function on_click()
ui:show_edit_dialog("Введите текст")
ui:show_edit_dialog("Enter text")
end
function on_dialog_action(text)
@@ -25,7 +26,7 @@ function on_dialog_action(text)
end
function translate(str)
http:get("http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto".."&tl="..system:get_lang().."&dt=t&q="..str)
http:get(uri.."&tl="..system:get_lang().."&dt=t&q="..str)
end
function on_network_result(result)