Settings
Settings
The popup UI is divided into four sections: Setup, Translate, Quota, and Limits. All settings are stored in chrome.storage.local under the hoverTranslateState key and remain available after you restart the browser.
Setup
The Setup section handles your DeepL credentials.
- DeepL API Key is a password-style input field.
- Save writes the current key to
chrome.storage.local. - Test calls DeepL’s
/v2/usageendpoint to confirm that the key is valid and that quota data can be read. - If no key is stored yet, the popup shows an API key required banner.
- Connection test errors are displayed directly in the popup so you can correct the key without opening Developer Tools.
Translate
The Translate section is the main control surface. It has four controls.
ON/OFF toggle
The coral pill toggle enables or disables the extension globally. When off, Hover Translate does nothing regardless of mode. The toggle is disabled until a DeepL API key is saved.
Mode switch
Choose between two modes:
- Hover — translate the nearest paragraph when the cursor hovers on it (after a 300 ms debounce).
- Selection — translate only the text you explicitly select.
Switching modes applies immediately and discards any in-flight translation from the previous mode.
Trigger switch (Selection mode only)
When Mode is Selection, a second switch appears to choose how the translation fires:
- Shortcut — press
Alt+Shift+Twhile text is selected. Nothing happens until you press the shortcut. - Auto — translate automatically 300 ms after you release the mouse, as long as a selection exists.
Shortcut row
The current shortcut binding (defaults to ⌥⇧T) is shown only in Selection + Shortcut mode, since that is the only mode that uses the shortcut. The Change link opens chrome://extensions/shortcuts so you can pick a different key combination.
Quota
The Quota section shows how much of the DeepL Free allowance has been used.
- Usage is rendered as a progress bar.
- The popup caches the value for 30 seconds to avoid redundant calls.
- Refresh forces a fresh read from DeepL.
- The bar changes color based on thresholds:
- OK for normal usage
- Warn above 80%
- Danger above 95%
The DeepL Free monthly quota resets automatically — you never have to pay to get it back. Checking this panel before long reading sessions is useful when you are close to the monthly limit.
Limits
The Limits section defines the maximum number of characters a single translation may send.
- Max characters per request accepts values from 500 to 5000.
- The default value is 1500.
- This number is also used as the threshold for the
Text too longerror. - In Hover mode, this also caps how far up the DOM tree Hover Translate looks for a containing block, so very large ancestor containers cannot accidentally become the translation target.
Stored state
Hover Translate keeps the following fields inside hoverTranslateState:
{ "enabled": true, "mode": "hover", "selectionTrigger": "shortcut", "deeplApiKey": "your-key", "targetEnglish": "EN-US", "maxChars": 1500}At present, targetEnglish is fixed to EN-US, although the stored schema also permits EN-GB.