If you saved time and money with this project. Support it ๐
A Chrome extension that adds AI-powered translation capabilities to WPML (WordPress Multilingual Plugin) translation pages using OpenAI or OpenRouter APIs.
- OpenAI Integration: Direct access to OpenAI's GPT models
- OpenRouter Integration: Access to multiple AI providers through OpenRouter
- Seamless Switching: Easily switch between providers with separate API key storage
- Provider-Specific Models: Automatically loads available models based on selected provider
- Dynamic Model Loading: Automatically fetches available models from your API provider
- Custom System Prompts: Full control over translation behavior with editable prompts
- Intelligent Translation Rules: Built-in rules to preserve brand names, HTML tags, and proper nouns
- Real-time Settings Sync: Changes apply instantly without page refresh
- Modern Popup Design: Clean, intuitive interface with proper form validation
- API Key Status Indicator: Visual confirmation when API keys are saved
- Model Information Display: Shows model details like context length and ownership
- Provider Selection: Easy toggle between OpenAI and OpenRouter
- AI Translate: Translate individual text segments with one click
- AI Translate All: Automatically translate and save multiple segments in sequence
- Stop Functionality: Immediate abort of ongoing translations with proper cleanup
- Visual Feedback: Animated buttons show translation progress
- Error Handling: Clear error messages and validation throughout
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extension folder
- The extension icon will appear in your Chrome toolbar
- Click the extension icon in your Chrome toolbar
- Choose your preferred provider (OpenAI or OpenRouter)
- Enter your API key:
- OpenAI: Get from platform.openai.com
- OpenRouter: Get from openrouter.ai/keys
- The model list will load automatically
- Select your preferred AI model from the dropdown
- (Optional) Customize the system prompt to control translation behavior
- Click "Save All Settings"
The extension includes a sophisticated default system prompt that:
- Ensures clean, translation-only output
- Preserves brand names, proper nouns, and technical terms
- Maintains HTML structure and formatting
- Avoids adding unnecessary explanations or commentary
You can customize this prompt in the settings to match your specific translation needs.
-
Navigate to any WPML translation page (
*.ate.wpml.org/dashboard*) -
The extension automatically adds three buttons to the interface:
- AI Translate: Translate the current text segment
- AI Translate All: Automatically translate all remaining segments sequentially
- Stop: Immediately stop the auto-translation process
Single Translation:
- Review the source text
- Click "AI Translate"
- The translated text appears in the editor
- Review and save manually
Batch Translation:
- Click "AI Translate All"
- Watch as segments are translated and saved automatically
- Click "Stop" at any time to pause the process
- Translation stops immediately with proper cleanup
The extension automatically loads all available models from your OpenAI account:
- GPT-4 Series: Latest models (gpt-4, gpt-4-turbo, etc.) - recommended for highest quality
- GPT-3.5 Series: Faster and more cost-effective options
- Other Models: Any compatible text generation models in your account
Access to a wide variety of models from multiple providers:
- OpenAI models (GPT-4, GPT-3.5, etc.)
- Anthropic Claude models
- Google models
- Meta Llama models
- And many more providers
The extension displays model context length and other relevant information to help you choose.
-
Browser: Chrome or Chromium-based browser
-
API Access: Valid API key from either:
- OpenAI account with available credits
- OpenRouter account with available credits
-
Website: Access to WPML translation pages (
*.ate.wpml.org/dashboard*) -
Modern CSS: Grid and Flexbox layouts with smooth transitions
-
Visual Feedback: Animated buttons with loading states (โก icon rotation)
-
Form Validation: Input validation before API calls
-
Accessibility: Proper ARIA labels and keyboard navigation
-
Responsive Design: Mobile-friendly popup interface