genius-asif/laravel-lang-ai-translate
Composer 安装命令:
composer require genius-asif/laravel-lang-ai-translate
包简介
A Laravel package to automate the translation from (en) language files to other languages using LLM APIs.
关键字:
README 文档
README
Laravel Language AI Translate
Effortlessly translate your Laravel language files from English to multiple languages using powerful AI APIs like Google Gemini, OpenAI, and DeepSeek. Automate your localization workflow and reach a global audience with ease.
Key Features
- AI-Powered Translation: Leverage the capabilities of Google Gemini, OpenAI, and DeepSeek for accurate and efficient translations.
- Automated Workflow: Simplify your translation process by automating the translation of entire language files.
- Multiple Language Support: Translate to a wide range of languages supported by the integrated AI APIs.
- Easy Integration: Seamlessly integrate into your Laravel project with a simple Artisan command.
- Configurable Providers: Easily switch between different AI translation providers based on your needs and preferences.
Prerequisites
- PHP 8.3 or higher
- Laravel 11 or higher
Installation
You can install the package via Composer:
composer require genius-asif/laravel-lang-ai-translate
Publish the configuration file:
php artisan vendor:publish
This will create a config/lang-ai-translation.php file where you can configure your LLM API keys and language settings.
Configuration:
Open the config/lang-ai-translation.php file and add your API keys for the desired translation providers:
<?php return [ 'languages' => [ 'hi' => 'Hindi', 'es' => 'Spanish', 'fr' => 'French', 'ur' => 'Urdu', ], 'providers' => [ 'google_gemini' => [ 'key' => env('GOOGLE_GEMINI_API_KEY', ''), 'url' => env('GOOGLE_GEMINI_API_URL', '[https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=](https://www.google.com/search?q=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent%3Fkey%3D)' . env('GOOGLE_GEMINI_API_KEY')), ], 'openai' => [ 'key' => env('OPENAI_API_KEY', ''), 'url' => env('OPENAI_API_URL', '[https://api.openai.com/v1/chat/completions](https://api.openai.com/v1/chat/completions)'), ], 'deepseek' => [ 'key' => env('DEEPSEEK_API_KEY', ''), 'url' => env('DEEPSEEK_API_URL', '[https://api.deepseek.com/chat/completions](https://api.deepseek.com/chat/completions)'), ], ], ];
Ensure you add the corresponding API keys to your .env file.
Usage
Use the following Artisan command to translate your language files:
php artisan translate:lang
The command will prompt you to:
- Select the target language.
- Choose the AI translation provider.
The package will then automatically translate your language files from the lang/en directory to the selected language directory.
Testing
Coming soon...
Contributing
We'd love your help making the package even better! Feel free to submit a pull request or open an issue for any enhancements or bug fixes. Everyone's welcome! 🎉
Credits
License
This project is licensed under the MIT License.
genius-asif/laravel-lang-ai-translate 适用场景与选型建议
genius-asif/laravel-lang-ai-translate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「localization」 「translate」 「ai」 「Asif Shaikh」 「laravel-lang-ai-translate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 genius-asif/laravel-lang-ai-translate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 genius-asif/laravel-lang-ai-translate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 genius-asif/laravel-lang-ai-translate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use i18n translation PHP class for multi-language websites
Package for convenient work with Laravel's localization features
Field for number with restricted count of digits and decimal places
Store your language lines in the database, yaml or other sources
An Astrotomic Translatable extension for Laravel Nova.
Deepl Automated translations for Laravel lang files
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-02

