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.
text('key', 'value')).__() helper."Laratext is a game-changer for our global expansion plans. It automates 80% of our translation workflow using AI, cutting costs and time-to-market for new languages. For example, launching Spanish support could take days instead of weeks—while maintaining consistency. The package integrates seamlessly with our Laravel stack, so no new infrastructure is needed. We’ll start with OpenAI’s cost-effective models, with the option to scale to professional translators later for critical content. This aligns with our goal to serve [X]% of non-English users by [date]."
Key Metrics to Highlight:
languages: ['es', 'fr']).*"Laratext solves two major pain points:
Welcome → Welcome to our site) and updates all languages.__('key') with text('key', 'value')—self-documenting code that’s easier to search and refactor. The @text Blade directive keeps views clean.How It Works:
php artisan laratext:scan --write to auto-generate missing translations (e.g., Spanish, French) using OpenAI/Google.make:translator in 10 minutes.Migration Path:
--only-missing to translate new keys only (safe mode).--write for full automation.--prune to clean up orphaned keys post-refactor.Dependencies:
Trade-offs:
Next Steps:
How can I help you explore Laravel packages today?