Persistent Translator Tooltip with Sidebar and Local Storage
Short Description: A UserScript that translates selected words, displays them in a tooltip, adds them to a sidebar for reference, and stores them in local storage.
Detailed Description:
The Persistent Translator Tooltip script enhances your browsing experience by providing an easy and efficient way to translate and track words on any webpage. It is especially useful for language learners and those who frequently encounter unfamiliar words while browsing.
Key Features:
- On-Click Translation: Simply select a word to translate it instantly.
- Tooltip Display: Translated words are shown in a tooltip next to the selected text.
- Sidebar for Reference: Each translated word is added to a sidebar, creating a list of translations for easy reference.
- Local Storage of Translations: Translations are saved in the browser's local storage, ensuring they remain available even after the page is refreshed or the browser is restarted.
- Hide/Show Sidebar: A button is provided to hide or show the sidebar as per user preference.
- Clear Translations: Users can clear the list of translations from the sidebar and local storage with a single click.
How It Works:
Select a word on any webpage. The script sends a request to a translation API and retrieves the translation in the desired language (set to Persian by default). The translated word appears in a tooltip, and it's added to a sidebar on the right side of the screen. Users can hide/show the sidebar or clear its contents using the provided buttons.
Instructions for Use:
Install the UserScript using a UserScript manager like Tampermonkey or Greasemonkey. Navigate to any webpage and select a word to see its translation. Use the sidebar buttons to manage translations and sidebar visibility.
Customization:
Users with coding knowledge can modify the target language by altering the API request within the script.
Limitations:
The script currently relies on a specific translation API and is set to translate into Persian. Users may need to modify the script for other languages or APIs. The script's functionality may vary based on website layout and content.
License:
This script is released under the MIT License.
Feedback and Contributions:
For any feedback, issues, or contributions, please contact [Your Contact Information/Profile Link].