lenorix / fluentizy-laravel-tools
Extract all translation strings from your codebase and manage your language files effortlessly
Fund package maintenance!
jhg
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lenorix/fluentizy-laravel-tools
Requires
- php: ^8.1||^8.2||^8.3||^8.4||^8.5
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- larastan/larastan: ^3.8||^2.11
- laravel/pint: ^1.26||^1.5
- nunomaduro/collision: ^8.8||^7.12
- orchestra/testbench: ^10.0.0||^9.0.0||^8.0.0
- pestphp/pest: ^4.1||^3.8||^2.4
- pestphp/pest-plugin-arch: ^4.0||^3.0||^2.0
- pestphp/pest-plugin-laravel: ^4.0||^3.0||^2.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0||^1.0
- phpstan/phpstan-phpunit: ^2.0||^1.0
README
Extract all translation strings from your codebase and manage your language files effortlessly.
The i18n & l10n will be easier than ever with this package!
๐ Support us
Help us continue developing and maintaining this package by sponsoring us.
Also, using fluentizy is a great way to support the project!
๐ Features
- Scan chosen directories for translation strings.
- Supports both JSON and PHP translation files.
- Supports
__(),trans(), and@lang()functions. - Update language files automatically without overwriting existing translations.
- Artisan command for easy integration into your workflow.
- Tests running with PHP 8.0-8.5 and Laravel 9.x-12.x to ensure compatibility.
๐ฆ Installation
You can install the package via composer:
composer require --dev lenorix/fluentizy-laravel-tools
That's all! This is enough to get started using lang:extract command.
You can publish the config file with:
php artisan vendor:publish --tag="fluentizy-tools-config"
You can publish the translation files with:
php artisan vendor:publish --tag="fluentizy-tools-translations"
๐ Usage
To extract translations from your codebase, run:
php artisan lang:extract es
This command will update your translation file based on __('...') usages in your code.
If there are lang/*.json or lang/*/*.php files, to update all these files, run:
php artisan lang:extract
Behavior:
- Strings that are already translated will not be modified.
- If a string is missing in the translation file, it will be added with an empty value.
- If a string exists in the translation file but is not found in the codebase, it will be removed.
๐งช Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The Unlicense License. Please see License File for more information.