Download the PHP package tarektaher/artisan-language without Composer
On this page you can find all versions of the php package tarektaher/artisan-language. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tarektaher/artisan-language
More information about tarektaher/artisan-language
Files in tarektaher/artisan-language
Package artisan-language
Short Description add artisan commands for language
License MIT
Homepage https://github.com/tarektaher/artisan-language
Informations about the package artisan-language
Artisan Language
Artisan Language is a Laravel package designed to streamline the management of translation keys in your application. It provides powerful Artisan commands to synchronize, scan, and manage translation keys for Blade templates, PHP files, and JavaScript files.
Features
- Synchronize translation keys across multiple locales.
- Automatically update JSON language files with missing keys.
- Remove unused keys from JSON language files.
- Scan Blade, PHP, and JavaScript files for translation keys.
- Fully customizable through the configuration file.
Installation
Install the package via Composer:
Publish the configuration file:
This will create the configuration file at config/artisan-language.php
.
Configuration
The configuration file allows you to define paths, patterns, and settings for the package.
Default Configuration:
Commands
1. Scan for Missing Keys
Scan configured paths (Blade templates, PHP files, JavaScript files) for missing translation keys and update the JSON language files.
Options:
--lang
: Specify the target language (default: configured default language).
Example:
2. Synchronize Translation Keys
Synchronize translation keys between the base language and a target locale.
Arguments:
locale
: The locale to synchronize.
Options:
--nomissing
: Skip adding missing keys from the base language file.--nofurther
: Skip removing extra keys from the target language file.
Example:
3. Add Translation Keys
Add a new translation key to the specified language file.
Arguments:
key
: The translation key to add.value
: The value for the key.
Options:
--lang
: Specify the target language (default:en
).
Example:
4. Remove Translation Keys
Remove a translation key from the specified language file.
Arguments:
key
: The translation key to remove.
Options:
--lang
: Specify the target language.
Example:
Customization
You can customize paths, regex patterns, and language file locations in the configuration file (config/artisan-language.php
).
Download
You can download the latest release of Artisan Language here:
Contributing
Contributions are welcome! Feel free to fork this repository, submit a pull request, or open an issue on GitHub.
License
This package is open-sourced software licensed under the MIT License. See the LICENSE file for details.
Support
For issues or questions, please contact Tarek Taher or open a GitHub issue.
With Artisan Language, managing translations has never been easier. Start synchronizing and scanning your keys today! 🎉