Download the PHP package beliven-it/laravel-i18n without Composer
On this page you can find all versions of the php package beliven-it/laravel-i18n. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beliven-it/laravel-i18n
More information about beliven-it/laravel-i18n
Files in beliven-it/laravel-i18n
Package laravel-i18n
Short Description A small package for scan / import / export translations
License MIT
Homepage https://github.com/beliven-it/laravel-i18n
Informations about the package laravel-i18n
Laravel I18n
[](https://packagist.org/packages/beliven-it/laravel-i18n) [](https://github.com/beliven-it/laravel-i18n/actions?query=workflow%3Arun-tests+branch%3Amain) [](https://github.com/beliven-it/laravel-i18n/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [](https://packagist.org/packages/beliven-it/laravel-i18n)
A powerful Laravel package for managing translations with ease. Scan your codebase for translation keys, export them to Excel for translators, and import them back seamlessly. Supports both PHP array files and JSON translations.
Installation
You can install the package via composer:
Features
- 🔍 Scan - Automatically scan your codebase for translation keys (
__(),trans(),@lang()) - 📤 Export - Export all translations to Excel format for easy editing by translators
- 📥 Import - Import translations back from Excel with merge or overwrite modes
- 🌐 Dual Format Support - Handles both PHP array files and JSON translations
- 🎯 Smart Detection - Automatically distinguishes between structured (PHP) and simple (JSON) translations
- 📊 Excel Integration - Uses PhpSpreadsheet for reliable Excel file handling
How It Works
The package intelligently handles two types of translations:
PHP Array Files (Structured Translations)
Keys with dots are stored in PHP array files with nested structure:
JSON Files (Simple String Translations)
Keys without dots are stored in JSON files:
Usage
Scanning for Translation Keys
Scan your application code to find all translation keys:
The scanner will:
- Find all
__(),trans(), and@lang()calls in your code - Create appropriate translation files (PHP or JSON)
- Add missing keys to existing files
- Show a summary of created files and added keys
Example output:
Exporting Translations
Export all translations to an Excel file for translators:
The Excel file will contain:
- Locale - The language code (en, it, fr, etc.)
- Path - The file path (lang/en/messages.php or lang/en.json)
- Key - The translation key
- Value - The translation value
Importing Translations
Import translations back from Excel:
Example output:
Programmatic Usage
You can also use the services directly in your code:
Scanning
Managing Translation Files
Exporting
Importing
Workflow Example
Here's a typical workflow for managing translations:
-
Develop - Write your code using translation functions:
-
Scan - Find all translation keys in your codebase:
-
Export - Export to Excel for your translators:
-
Translate - Send the Excel file to translators
-
Import - Import the translated file back:
- Done - Your application now has all translations!
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Fabrizio Gortani
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-i18n with dependencies
illuminate/contracts Version ^11.0||^12.0||^13.0
phpoffice/phpspreadsheet Version ^1.0||^2.0||^3.0||^4.0||^5.5
spatie/laravel-package-tools Version ^1.16