Download the PHP package rivalex/lingua without Composer

On this page you can find all versions of the php package rivalex/lingua. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lingua

--- ### **The complete multilingual management system for Laravel** [![Latest Version on Packagist](https://img.shields.io/packagist/v/rivalex/lingua.svg)](https://packagist.org/packages/rivalex/lingua) [![PHP Version](https://img.shields.io/badge/PHP-8.3%2B-blue)](https://php.net) [![Laravel Version](https://img.shields.io/badge/Laravel-11--13-orange)](https://laravel.com) [![License](https://img.shields.io/github/license/rivalex/lingua)](LICENSE.md) [![codecov](https://codecov.io/github/rivalex/lingua/branch/main/graph/badge.svg?token=9RKRB8AYD6)](https://codecov.io/github/rivalex/lingua) [![Tests](https://github.com/rivalex/lingua/actions/workflows/run-tests.yml/badge.svg)](https://github.com/rivalex/lingua/actions/workflows/run-tests.yml)

**Lingua** is a self-hosted translation management package for Laravel — a native, database-driven alternative to tools like Weblate, Locize, Lokalise, Crowdin, and SimpleLocalize, and a drop-in replacement for `spatie/laravel-translation-loader` and `laravel-lang/common`. If you need to manage translations in a Laravel application without depending on an external SaaS or downloading third-party language packages, Lingua gives you a complete Livewire admin UI to edit, organize, import, export, and synchronize your i18n / l10n strings directly inside your app. Built on the TALL stack (Tailwind, Alpine, Livewire), Lingua stores translations in either your **database** or your native `lang/` **files** — switchable with a single config value. It ships a bundled dataset of 26 locales aligned to Laravel 13 (no `laravel-lang` required), handles published vendor translations safely, supports **CSV, JSON, XLSX, and ODS** import/export with a mandatory dry-run preview, offers full RTL support, and can optionally AI-translate missing strings via Lingua Pro. Built for **Laravel 11–13, Livewire 4, and PHP 8.3+**. [Features](#-features) · [Installation](#-installation) · [Configuration](#-configuration) · [Storage Drivers](#-storage-drivers) · [Artisan Commands](#-artisan-commands) · [Publishing](#-publishing) · [UI Guide](#-ui-guide) · [Import / Export](#-import--export) · [Language Selector](#-language-selector) · [Facade](#-lingua-facade) · [Architecture](#-architecture) · [Lingua Pro](#-lingua-pro)

## [Official Documentation](https://rivalex.github.io/lingua-docs/)

✨ Features

Feature Description
Database-backed translations All translations stored in the database, editable instantly without deployments
File-mode driver Optional file-mode stores translations directly in lang/ PHP/JSON files — no database required
Livewire UI Reactive, real-time language and translation management interface
Flux UI components Modern, accessible UI built with Livewire Flux
Bi-directional sync Push translations to the database or pull them back to local PHP/JSON files
Import / Export Export and import translations as CSV, JSON, XLSX, or ODS; bilingual and multi-locale scopes
Bundled translation dataset 26 locales × 7 groups (5 902 strings) aligned to Laravel 13 — provisioned at locale install-time
Rich text support Translations can be plain text, HTML, or Markdown
Language selector Configurable sidebar, dropdown, modal, or headless language switcher
Translation statistics Per-language coverage with progress bars, group breakdown, and missing-key drill-down
Shared navigation menu Built-in nav bar on all admin pages; active-page highlighting; toggleable
Force dark mode Render Lingua's dark theme regardless of host app / OS color scheme — config or Settings UI
DB-persisted settings Selector mode, flags, nav, editor toolbar managed from the UI
Headless language selector Zero-CSS semantic HTML component for full styling freedom
RTL support First-class right-to-left language handling
Vendor translations Manage package translations alongside your own
Authorization gate Role-based access control via LINGUA_GATE env and Laravel Gates
Database-agnostic Full support for SQLite, MySQL, PostgreSQL, and SQL Server
Safe uninstall lingua:uninstall exports translations before removing tables and published files
Lingua Facade Fluent programmatic API for reading, writing, and managing languages and translations
Flexible routing Route prefix/suffix config, optional gate, layout override, wire:navigate toggle
Lingua Pro Optional add-on: AI translation, translation memory, glossary, usage analytics
Fully tested 780+ tests with Pest, covering commands, Livewire components, Blade, helpers, and facade

📦 Requirements

Optional:


🚀 Installation

1. Install via Composer

2. Run the interactive installer

The installer will:

After installation, set LINGUA_STORAGE_DRIVER=database (or file) in your .env and run php artisan config:clear.

3. Access the UI

Page URL Route name
Languages your-app.test/lingua/languages lingua.languages
Translations your-app.test/lingua/translations/{locale?} lingua.translations
Statistics your-app.test/lingua/statistics lingua.statistics
Settings your-app.test/lingua/settings lingua.settings
Transfer your-app.test/lingua/transfer lingua.transfer

⚙️ Configuration

After installation, config/lingua.php gives you full control:

Environment variables

Variable Default Description
LINGUA_STORAGE_DRIVER database Storage driver: database or file
LINGUA_GATE null Laravel Gate name for admin authorization
LINGUA_CACHE_STORE null Cache store (null = app default)
LINGUA_CACHE_PREFIX lingua.trans Cache key prefix
LINGUA_FORCE_DARK_MODE false Force Lingua's dark theme regardless of host app / OS color scheme
LINGUA_SUPPRESS_PRO_NUDGE false Hide the Lingua Pro upgrade prompt
LINGUA_PRO_UPGRADE_URL https://lingua.rivalex.dev Pro upgrade link shown in admin UI
LINGUA_EXTENSIONS_ENABLED true Enable/disable the extension system

💾 Storage Drivers

Lingua supports two storage backends, selectable at install time or switched later.

database (recommended)

file

Switching drivers

Or set the env variable directly:

Then run php artisan config:clear.

Options for lingua:storage:

Option Description
--force Skip confirmation prompts
--write-env Automatically update LINGUA_STORAGE_DRIVER in your .env file
--no-migrate Skip running migrations when switching to database driver

File-mode deploy caveat: In CI/CD pipelines, lang/ files are typically checked in to version control. Any translation edited in the Lingua UI will modify those files. Ensure your deployment pipeline does not overwrite them with stale copies. HTML and Markdown translation types will be lost when switching from database to file mode, as file-based drivers store only plain text.


🛠 Artisan Commands

Lingua ships with a complete command suite for terminal-driven language and translation management.

Language management

Command Description
lingua:add {locale} Install a new language: creates DB/file record, seeds bundled translations
lingua:remove {locale} Remove a language: deletes record and cleans up storage
lingua:update-lang Re-sync translations for all installed locales

Note: lingua:add and lingua:remove are DB-native — they do not use laravel-lang. The bundled dataset provides translations for 26 locales automatically. Lingua does not require or download any external language packages.

Translation sync

Command Description
lingua:sync-to-database Import all local lang/ PHP/JSON files into the database
lingua:sync-to-local [--force] Export database translations to lang/ files (--force overrides file-mode no-op guard)

Setup & maintenance

Command Description
lingua:install Interactive first-time setup wizard
lingua:storage {driver} [options] Switch storage driver between database and file
lingua:uninstall [options] Safely remove Lingua (exports translations first)

lingua:install

Interactive setup wizard. Prompts for driver selection (arrow-key), publishes config, publishes driver-aware migrations, optionally runs them, and seeds default language data.

lingua:storage {driver}

Switch between database and file storage without data loss. Syncs translations before switching and warns on HTML/Markdown type-loss when moving to file mode.

Option Description
--force Skip confirmation prompts
--write-env Update LINGUA_STORAGE_DRIVER in .env automatically
--no-migrate Skip running migrations (database driver switch only)

lingua:uninstall

Exports all translations to lang/ files first, then drops the three Lingua database tables and removes published files. Your lang/ directory is always preserved.

Option Description
--force Skip confirmation prompts
--keep-config Do not delete config/lingua.php
--keep-published Do not delete published views and translations

📤 Publishing

Lingua ships several publishable groups so you can override only what you need.

Publish everything at once

Publish individual tags

lingua-config

Publishes the configuration file to config/lingua.php.

Use this when you want to customise routes, middleware, the language selector mode, the rich-text editor toolbar, or any other package option. The file is well-commented and safe to edit — Lingua reads it on every request.


lingua-migrations

Publishes the database migrations to database/migrations/.

Driver-aware: file mode only publishes the languages and lingua_settings table migrations (skips language_lines). Use this when you need to modify the schema — for example to add indexes or change column types. After publishing, run php artisan migrate as normal.

Note: The lingua:install wizard publishes and runs the migrations automatically. Only publish manually if you need to customise the schema before running them.


lingua-translations

Publishes the package's own UI translation strings to lang/vendor/lingua/.

This exposes all the labels, headings, buttons, and messages used in the Lingua admin UI. The admin interface is localised in 9 languages: Arabic, English, Spanish, French, Hindi, Italian, Portuguese, Russian, and Chinese ( Simplified). Override any string to adapt the wording to your project's style.


lingua-views

Publishes all Blade and Livewire views to resources/views/vendor/lingua/.

The full view tree is:

Tip: Only publish views you intend to change. Unpublished views are served directly from the package and will receive upstream updates automatically.


Re-publishing after upgrades

After updating Lingua via Composer, re-publish any tags that may have changed:

The --force flag overwrites existing files. Omit it for views and config so your local customisations are not lost.

Note: Compiled CSS and JavaScript assets are served directly from the package via Lingua's own asset route ( lingua.assets). Publishing assets to public/ is not required.


🖥 UI Guide

Languages page — /lingua/languages

The languages page is your control center for installed locales.

Available actions:

Each language row shows the completion percentage and a count of missing translations so you can prioritise your translation effort. Sync buttons are hidden in file mode.

Translations page — /lingua/translations/{locale?}

Manage individual translation strings with a filterable, paginated table.

Available actions:

The filter bar is sticky with a configurable top offset (ui.sticky_top) for apps with a fixed header.

Statistics page — /lingua/statistics

The statistics page gives you a bird's-eye view of your translation coverage.

What it shows:

Settings page — /lingua/settings

The settings page lets you configure Lingua's UI behaviour without touching config files or redeploying.

What you can configure:

Settings are stored in the lingua_settings database table and take effect immediately. Values from config/lingua.php serve as fallback when no database setting has been saved.

Transfer page — /lingua/transfer

The transfer page provides file-based import and export of translation data.

See Import / Export for full details.


RTL / LTR text direction

Some languages (Arabic, Hebrew, Persian, Urdu, …) are written right-to-left. Lingua stores the text direction for every installed language and exposes it via Lingua::getDirection(). Add dir and lang attributes to your main Blade layout:

Lingua::getDirection() returns 'rtl' for right-to-left languages and 'ltr' for all others. Pass an explicit locale when needed:

Tailwind CSS

The dir attribute on <html> activates Tailwind's built-in rtl: variant automatically:

Checking direction in Blade

Note: Lingua::getDirection() defaults to 'ltr' if the locale is not found, so it is always safe to call even before any language is installed.

Flux UI Assets

Lingua uses Flux UI for its interface. Include Flux assets in your application layout:


📦 Import / Export

The Transfer page (/lingua/transfer) provides Livewire-powered export and import of translation data.

Export

Three export scopes:

Scope Description
Bilingual Source strings + one target locale (two columns)
Multi-locale Source + all installed locales (one column per locale)
JSON-native Raw key/value JSON without a source column

Four export formats:

Format Dependencies
CSV Built-in — no extra packages
JSON Built-in — no extra packages
XLSX Requires openspout/openspout
ODS Requires openspout/openspout

Formula-injection guard: cells starting with = + - @ are automatically prefixed with ' in all spreadsheet formats to prevent formula execution.

Import

The import flow is a two-step process:

  1. Upload — select your file; Lingua runs a dry-run analysis and shows a preview: create / update / skip / error counts and a capped row-by-row diff
  2. Review & confirm — inspect the diff, then commit when ready

Import behavior:


🌐 Language Selector

Embed a language switcher anywhere in your Blade layouts:

Control the display mode via config or inline props:

The selector reads the active mode and flag preference from the database (configurable in the Settings page). The :mode and :show-flags props override the database setting for a specific instance.

Headless mode

The headless selector renders zero CSS and no framework-specific markup — just semantic HTML that you style entirely with your own CSS or utility classes.

Named slots:

Override individual language items using the $item slot (receives the Language model):

Override the currently selected language with the $current slot (falls through to $item if not provided):

*CSS targeting API (`data-lingua-` attributes):**

Attribute Element
data-lingua-selector Root <nav> element
data-lingua-list The <ul> language list
data-lingua-item Each <li> language entry
data-lingua-active The <li> of the active language
data-lingua-button The <button> inside each <li>
data-lingua-name Language English display name <span>
data-lingua-native Language native name <span>
data-lingua-code Language ISO code <span>

Plain CSS example:

Tailwind CSS example:


💎 Lingua Facade

Lingua ships a static Lingua facade that gives you programmatic access to language and translation data from anywhere in your application.

Locale helpers

Availability checks

Language models

Translation statistics

Reading translations

Writing & deleting translations

Vendor translations

Language lifecycle

Note: addLanguage() and removeLanguage() manage the Language record and storage. Use the Artisan commands lingua:add / lingua:remove for the fully orchestrated operation (record + storage + cache invalidation).

Sync

Note: Lingua::optimize() is deprecated — surgical cache invalidation per (locale, group) pair makes it unnecessary.


🏗 Architecture

How translations are stored

In database mode, Lingua stores translations in the language_lines table. Each row holds all locales in a single JSON text column, eliminating the need for per-locale rows:

This design allows instant locale switching at runtime without additional queries per language.

Storage abstraction

Lingua defines a TranslationRepository contract with two implementations:

Implementation Driver Description
DatabaseRepository database Reads/writes language_lines; supports HTML/Markdown types, vendor guard, statistics
FileRepository file Reads/writes lang/ PHP/JSON files; types flattened to plain text

Bundled translation dataset

Lingua ships a bundled dataset of 5 902 strings across 26 locales and 7 translation groups (auth, pagination, passwords, validation, http-statuses, errors, notifications), aligned to Laravel v13.14.0. The dataset is read by BundledTranslationSource at locale install-time and merged into the database or lang/ files during syncToDatabase() and installLocale(). Notification strings are projected into lang/{locale}.json by NotificationProjector.

Bundled locales: Arabic, German, English, Spanish, Persian, French, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Malay, Norwegian Bokmål, Dutch, Polish, Portuguese, Brazilian Portuguese, Romanian, Russian, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Chinese (Simplified).

This replaces the need for laravel-lang or any external language package.

Translation loading at runtime

LinguaManager extends Laravel's built-in FileLoader and is registered via extend() on the translation.loader binding. At runtime it merges:

  1. File-based translations from lang/ (via FileLoader)
  2. Database translations via the Db loader (Rivalex\Lingua\Database\Db)

Database translations take precedence over file translations. All translations are cached per (locale, group) pair via Cache::rememberForever. Cache is invalidated surgically on model save/delete — no full-cache flush required.

Translation types

Each string is classified automatically during sync:

Type Use case Auto-detected when…
text Plain strings, labels, messages Default
html Rich content with HTML markup String contains HTML tags
markdown Markdown-formatted content String parses as Markdown

The type drives which editor is shown in the Translations UI. Types are preserved in database mode; flattened to text in file mode.

Bi-directional sync

Locale middleware

LinguaMiddleware is automatically appended to the web middleware group on boot. It:

  1. Reads the active locale from the session (lingua.session_variable)
  2. Falls back to the database default language
  3. Calls app()->setLocale() and conditionally writes the locale to session (avoids dirty session on every request)

Authorization

When LINGUA_GATE is set, can:{gate} middleware is added to all admin routes. Configure the gate in AuthServiceProvider or AppServiceProvider:


💎 Lingua Pro

Lingua Pro is an optional add-on that extends the base package with premium features:

Requires a Lingua Pro license. See lingua.rivalex.dev for details.

To suppress the upgrade nudge in the admin UI (e.g. when Lingua Pro is installed):


🧪 Testing

The suite uses Pest v4 and covers:

780+ tests total (2 skipped without openspout/openspout: XLSX and ODS integration).


🤝 Contributing

Contributions are welcome! Please open an issue first to discuss your proposed change, then submit a PR. Run composer lint before pushing.


📄 License

The MIT License (MIT). Please see LICENSE.md for more information.


Built with ❤️ by [Alessandro Rivolta](https://github.com/rivalex) Powered by [Laravel](https://laravel.com) · [Livewire](https://livewire.laravel.com) · [Flux](https://fluxui.dev)

All versions of lingua with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-dom Version *
ext-libxml Version *
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
league/html-to-markdown Version ^5.1
livewire/flux Version ^v2.12.0
livewire/livewire Version ^v4.1.0
outhebox/blade-flags Version ^1.6
spatie/laravel-package-tools Version ^1.92
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rivalex/lingua contains the following files

Loading the files please wait ...