Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Lingua Laravel Package

rivalex/lingua

Database-driven translations for Laravel with a polished Livewire + Flux admin UI. Install and manage languages, edit strings in real time, and sync translations both ways between DB and PHP/JSON files via artisan commands. Supports Laravel 11–13, PHP 8.3+.

View on GitHub
Deep Wiki
Context7

Self-hosted Laravel translation manager for the TALL stack: edit, sync, import/export and AI-translate your i18n / l10n language files via a Livewire UI. Database & file drivers, vendor translations, CSV/JSON/XLSX/ODS. A native alternative to laravel-lang and external services.

Frequently asked questions about Lingua
How do I migrate existing JSON/PHP translations to Lingua’s database without downtime?
Use the `lingua:sync-to-database` artisan command to import existing files into the database. For zero-downtime migrations, run this in a staging environment first, then sync to production. The package handles nested arrays and dynamic keys, but test edge cases like custom translation logic (e.g., `trans_choice`) beforehand. Always back up your files before syncing.
Does Lingua work with Laravel 13’s new features like Livewire 4.0 or Flux 2.0?
Yes, Lingua is fully compatible with Laravel 13 and explicitly supports Livewire 4.0+ and Flux 2.0+. The UI leverages Flux components for a modern, reactive admin experience. No breaking changes are expected for Laravel’s latest features, as the package follows Laravel’s backward-compatibility promises for these versions.
Can I use Lingua in a multi-environment setup (dev/staging/prod) with different translation sync strategies?
Absolutely. Lingua supports environment-specific sync strategies via artisan commands. For example, sync from files to the database in staging (`lingua:sync-to-database`), then pull changes back to files in production (`lingua:sync-to-files`) during deployments. Use `.env` variables to configure drivers per environment (e.g., `LINGUA_DEFAULT_DRIVER=database` in prod, `file` in dev).
How does performance compare between database and file-based translation lookups?
Database lookups are optimized with Eloquent’s query builder and caching. For large translation sets, Lingua includes query optimizations like indexing and lazy-loading. File-based lookups (when using the `file` driver) are faster for read-heavy apps but lack real-time edit capabilities. Benchmark your use case: database is ideal for collaborative editing, while files suit static or read-only translations.
Is the AI translation feature open-source, or does it require a paid API?
The AI translation feature integrates with third-party APIs (e.g., DeepL, Google Translate) but is not bundled with Lingua. You’ll need to configure API keys via `.env` (e.g., `LINGUA_AI_PROVIDER=deepl`). Costs depend on the provider’s pricing model. The package handles rate limits and error states gracefully, but you’re responsible for managing API credentials securely.
Can I customize the Livewire UI to match my Tailwind theme or add JavaScript hooks?
Yes, Lingua’s UI is fully customizable via Blade/Livewire overrides. Publish the views with `php artisan vendor:publish --tag=lingua-views` and modify the published files in `resources/views/vendor/lingua`. For Tailwind, override the CSS variables in `resources/css/lingua.css`. JavaScript hooks can be added via Livewire’s `wire:init` or Alpine.js directives in the published Blade files.
What happens if the database sync fails mid-operation? Are there fallbacks for partial data loss?
Lingua includes transaction support for database operations to prevent partial updates. If a sync fails, the package logs detailed errors and rolls back changes. For critical backups, manually export translations via `lingua:export` before syncing. Test syncs in a staging environment first to validate your data integrity. The `file` driver acts as a fallback if database issues arise.
Does Lingua support role-based access control (RBAC) for the admin UI?
Lingua does not include built-in RBAC, but you can integrate it with Laravel’s native authorization (e.g., Gates, Policies) or packages like Spatie’s Laravel-Permission. Restrict access to `/lingua` routes using middleware like `can:manage-translations`. The UI is designed to work with Laravel’s auth system, so you can gate features like edit/delete permissions at the route or component level.
How do I handle rich-text translations (HTML/Markdown) securely to avoid XSS?
Lingua sanitizes rich-text translations by default, but you may need additional validation for complex cases. Use packages like `spatie/laravel-html` to sanitize output before rendering. Configure allowed HTML tags in `config/lingua.php` under `sanitize_html`. For Markdown, consider converting to HTML with a package like `commonmark/commonmark` and then sanitizing the result.
Are there alternatives to Lingua for Laravel translation management, and how does it compare?
Alternatives include `spatie/laravel-translation-manager` (file-based, simpler UI) and `laravel-lang` (external service integration). Lingua stands out with its database-driven approach, real-time Livewire UI, and bidirectional sync. Unlike file-based tools, it enables collaborative editing without redeploys. For AI features, Lingua offers more flexibility than hosted services, while `laravel-lang` may suit teams preferring external APIs without self-hosting.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity