Discover and explore top open-source AI tools and projects—updated daily.
kargnasAI-powered translation for Laravel language files
Top 100.0% on SourcePulse
kargnas/laravel-ai-translator
This package automates the translation of Laravel language files using AI models like Claude, GPT, and Gemini, significantly reducing manual effort and improving translation quality. It targets Laravel developers seeking to streamline internationalization, offering context-aware translations and advanced management features for language assets.
How It Works
The tool leverages various AI providers (Anthropic Claude, OpenAI GPT, Google Gemini) to translate PHP and JSON language files. It analyzes translation keys for context, preserving variables, HTML tags, and pluralization rules. Advanced features include detecting and removing unused translation keys, cleaning existing translations, and supporting custom language styles for unique localization needs. Translations can be processed in parallel for efficiency.
Quick Start & Requirements
composer require kargnas/laravel-ai-translatorphp artisan vendor:publish), set AI provider API keys (Anthropic, OpenAI, or Gemini) in .env, and configure config/ai-translator.php.php artisan ai-translator:translate, php artisan ai-translator:translate-parallel, php artisan ai-translator:find-unused, php artisan ai-translator:clean, and php artisan ai-translator:translate-json.Highlighted Details
find-unused command to scan code (PHP, JS, Vue, Blade) and remove obsolete translation keys, with automatic backups.clean command to remove translations from locale files, preparing them for re-translation.Maintenance & Community
Created by Sangrak Choi. The repository includes links to articles by the creator discussing localization and the tool's development. No specific community channels (like Discord/Slack) or sponsorship details are listed in the README.
Licensing & Compatibility
Licensed under the MIT License (MIT), permitting commercial use and integration into closed-source projects.
Limitations & Caveats
The TODO list indicates planned improvements for strict translation validation (variables, pluralization) and replacing the regex-based XML parser. While OpenAI and Gemini are supported, the documentation strongly advises against using OpenAI for translations due to consistently inferior results compared to Claude.
5 months ago
1+ week