From ea9934186cabc01dc11a665516aad3a5e3b54bf4 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Wed, 16 Dec 2020 20:26:58 -0500 Subject: fix #220 - update translate prompt README --- translate-widget/README.MD | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'translate-widget') diff --git a/translate-widget/README.MD b/translate-widget/README.MD index 2c783a0..a82fda7 100644 --- a/translate-widget/README.MD +++ b/translate-widget/README.MD @@ -1,6 +1,6 @@ # Translate Widget -This widget allows quickly translate words or phrases without opening a browser - just using Awesome. To provide direction of the translation add the 2 letters code of the source and target languages at the end of the phrase, for example _hello enfr_ will translate _hello_ from English to French. This widget is based on [Yandex.Translate API](https://tech.yandex.com/translate/). +This widget allows quickly translate words or phrases without opening a browser - just using Awesome. To provide direction of the translation add the 2 letters code of the source and target languages at the end of the phrase, for example _hello enfr_ will translate _hello_ from English to French. This widget is based on [Watson Language Translator](https://www.ibm.com/watson/services/language-translator/) from IBM. ![demo](./demo.gif) @@ -13,7 +13,8 @@ This widget allows quickly translate words or phrases without opening a browser ## Installation 1. Clone repo under **~/.config/awesome/** -1. Get an [API key](https://translate.yandex.com/developers/keys) +1. Create an IBM Cloud API key at [cloud.ibm.com/iam/apikeys](https://cloud.ibm.com/iam/apikeys) +1. Copy a service URL by going to [resource list](https://cloud.ibm.com/resources), then under "Services" select "Language Translator" option, and then copy URL from the "Credentials" section 1. Require widget in **rc.lua**: ```lua @@ -23,8 +24,15 @@ This widget allows quickly translate words or phrases without opening a browser 1. Add a shortcut to run translate prompt: ```lua - awful.key({ modkey }, "c", - function() translate.show_translate_prompt('') end, - { description = "run translate prompt", group = "launcher" }), - ``` + awful.key({ modkey }, "c", function() + translate.launch{api_key = '', url = 'url'} + end, { description = "run translate prompt", group = "launcher" }) + ``` + + + + + + + -- cgit v1.2.3