Skip to content

Add automatic Turkish translation tooltip on text selection#1

Open
mesutcakir wants to merge 3 commits into
anyblabla:mainfrom
mesutcakir:main
Open

Add automatic Turkish translation tooltip on text selection#1
mesutcakir wants to merge 3 commits into
anyblabla:mainfrom
mesutcakir:main

Conversation

@mesutcakir

Copy link
Copy Markdown
  • Added tooltip that appears when text is selected on any webpage
  • Automatically translates selected text to Turkish using LibreTranslate API
  • Shows 'Çevriliyor...' loading message while translating
  • Tooltip positioned above cursor with smooth styling
  • Auto-hides on click
  • Added Turkish locale support (_locales/tr and locales/tr)
  • Limits translation to selections under 500 characters for performance

- Added tooltip that appears when text is selected on any webpage
- Automatically translates selected text to Turkish using LibreTranslate API
- Shows 'Çevriliyor...' loading message while translating
- Tooltip positioned above cursor with smooth styling
- Auto-hides on click
- Added Turkish locale support (_locales/tr and locales/tr)
- Limits translation to selections under 500 characters for performance
Features:
- Redesigned settings page with modern, compact UI
- Added tooltip customization options (font size, width, opacity, duration)
- Live preview of tooltip settings
- Turkish language support in settings
- Improved tooltip positioning in iframes
- Dynamic settings loading without page refresh
- Fixed API URL configuration (now uses settings correctly)
- Target language selection from settings
- Better error handling and logging

Improvements:
- Tooltip stays visible for configurable duration (3-30 seconds)
- Tooltip doesn't disappear during translation
- Better boundary detection for tooltip positioning
- Cleaner, more intuitive settings interface
- Removed unnecessary textarea customization options
- Added emoji icons for better visual organization

Bug Fixes:
- Fixed iframe positioning issues
- Fixed tooltip disappearing too quickly
- Fixed API URL not being read from settings
- Fixed translation language not respecting settings
Features:
- Translate select options when hovering with mouse
- Translate options when navigating with keyboard (arrow keys)
- Translate on click/selection
- Show translation tooltip on the right side of select element
- Support for iframes (all_frames: true in manifest)
- Automatic detection of dynamically added select elements

Implementation:
- Focus/blur tracking for select elements
- Keyboard event listeners (ArrowUp/ArrowDown)
- Mouse hover detection using elementFromPoint
- Click event handling with delayed translation
- MutationObserver for dynamic content
- Debouncing to prevent excessive API calls

User Experience:
- Loading indicator (⏳) while translating
- Tooltip appears on the right side of select
- Auto-hide after 3 seconds on click
- Console logging for debugging
- Works with both mouse and keyboard navigation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant