Download the PHP package be-interactive/laravel-translation-scanner without Composer
On this page you can find all versions of the php package be-interactive/laravel-translation-scanner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download be-interactive/laravel-translation-scanner
More information about be-interactive/laravel-translation-scanner
Files in be-interactive/laravel-translation-scanner
Package laravel-translation-scanner
Short Description A package that scans you repo for translations
License MIT
Homepage https://github.com/be-interactive/laravel-translation-scanner
Informations about the package laravel-translation-scanner
Laravel Translation Scanner
This package scans your projects for translations and integrates them into spatie translation loader.
Installation
You can install the package via composer:
You can optionally publish the config file like this:
This package uses spatie/laravel-translation-loader, this means you will need to publish both their migrations and ours, in that order:
After this you can run the migration:
Usage
This package implements a bridge-like architecture to scan your projects for translations.
We do this by using Scanners, each of these have their own logic to scan for translations.
Default scanners
By default, we ship with the following Scanners:
- Laravel translation files (scans in the laravel
langfolder). - Laravel scanner (scans for
transand__translations). - Filament scanner (scans for everything within
make::functions). - Regex scanner (allows you to implement a custom regex to scan your projects).
Basic Implementation
Actual usage of these looks like this:
You can add options to further improve your scan based on your needs:
Store without deleting
By default, the store() function will also delete records from the language_lines table that were not found during that scan.
This might not be what you want so you can disble it:
Only fetching the results
Sometimes you may want to execute your very own logic in handling the scanned language lines. To do this you can do the following:
Custom scanners
You can also create your own scanners to use your own scanning logic. A scanner might look something like this:
And then you can simply implement it using the facade.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Martijn Laffort
- Timo de Winter
- All Contributors
License
Please see License File for more information.
All versions of laravel-translation-scanner with dependencies
illuminate/contracts Version ^10.0||^11.0||^12.0||^13.0
illuminate/support Version ^10.0||^11.0||^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
spatie/laravel-translation-loader Version ^2.8