https://github.com/timgrossmann/anytranslate
💠Translate words from and to your language, anywhere.
https://github.com/timgrossmann/anytranslate
hammerspoon hotkey language lua mac translation
Last synced: 8 months ago
JSON representation
💠Translate words from and to your language, anywhere.
- Host: GitHub
- URL: https://github.com/timgrossmann/anytranslate
- Owner: timgrossmann
- License: mit
- Created: 2016-12-21T07:34:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T07:25:35.000Z (over 8 years ago)
- Last Synced: 2025-03-19T00:03:54.120Z (about 1 year ago)
- Topics: hammerspoon, hotkey, language, lua, mac, translation
- Language: Lua
- Homepage:
- Size: 8.79 KB
- Stars: 17
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Anytranslate
Translate words from and to your native language, anywhere.
> This script is based on [Anycomplete](https://github.com/nathancahill/Anycomplete)

---
### How to install the script
```bash
$ git clone https://github.com/timgrossmann/Anytranslate.git ~/.hammerspoon/anytranslate
```
Now you simply need to add
```lua
dofile("./anytranslate/anytranslate.lua")
```
to the init.lua file inside of the .hammerspoon folder.
> If you don't have an init.lua file, just create it
---
### How to install Hammerspoon
Go the the [HammerSpoon Webpage](http://www.hammerspoon.org) and check out "How do I install it?"
Once installed just make sure you have accessibility enabled in the preferences.

---
### Setup
Enter your keys and languages into the script file. Defaults are "de"(german) to en("english")
> You can get the translation api key here: https://tech.yandex.com/translate/
> And the dictionary api key here: https://tech.yandex.com/dictionary/
> Just register for free and click "Get a free API key."
```lua
local TRANS_KEY =
local DICT_KEY =
local NATIVE_LANG =
local INTO_LANG = --In what language to you want to tranlaste the text if you enter your native language
local LANG_HINTS = "de,en" --Prefer some languages (will be prefered if detection is not surea)
```
---
### Usage
Start with the hotkey `⌃⌥⌘T`. Once you start typing, translations will be displayed once a valid word is entered.
They can be choosen with `⌘1-9` or by pressing the arrow keys and Enter.
If you want to change the hotkey just replace the "T" on the second line of the script with your favored key
```lua
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "T", function()
```
---
#### Supported languages:
> en, es, de, fr, it, pl, ru, tr, uk
> Supported translations:
- ru-ru
- ru-en
- ru-pl
- ru-uk
- ru-de
- ru-fr
- ru-es
- ru-it
- ru-tr
- en-ru
- en-en
- en-de
- en-fr
- en-es
- en-it
- en-tr
- pl-ru
- uk-ru
- de-ru
- de-en
- fr-ru
- fr-en
- es-ru
- es-en
- it-ru
- it-en
- tr-ru
- tr-en
> Why yandex ?
- It's free
- Minimalistic "get key" process
- 2.000.000 calls per month