定制 nativemind/module-translation 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nativemind/module-translation

Composer 安装命令:

composer require nativemind/module-translation

包简介

Advanced translation module for Magento 2 with Google Translate and OpenAI integration. v2.0 includes comprehensive Admin API, queue management system, and React microservice for translation administration.

README 文档

README

Latest Stable Version License Total Downloads

Advanced translation module for Magento 2 with Google Translate and OpenAI GPT integration. Automatically translate products, categories, and other content with AI-powered translation services.

Features

🔄 Automatic Translation

  • Products (names, descriptions, short descriptions)
  • Categories (names and descriptions)
  • Meta data (SEO titles and descriptions)
  • Custom attributes

🌍 Multi-language Support

  • 100+ languages supported
  • Auto-detect source language
  • Store-specific language configuration
  • Fallback to original content

🤖 AI Translation Services

  • Google Translate API: Fast and accurate translation
  • OpenAI GPT: Contextual translation with semantic understanding
  • Custom prompts: Control translation quality
  • Batch processing: Bulk content translation

Performance

  • Translation caching
  • Asynchronous processing
  • API rate limiting
  • High-load optimization

🎛️ Management

  • Complete admin panel
  • Console commands for DevOps
  • Statistics and monitoring
  • Operation logging

Installation

Via Composer (Recommended)

composer require nativemind/module-translation
php bin/magento module:enable NativeMind_Translation
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

Manual Installation

# 1. Download and extract module
mkdir -p app/code/NativeMind/Translation
# Extract module files to app/code/NativeMind/Translation

# 2. Enable module
php bin/magento module:enable NativeMind_Translation
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

Configuration

  1. Navigate to StoresConfigurationNativeLangTranslation Settings
  2. Choose translation service (Google Translate or OpenAI)
  3. Add your API keys
  4. Configure attributes for translation
  5. Enable auto-translation

Google Translate Setup

# Get your Google Cloud API key from:
# https://console.cloud.google.com/apis/credentials

OpenAI Setup

# Get your OpenAI API key from:
# https://platform.openai.com/api-keys

Usage

Console Commands

# Translate all products
php bin/magento nativemind:translate:products

# Translate specific products
php bin/magento nativemind:translate:products --product-ids="1,2,3"

# Translate for specific stores
php bin/magento nativemind:translate:products --store-ids="2,3,4"

# Force translation (overwrite existing)
php bin/magento nativemind:translate:products --force

# Translate categories
php bin/magento nativemind:translate:categories

PHP API

use NativeMind\Translation\Helper\Data as TranslationHelper;

// Initialize
$translationHelper = $this->translationHelper;

// Simple translation
$translated = $translationHelper->translateText(
    'Hello World', 
    'ru_RU', 
    $storeId
);

// Translate array
$data = ['title' => 'Product Title', 'description' => 'Product Description'];
$translated = $translationHelper->translateArray($data, 'ru_RU');

REST API Endpoints

GET    /rest/V1/nativelang/config          # Get configuration
POST   /rest/V1/nativelang/translate       # Translate text
GET    /rest/V1/nativelang/status/:id      # Translation status
POST   /rest/V1/nativelang/products/batch  # Bulk translate products

Requirements

  • PHP >= 7.4
  • Magento >= 2.4.0
  • ext-curl (for API calls)
  • ext-json (for JSON handling)

Compatibility

Magento Version Module Version
2.4.x 1.0.x
2.3.x 1.0.x

Support

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

v2.0.0 🚀 (Production Ready - 100% Complete)

  • Database Layer: 5 new tables for history, logs, cache, queue, and API tracking
  • Performance: 95% faster with persistent caching
  • cURL Integration: Replaced file_get_contents with proper cURL + timeouts
  • Retry Mechanism: 3 attempts with exponential backoff
  • Message Queue: Full async processing support (RabbitMQ/MySQL)
  • Cron Jobs: Automated cache/queue maintenance
  • Real API Tracking: Cost monitoring and usage stats
  • Enhanced UI: Translation history, categories grid, enhanced products grid
  • 90% API Cost Reduction: Through intelligent caching
  • Unit Tests: 65+ tests with 87% code coverage

📖 View Full Upgrade Guide | 📊 Production Ready Report | 🧪 Testing Report

v1.0.2

  • Translation status and date tracking
  • Product attribute enhancements

v1.0.1

  • Translation status attribute

v1.0.0

  • Initial release
  • Google Translate integration
  • OpenAI GPT integration
  • Product and category translation
  • Admin panel interface
  • Console commands
  • REST API endpoints

If this project helps you, please give it a star!

nativemind/module-translation 适用场景与选型建议

nativemind/module-translation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「i18n」 「translation」 「localization」 「multilingual」 「google-translate」 「magento2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 nativemind/module-translation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nativemind/module-translation 我们能提供哪些服务?
定制开发 / 二次开发

基于 nativemind/module-translation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 25
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: NativeMindNONC
  • 更新时间: 2025-09-21