edulazaro/laratext
Laratext manages and auto-translates Laravel text strings by using both key and text for readable, stable translations. Includes @text directive and text() helper, scans/updates language files, and supports OpenAI, Google Translate, and more.
key_name refers to) while preserving flexibility for dynamic content.gpt-5.4-nano) and supports batch processing to minimize API costs during bulk translations.:name) are critical.TranslatorInterface.:user_name)."Laratext automates 80% of our localization workflow, cutting translation costs by [X]% and reducing time-to-market for new languages. By integrating with OpenAI/Google Translate, we eliminate manual JSON file management—freeing up [Team Name] to focus on growth. For example, [Competitor] launches in 5 languages in 3 months; we can match that with minimal overhead. The --prune feature also cleans up stale translations, reducing storage costs. ROI: [Estimated savings from reduced dev hours/API costs]."
Key Metrics to Track:
*"Laratext solves two critical pain points:
auth.login.button means—it now stores both the key and default text (e.g., text('auth.login.button', 'Sign In')), with auto-generated fallbacks (e.g., text('user.profile') → "Profile").laratext:scan command detects:
php artisan laratext:scan --write to auto-update all languages in one command.Integration Effort:
__() helper. Replace:
__('auth.login.button') // Ambiguous
with:
text('auth.login.button') // Self-documenting
@text('key') directly in views.// config/texts.php
'default_translator' => \EduLazaro\Laratext\Translators\ClaudeTranslator::class;
DevOps Considerations:
laratext:scan --write --prune nightly.gpt-5.4-nano is ~$0.000005/token).Call to Action: "Let’s pilot this for our [Module X] with 3 languages (EN/ES/FR). If it reduces localization time by 50%, we’ll expand to all product areas."
How can I help you explore Laravel packages today?