Download the PHP package volcy/translator-flight without Composer

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

volcy/translator-flight

Latest Stable Version Total Downloads License PHP Version

FlightPHP bridge for volcy/translator-core: compile-time template translation with zero runtime overhead.

Architecture

This library uses a compile-time translation architecture for maximum performance:

Requirements

Installation

Install via Composer:

If you want to use the included CLI commands, also install flightphp/runway (recommended in require-dev):

Quick start

1. Install Dependencies

2. Configure Translation Settings

Add translator configuration to your Flight app config:

3. Register Translator Service

Create a service registration file:

4. Configure BladeOne View Service

Update your view service configuration to use TrackedBladeOne:

5. Attach Locale Middleware

Add the locale middleware to your routes:

6. Add Translatable Attributes to Templates

Use data-i18n attributes in your Blade templates:

The LocaleMiddleware is lightweight and only resolves the current locale. The actual translation happens during template compilation by TrackedBladeOne, which injects translations directly into the compiled PHP files for each locale.

CLI Workflow

1. Scan Views

Extract translatable strings from your Blade templates:

This creates a source locale index in your configured index_path.

2. Build Translations

Generate translations for target locales:

This creates French translations from your English source.

3. Compile Views (Precompilation)

Compile views for all locales to avoid runtime compilation:

This compiles your Blade templates with translations embedded for each locale.

Note: If you don't use the compile command, views will be compiled on first request for each locale.

4. Apply Translations

Translations are automatically applied via the locale middleware during web requests. The middleware sets the locale, and the appropriate compiled template is served.

Usage Examples

Static Content Translation

Attribute Translation

Dynamic Content (Alpine.js)

Locale Switching

Access different locales via URL parameter or session:

CLI Commands

The library provides three Runway commands:

translator:scan

Scans Blade views and creates the source locale index.

Options:

translator:build

Builds target locale indexes from the source locale.

Options:

translator:compile

Pre-compiles views for a specific locale with translations embedded.

Arguments:

Configuration

Additional configuration options for translation drivers:

API overview

Dynamic Content Support

The library supports translation of dynamic JavaScript framework content through custom data-i18n-* attributes:

Alpine.js Example

Other Frameworks

This pattern works with any JavaScript framework that can access DOM attributes:

The scanner automatically extracts values from data-i18n-* attributes, and the compile-time injection replaces them with translated values, enabling performance translation for dynamic content.

ID Strategies

This package supports all ID strategies from translator-core:

For detailed information about ID strategies, see the translator-core documentation.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions, please use the GitHub issue tracker.

For security issues, please see SECURITY.md.


All versions of translator-flight with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
eftec/bladeone Version ^4.0
flightphp/core Version ^3.0
volcy/translator-core Version ^1.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 volcy/translator-flight contains the following files

Loading the files please wait ...