docs » DeepLTranslate

Show a popup window with the translation of the currently selected text

The spoon uses the https://www.deepl.com translator page The selected text is copied into the source field.
The modal hotkey cmd+alt+ctrl+O replaces the selected text with the translation

Supported language codes are listed at https://www.deepl.com/translator

This is just an adaption of the Spoon PopupTranslateSelection written by Diego Zamboni Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/DeepLTranslate.spoon.zip

API Overview

API Documentation

Variables

logger
Signature DeepLTranslate.logger
Type Variable
Description

Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.

Source Source/DeepLTranslate.spoon/init.lua line 47

Methods

bindHotkeys
Signature DeepLTranslate:bindHotkeys(mapping)
Type Method
Description

Binds hotkeys for DeepLTranslate

Parameters
  • mapping - A table containing hotkey modifier/key details for the following items:
    • translate - translate the selected text without specifying source/destination languages (source defaults to auto-detect, destination defaults to your last choice or to English)
Returns
Examples
Source Source/DeepLTranslate.spoon/init.lua line 217
translatePopup
Signature DeepLTranslate:translatePopup(text)
Type Method
Description

Display a translation popup with the translation of the given text

Parameters
  • text - string containing the text to translate
Returns
  • The DeepLTranslate object
Source Source/DeepLTranslate.spoon/init.lua line 119
translateSelectionPopup
Signature DeepLTranslate:translateSelectionPopup()
Type Method
Description

Get the current selected text in the frontmost window and display a translation popup with the translation between the specified languages

Parameters
  • None
Returns
  • The DeepLTranslate object
Source Source/DeepLTranslate.spoon/init.lua line 196