Download the PHP package tooinfinity/lingua without Composer

On this page you can find all versions of the php package tooinfinity/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

Lingua

Tests Formats PHP Version Laravel Version Latest Stable Version

⚠️ Under Development: This package is currently under active development and is not ready for production use.

Share Laravel translations with your Inertia.js + React frontend.

Quick Start

1. Install

This installs the Laravel package, publishes the config, and installs the React package (@tooinfinity/lingua-react).

2. Configure Locales

Edit config/lingua.php:

3. Middleware

The middleware is auto-registered to the web group by default. No action needed for most apps.

To disable auto-registration and add manually:

4. Create Translations

5. Use in React

Locale Switching

Translation Groups (Optional)

Load only the translations needed for a specific request by passing group names to the middleware. When no groups are provided, Lingua shares all translations.

You can also load specific groups manually via Lingua::translationsFor(['common', 'validation']).

API Reference

useTranslations() Hook

Property Type Description
__ function Translation function
locale string Current locale
locales string[] Supported locales
direction 'ltr' \| 'rtl' Text direction
isRtl boolean Is RTL locale

Facade

Fallback Locale Behavior

When a translation key is missing in the current locale, Lingua automatically fills it from the default locale. This applies to:

If the current locale already matches the default locale, no fallback merge occurs.

Routes

Method URI Description
POST /locale Switch locale

Note: The route prefix can be configured via config('lingua.routes.prefix').

Translation File Formats

Lingua supports both PHP and JSON translation files. Configure the driver in config/lingua.php:

PHP Translations (Default)

PHP translations are organized in groups (files) under lang/{locale}/:

Shared to React as:

Access in React: __('messages.welcome')

JSON Translations

JSON translations use a flat key-value structure in lang/{locale}.json:

Shared to React as-is (flat structure):

Access in React: __('Welcome!') or __('auth.login')

Tip: JSON translations are ideal for simple apps or when using Laravel's __() helper with literal string keys.

Advanced

Custom Controller

License

MIT License. See LICENSE.md.


All versions of lingua with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
laravel/framework Version ^11.0|^12.0
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 tooinfinity/lingua contains the following files

Loading the files please wait ...