HyperMew AI Translator

描述

HyperMew AI Translator is a high-performance, developer-friendly translation plugin that integrates modern language model routing directly inside your WordPress post edit screens. Powered by the OpenRouter API, it translates your content fields to a variety of target languages within seconds.

Key features include:
* Gutenberg & Classic Editors: Complete sidebar integration in Gutenberg and a custom metabox inside the Classic Editor.
* Granular Field Selection: Translate the Title, Content, Excerpt, or any arbitrary custom fields simultaneously.
* Custom Field Mapping: Define translatable fields dynamically using custom CSS selectors to target specific page elements.
* Performance Caching: Local caching via the WordPress Transients API preserves translations for 24 hours to speed up repeated edits and minimize API usage.
* System Prompt Customization: Customize the core instructions sent to translation models, with full support for HTML tag preservation and specific typography rules.
* Dynamic Model Selection: Connect to any model on OpenRouter, with visual badges highlighting free tiers, fast options, and auto-routing models.
* Tabbed Settings Dashboard: A fully responsive settings page with slide-in tab transitions and persisted navigation states.

External Service Integration

This plugin relies on the external service OpenRouter (https://openrouter.ai) to perform translation requests.
* Service URL: https://openrouter.ai
* Terms of Service: https://openrouter.ai/terms
* Privacy Policy: https://openrouter.ai/privacy
* Data Transmission: When you perform a translation, the selected text, chosen target language, system prompt guidelines, and your configured API key are securely transmitted via HTTPS requests to OpenRouter’s API endpoint (https://openrouter.ai/api/v1/chat/completions). No other personal or site details are shared.

Help & Guide

Step-by-Step Translation Guide

  1. Open any supported Post or Page.
  2. Write or paste your content in the Title, Content, Excerpt, or Custom text area.
  3. Observe that the translation panel automatically detects which fields contain text and lights them up.
  4. Select the field(s) you wish to translate.
  5. Select your target language from the buttons group.
  6. Click Translate Now.
  7. The fields will temporarily disable during execution and then update automatically.

System Prompt Best Practices

Use the system prompt to guide your translation model. Always keep the {target-lang} placeholder, which is replaced dynamically. To prevent models from breaking layouts, instruct them to preserve:
* WordPress blocks and shortcodes (e.g., [gallery])
* HTML tags and attribute values (e.g., class names, URLs)
* Typography preferences (e.g., prohibiting em dashes)

屏幕截图

安装

  1. Upload the hypermew-ai-translator directory to the /wp-content/plugins/ directory, or install it through the WordPress plugins administration screen.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Navigate to Settings -> HyperMew Translator to input your OpenRouter API Key.
  4. Customize your preferred translation model, target languages, and enabled post types.
  5. Save the configuration and edit any supported Post or Page to access the translation module.

常见问题

Do I need an OpenRouter API key to use this plugin?

Yes. You must sign up at openrouter.ai, generate a secret API key, and save it in the settings dashboard.

Which models are supported?

The plugin fetches all active OpenRouter models dynamically. It includes built-in defaults such as:
* Llama 3 8B Instruct (Free)
* Mistral 7B Instruct (Free)
* Claude 3 Haiku
* OpenRouter Auto (Dynamic model selection)
* You can also specify any exact custom model identifier path supported by OpenRouter.

How does the cache work?

When local caching is enabled in settings, the plugin saves the successful translation output locally using WordPress Transients. If the exact same text is translated to the same language with the same model, it will be served instantly from the cache, bypassing the API to save you money.

How do I configure custom fields?

Under the “General Settings” tab in settings, click “Add Custom Field”. Specify a label (e.g., Subtitle) and its unique CSS selector in the page DOM (e.g., #subtitle). The translator panel will automatically detect this selector and translate its value when editing.

评价

此插件暂无评价。

贡献者及开发者

「HyperMew AI Translator」是开源软件。 以下人员对此插件做出了贡献。

贡献者

更新日志

1.6.4

  • Added support for WooCommerce Product short description field in the list of translatable fields when WooCommerce is active.
  • Updated version number to 1.6.4.

1.6.3

  • Expanded Supported Post Types query to include non-public, non-public queryable, and search-excluded custom post types.
  • Updated version number to 1.6.3.

1.6.2

  • Hardened REST API routes with formal schema validation and sanitization.
  • Sanitized input variables inside log writing REST request handling.
  • Removed redundant and broken debug listener in TranslationPanelInner component.
  • Updated plugin version to 1.6.2.

1.6.1

  • Resolved PHPCS NonceVerification warnings in the block editor enqueue method.

1.6.0

  • Removed discouraged manual textdomain loading to comply with modern WordPress standards.
  • Cleaned up empty lines and redundant spaces in CSS stylesheets.
  • Added plugin icon and banner assets for the WordPress plugin repository.

1.5.0

  • Added debug logs option under a new settings tab.
  • Log all translation requests, API payloads, responses, caching status, and errors.
  • Allow users to copy and clear debug logs from the dashboard.

1.4.0

  • Renamed plugin to HyperMew AI Translator.
  • Cleaned up empty folders and optimized initialization logic.
  • Allowed adding raw HTML tags and code blocks in System Prompt settings.
  • Changed sanitization logic for System Prompt to preserve custom tag inputs.

1.3.0

  • Added setting option to enable or disable local translation caching.
  • Added Performance Caching control interface to General Settings tab.

1.2.0

  • Restructured the settings layout into tabs to improve UX.
  • Added slide-in transitions between settings tabs.
  • Persisted active tab selection in the browser session.

1.1.0

  • Added ability for user to define custom translatable fields by CSS selectors.
  • Pre-selected first target language on load in both Gutenberg and Classic editors.
  • Renamed translate buttons to “Translate Now”.

1.0.0

  • Initial Release.
  • Added support for the Gutenberg block editor sidebar.
  • Added support for the Classic Editor sidebar metabox.
  • Added caching via transients API.
  • Added custom model identifiers configuration.