{"id":243345,"date":"2025-08-16T15:20:09","date_gmt":"2025-08-16T15:20:09","guid":{"rendered":"https:\/\/cn.wordpress.org\/plugins\/hhg-for-translatepress\/"},"modified":"2026-05-29T09:14:57","modified_gmt":"2026-05-29T09:14:57","slug":"hhg-for-translatepress","status":"publish","type":"plugin","link":"https:\/\/li.wordpress.org\/plugins\/hhg-for-translatepress\/","author":17243974,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.5","stable_tag":"1.0.5","tested":"7.0","requires":"5.6","requires_php":"7.4","requires_plugins":null,"header_name":"HHG for TranslatePress","header_author":"huhonggang","header_description":"Google Gemini AI, OpenAI GPT, ZhiPu AI, The engine is integrated into the plugin TranslatePress as a translation source.","assets_banners_color":"ebebff","last_updated":"2026-05-29 09:14:57","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/huhonggang.com\/hhg-for-translatepress\/","header_plugin_uri":"https:\/\/huhonggang.com\/hhg-for-translatepress\/","header_author_uri":"https:\/\/huhonggang.com\/","rating":5,"author_block_rating":0,"active_installs":600,"downloads":1805,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.3":{"tag":"1.0.3","author":"gwuluo","date":"2025-08-16 15:19:54"},"1.0.4":{"tag":"1.0.4","author":"gwuluo","date":"2025-12-12 08:18:15"},"1.0.5":{"tag":"1.0.5","author":"gwuluo","date":"2026-05-29 09:14:57"}},"upgrade_notice":{"1.0.5":"<ul>\n<li>OpenAI engine redesigned as universal platform \u2014 existing OpenAI settings are preserved<\/li>\n<li>New Industry \/ Domain Description field available for all HHG engines<\/li>\n<li>DeepSeek V4 models replace previous versions<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3345620,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3345620,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3345620,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3345620,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.3","1.0.4","1.0.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3345620,"resolution":"1","location":"assets","locale":"","width":750,"height":850},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3345620,"resolution":"2","location":"assets","locale":"","width":750,"height":850},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3345620,"resolution":"3","location":"assets","locale":"","width":750,"height":850},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3345620,"resolution":"4","location":"assets","locale":"","width":750,"height":850}},"screenshots":{"1":"Engine selection \u2014 choose from Google Gemini, OpenAI Compatible, DeepSeek, or ZhiPu AI","2":"OpenAI Compatible platform picker \u2014 switch between OpenAI, Azure, Groq, Together AI, OpenRouter, Ollama, or Custom","3":"Gemini settings with model selection","4":"DeepSeek configuration","5":"Industry \/ Domain Description card for consistent translation quality"}},"plugin_section":[],"plugin_tags":[237722,224606,194533,195341,2333],"plugin_category":[48],"plugin_contributors":[246386,246387],"plugin_business_model":[],"class_list":["post-243345","plugin","type-plugin","status-publish","hentry","plugin_tags-deepseek","plugin_tags-gemini","plugin_tags-openai","plugin_tags-translatepress","plugin_tags-translation","plugin_category-language-tools","plugin_contributors-gwuluo","plugin_contributors-jayden778","plugin_committers-gwuluo"],"banners":{"banner":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/banner-772x250.png?rev=3345620","banner_2x":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/banner-1544x500.png?rev=3345620","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/icon-128x128.png?rev=3345620","icon_2x":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/icon-256x256.png?rev=3345620","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/screenshot-1.png?rev=3345620","caption":"Engine selection \u2014 choose from Google Gemini, OpenAI Compatible, DeepSeek, or ZhiPu AI"},{"src":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/screenshot-2.png?rev=3345620","caption":"OpenAI Compatible platform picker \u2014 switch between OpenAI, Azure, Groq, Together AI, OpenRouter, Ollama, or Custom"},{"src":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/screenshot-3.png?rev=3345620","caption":"Gemini settings with model selection"},{"src":"https:\/\/ps.w.org\/hhg-for-translatepress\/assets\/screenshot-4.png?rev=3345620","caption":"DeepSeek configuration"}],"raw_content":"<!--section=description-->\n<p>HHG for TranslatePress extends TranslatePress with best-in-class AI translation engines. Pick from four engine families instead of a single provider.<\/p>\n\n<p><strong>Supported Translation Engines:<\/strong><\/p>\n\n<h4>Google Gemini AI<\/h4>\n\n<p>Powered by Google's latest Gemini models. Choose from Flash-Lite (fastest &amp; cheapest), Flash (balanced), Pro (highest quality), or 3 Flash Preview (cutting edge). API key from Google AI Studio.<\/p>\n\n<h4>OpenAI Compatible Platform<\/h4>\n\n<p>A universal engine supporting <strong>seven<\/strong> OpenAI-compatible API providers through a single, unified interface:<\/p>\n\n<ul>\n<li><strong>OpenAI<\/strong> \u2014 GPT-4o Mini, GPT-4o, GPT-4.1, o4-mini, GPT-4 Turbo<\/li>\n<li><strong>Azure OpenAI<\/strong> \u2014 Bring your own deployment endpoint<\/li>\n<li><strong>Groq<\/strong> \u2014 Ultra-fast inference with generous free tier (Llama 4, Mixtral, Gemma)<\/li>\n<li><strong>Together AI<\/strong> \u2014 Open-source model hosting (Llama 4, DeepSeek V3, Qwen3)<\/li>\n<li><strong>OpenRouter<\/strong> \u2014 Multi-provider routing (access OpenAI, Anthropic, Google models)<\/li>\n<li><strong>Ollama<\/strong> \u2014 Run locally, zero API cost (Llama 3.2, Qwen3, Mistral, Gemma 3)<\/li>\n<li><strong>Custom<\/strong> \u2014 Any OpenAI-compatible endpoint you provide<\/li>\n<\/ul>\n\n<p>Each platform preset includes curated model suggestions, platform-specific descriptions, and automatic API configuration. The model input supports both free-form text entry and one-click suggestion chips \u2014 type any model name or click to select.<\/p>\n\n<h4>DeepSeek AI<\/h4>\n\n<p>DeepSeek V4 Flash for fast, affordable translations and V4 Pro for professional-grade quality. Optimized with thinking disabled for faster throughput and lower cost.<\/p>\n\n<h4>ZhiPu AI GLM<\/h4>\n\n<p>Six translation strategies: General, Paraphrase, Two Step, Three Step, Reflection, and Chain of Thought. Choose speed or depth depending on your content.<\/p>\n\n<p><strong>Key Features:<\/strong><\/p>\n\n<ul>\n<li><strong>Industry \/ Domain Description<\/strong> \u2014 Describe your site's context once (industry, tone, terminology rules) and it's injected into every translation request for consistent, accurate output across all engines<\/li>\n<li><strong>Three-layer context system<\/strong> \u2014 Sliding-window surrounding strings, page-level key term extraction, and industry prompt for terminology consistency<\/li>\n<li><strong>Parallel async translation<\/strong> \u2014 All chunks dispatched simultaneously via cURL multi-handle for maximum speed<\/li>\n<li><strong>Two-round retry logic<\/strong> \u2014 Failed strings automatically retried in a second pass with lower temperature for maximum completeness<\/li>\n<li><strong>Intelligent caching<\/strong> \u2014 30-minute transient cache per chunk for instant repeat translations<\/li>\n<li><strong>Adaptive chunk sizing<\/strong> \u2014 Chunk size auto-adjusted based on average string length per page<\/li>\n<li><strong>Platform-aware configuration<\/strong> \u2014 Timeout, temperature, and chunk size tuned per model family via heuristic detection<\/li>\n<li><strong>Native TranslatePress integration<\/strong> \u2014 Settings panel styled to blend seamlessly with TranslatePress's own UI, with smooth CSS transitions<\/li>\n<li><strong>Code security<\/strong> \u2014 All inputs sanitized, outputs escaped, nonces verified, SSL enforced, following WordPress best practices<\/li>\n<\/ul>\n\n<h3>External Services<\/h3>\n\n<p>This plugin connects to external AI translation services to provide automatic translation functionality. The following third-party services are used:<\/p>\n\n<p><strong>Google Gemini AI<\/strong>\n- Service: Google AI Studio API (https:\/\/aistudio.google.com\/)\n- Purpose: AI-powered text translation using Google Gemini models\n- Data sent: Text content to be translated, source and target language codes\n- When: Only when Gemini is selected as the translation engine and translation is requested\n- Privacy Policy: https:\/\/policies.google.com\/privacy\n- Terms of Service: https:\/\/policies.google.com\/terms<\/p>\n\n<p><strong>OpenAI Compatible Platform<\/strong>\n- Services: OpenAI (https:\/\/api.openai.com\/), Azure OpenAI, Groq (https:\/\/api.groq.com\/), Together AI (https:\/\/api.together.xyz\/), OpenRouter (https:\/\/openrouter.ai\/), Ollama (local)\n- Purpose: AI-powered text translation using various OpenAI-compatible models\n- Data sent: Text content to be translated, source and target language codes\n- When: Only when OpenAI Compatible is selected as the translation engine and translation is requested\n- OpenAI Privacy Policy: https:\/\/openai.com\/privacy\/\n- OpenAI Terms of Service: https:\/\/openai.com\/terms\/\n- Groq Privacy Policy: https:\/\/groq.com\/privacy\/\n- Together AI Privacy Policy: https:\/\/www.together.ai\/privacy\n- OpenRouter Privacy Policy: https:\/\/openrouter.ai\/privacy<\/p>\n\n<p><strong>DeepSeek AI<\/strong>\n- Service: DeepSeek API (https:\/\/api.deepseek.com\/)\n- Purpose: AI-powered text translation using DeepSeek models\n- Data sent: Text content to be translated, source and target language codes\n- When: Only when DeepSeek is selected as the translation engine and translation is requested\n- Privacy Policy: https:\/\/platform.deepseek.com\/privacy\n- Terms of Service: https:\/\/platform.deepseek.com\/terms<\/p>\n\n<p><strong>ZhiPu AI GLM<\/strong>\n- Service: ZhiPu AI API (https:\/\/bigmodel.cn\/)\n- Purpose: AI-powered text translation using ZhiPu GLM models\n- Data sent: Text content to be translated, source and target language codes\n- When: Only when ZhiPu is selected as the translation engine and translation is requested\n- Privacy Policy: https:\/\/www.zhipuai.cn\/privacy\n- Terms of Service: https:\/\/www.zhipuai.cn\/terms<\/p>\n\n<p><strong>Important Notes:<\/strong>\n- No data is sent to external services unless you explicitly configure and use one of these translation engines\n- All API communications are made over secure HTTPS connections\n- No personal user data is collected or transmitted \u2014 only the text content you choose to translate\n- You are responsible for complying with the terms of service and privacy policies of the services you choose to use<\/p>\n\n<h3>License<\/h3>\n\n<p>This plugin is licensed under the GPLv2 or later. You are free to use, modify, and redistribute it under the terms of the GNU General Public License.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Make sure the <a href=\"https:\/\/wordpress.org\/plugins\/translatepress-multilingual\/\">TranslatePress<\/a> plugin is installed and activated.<\/li>\n<li>Upload the plugin to the <code>\/wp-content\/plugins\/hhg-for-translatepress\/<\/code> directory, or install via the WordPress plugin uploader.<\/li>\n<li>Activate \"HHG for TranslatePress\" from the Plugins page.<\/li>\n<li>Go to <strong>Settings \u2192 TranslatePress \u2192 Automatic Translation<\/strong>, select your preferred AI translation engine, configure your API key and model, and save.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"which%20translation%20engine%20should%20i%20choose%3F\"><h3>Which translation engine should I choose?<\/h3><\/dt>\n<dd><ul>\n<li><strong>Gemini 2.5 Flash<\/strong> \u2014 Best all-around choice: fast, accurate, affordable<\/li>\n<li><strong>OpenAI GPT-4o Mini<\/strong> \u2014 Excellent quality, widely available<\/li>\n<li><strong>DeepSeek V4 Flash<\/strong> \u2014 Great value, very fast<\/li>\n<li><strong>Ollama<\/strong> \u2014 Free, runs locally, no API key needed<\/li>\n<li><strong>Groq<\/strong> \u2014 Ultra-fast with generous free tier<\/li>\n<\/ul><\/dd>\n<dt id=\"do%20i%20need%20the%20translatepress%20plugin%3F\"><h3>Do I need the TranslatePress plugin?<\/h3><\/dt>\n<dd><p>Yes. HHG for TranslatePress is an add-on that requires TranslatePress \u2014 Multilingual to be installed and activated first.<\/p><\/dd>\n<dt id=\"do%20i%20need%20the%20translatepress%20business%20version%3F\"><h3>Do I need the TranslatePress Business version?<\/h3><\/dt>\n<dd><p>No. This plugin works with the free version of TranslatePress. No paid add-ons required.<\/p><\/dd>\n<dt id=\"how%20do%20i%20get%20an%20api%20key%3F\"><h3>How do I get an API key?<\/h3><\/dt>\n<dd><p>Visit the respective platform's website: Google AI Studio for Gemini, OpenAI Platform for GPT, DeepSeek Platform for DeepSeek, or ZhiPu AI Open Platform for GLM. Links are provided on each engine's settings panel.<\/p><\/dd>\n<dt id=\"can%20i%20use%20my%20own%20model%20or%20endpoint%3F\"><h3>Can I use my own model or endpoint?<\/h3><\/dt>\n<dd><p>Yes. The OpenAI Compatible engine includes a \"Custom\" platform preset where you can enter any OpenAI-compatible API endpoint and model name. The model input accepts free-form text \u2014 you are not limited to the suggestion list.<\/p><\/dd>\n<dt id=\"can%20i%20run%20translations%20locally%20without%20an%20api%20key%3F\"><h3>Can I run translations locally without an API key?<\/h3><\/dt>\n<dd><p>Yes. Select \"OpenAI Compatible\" as the engine, choose \"Ollama\" as the platform, and point it to your local Ollama instance. No API key or internet connection required for the translation itself.<\/p><\/dd>\n<dt id=\"is%20the%20plugin%20secure%3F\"><h3>Is the plugin secure?<\/h3><\/dt>\n<dd><p>All inputs are sanitized, all outputs are properly escaped, API keys are stored in WordPress options, nonce verification is enforced on AJAX endpoints, and all API communication uses HTTPS with SSL verification enabled. The plugin follows WordPress coding standards and security best practices.<\/p><\/dd>\n<dt id=\"will%20my%20existing%20translations%20be%20overwritten%3F\"><h3>Will my existing translations be overwritten?<\/h3><\/dt>\n<dd><p>No. The plugin respects TranslatePress's manual translation priority. Only untranslated strings are sent for automatic translation.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>OpenAI: Redesigned as universal OpenAI-compatible platform supporting 7 presets (OpenAI, Azure, Groq, Together AI, OpenRouter, Ollama, Custom)<\/li>\n<li>OpenAI: Editable model input with datalist suggestions and clickable model chips<\/li>\n<li>OpenAI: Dynamic endpoint field that shows\/hides based on platform selection<\/li>\n<li>OpenAI: Platform-aware config (timeout, chunk size, temperature) via model heuristics<\/li>\n<li>DeepSeek: Upgraded to V4 models (Flash &amp; Pro) with thinking disabled for speed<\/li>\n<li>Gemini: Added 2.5 Flash-Lite and 3 Flash Preview models<\/li>\n<li>Industry Prompt: Redesigned as styled card, now auto-hides for non-HHG engines via JS<\/li>\n<li>Industry Prompt: Injected into every translation request for terminology consistency<\/li>\n<li>Context Builder: Three-layer context system (industry, page-level key terms, sliding window)<\/li>\n<li>All Engines: Parallel async translation via cURL multi-handle for maximum speed<\/li>\n<li>All Engines: Two-round retry logic for failed strings with lower temperature<\/li>\n<li>All Engines: 30-minute transient cache per chunk for instant repeat translations<\/li>\n<li>All Engines: Adaptive chunk sizing based on average string length<\/li>\n<li>Security: Added null-safety checks for machine_translator across all settings methods<\/li>\n<li>Security: Fixed missing logger guard in Gemini\/DeepSeek async Round 1 paths<\/li>\n<li>Bug Fix: Zhipu mixed cached\/uncached chunks now correctly dispatch async requests<\/li>\n<li>Bug Fix: Removed dead code (ensure_engine_switch, force_active_engine_instance)<\/li>\n<li>Internationalization: Gemini error messages now properly translatable<\/li>\n<li>Code Quality: Removed redundant Hunyuan references throughout<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Zhipu GLM: Fix fallback to mtapi by overriding engine class mapping and forcing availability<\/li>\n<li>Zhipu GLM: Use source_lang=auto, standardize target language codes (zh_CN\u2192zh-CN, zh_TW\u2192zh-TW, en_US\u2192en, ru_RU\u2192ru)<\/li>\n<li>Zhipu GLM: Response parser compatible with both agent and standard chat completions formats<\/li>\n<li>Zhipu GLM: Add second-pass retry for missing items in a batch<\/li>\n<li>Zhipu GLM: Cache only full-success batches to avoid partial-cache issues<\/li>\n<li>Zhipu GLM: Add HTTP\/2, gzip, TCP_NODELAY optimizations<\/li>\n<li>OpenAI: Parallelize batch requests, add second-pass retry for missing items<\/li>\n<li>DeepSeek: Initial engine implementation replacing Hunyuan<\/li>\n<li>DeepSeek: Switch to ChatTranslations API with TC3-HMAC-SHA256 signature<\/li>\n<li>Stability: Fix direct write to protected TP property causing fatal error<\/li>\n<li>Stability: Fix missing includes paths for logger\/cache with existence checks<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Fix various functions and improve compatibility<\/li>\n<li>Remove business version force loading<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Add ZhiPu AI GLM support with multiple translation strategies<\/li>\n<li>Fix ZhiPu API key saving<\/li>\n<li>Fix \"Undefined array key\" warning in front-end translation<\/li>\n<li>Optimize API call parameters with concurrency support<\/li>\n<li>Unify settings interface across all engines<\/li>\n<li>Improve error handling and API test function<\/li>\n<li>Code security hardening per WordPress standards<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Add OpenAI support with custom models and API Endpoint<\/li>\n<li>Optimize Gemini and Hunyuan interface and compatibility<\/li>\n<li>Fix settings saving, API testing, and batch translation issues<\/li>\n<li>Code security enhancement, remove unused files<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release with Google Gemini and Tencent Hunyuan support<\/li>\n<li>Multi-model selection and API key configuration<\/li>\n<li>Batch translation with error handling<\/li>\n<\/ul>","raw_excerpt":"Add powerful AI translation engines to TranslatePress \u2014 Google Gemini, OpenAI, DeepSeek, and ZhiPu GLM with multi-model support.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/243345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=243345"}],"author":[{"embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gwuluo"}],"wp:attachment":[{"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=243345"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=243345"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=243345"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=243345"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=243345"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/li.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=243345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}