中文版本 | English
A Firefox extension that uses large language models to assist with translation on translation websites.
- 🤖 AI-Powered Translation: Supports multiple large language models including OpenAI, Anthropic, Google AI, and more
- 🌐 Multi-Site Support: Compatible with multiple mainstream translation platforms
- ⚙️ Flexible Configuration: Customizable API providers, models, and parameters
- 🌍 Internationalization: Supports both Chinese and English interfaces
- 🎨 Modern UI: Beautiful user interface with smooth interactive experience
- LibreOffice Translation Platform
- LibreOffice Wiki
- Weblate
- Other Weblate systems (can be force-enabled)
- OpenAI: GPT-4, GPT-3.5 Turbo
- Anthropic: Claude 3 Sonnet, Claude 3 Haiku
- Google AI: Gemini Pro
- Custom: Supports any service compatible with OpenAI API format
- Clone or download this project locally
- Open Firefox browser
- Enter
about:debugging
in the address bar - Click "This Firefox"
- Click "Load Temporary Add-on"
- Select the
manifest.json
file in the project directory
The extension will be published to the Firefox Add-ons store for direct installation.
After first installation, the extension will automatically open the settings page:
- Select API provider (OpenAI, Anthropic, Google AI, or Custom)
- Enter API key
- Select or customize model name
- Click Save
- Visit a supported translation website
- Find the translation text box
- Click the "AI Translate" button
- Review the AI-generated translation result
- Click "Apply" to fill the translation into the text box
LLMTranslationAssistant/
├── manifest.json # Extension manifest file
├── background.js # Background script
├── content.js # Content script
├── content.css # Content script styles
├── options.html # Settings page
├── options.css # Settings page styles
├── options.js # Settings page script
├── popup.html # Popup window
├── popup.css # Popup window styles
├── popup.js # Popup window script
├── site-configs.js # Site configuration file
├── generate-icons.js # Icon generation script
├── create-png-icons.html # PNG icon creation page
├── icons/ # Icon files
│ ├── icon.svg
│ ├── icon-16.svg
│ ├── icon-32.svg
│ ├── icon-48.svg
│ └── icon-128.svg
├── _locales/ # Internationalization files
│ ├── en/
│ │ └── messages.json
│ └── zh_CN/
│ └── messages.json
└── README.md # Documentation
- Firefox WebExtensions API: Extension development framework
- Vanilla JavaScript: Dependency-free native JS
- CSS3: Modern CSS features and animations
- SVG: Vector icons
- Settings Management: Uses
chrome.storage.sync
to store user configurations - Content Injection: Injects UI elements into translation sites through content scripts
- API Calls: Unified interface supporting multiple AI services
- Internationalization: Multi-language support using
chrome.i18n
API
storage
: Store user settingsactiveTab
: Access current tabhttps://*/*
: Support other translation sites and API services
Issues and Pull Requests are welcome!
- Fork this repository
- Clone locally
- Load the extension following the installation method
- Modify code and test
- Submit Pull Request
- Add site configuration in
site-configs.js
- Add logic for extracting source text for the new site in the
getSourceText
method incontent.js
- Add site permissions in
manifest.json
- Test functionality
MIT License
For questions or suggestions, please contact via:
- GitHub Issues: Submit Issue