Download the PHP package zoutapps/laravel-lang-vendornamespace without Composer
On this page you can find all versions of the php package zoutapps/laravel-lang-vendornamespace. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zoutapps/laravel-lang-vendornamespace
More information about zoutapps/laravel-lang-vendornamespace
Files in zoutapps/laravel-lang-vendornamespace
Package laravel-lang-vendornamespace
Short Description Use a translation namespace vor mutliple translation files.
License MIT
Homepage https://github.com/zoutapps/laravel-lang-vendornamespace
Informations about the package laravel-lang-vendornamespace
laravel-lang-vendornamespace
This package is aimed at package developers that want multiple packages translations under one namespace.
It's currently not easily possible to gather all your packages translations under one namespace which can bloat up the calls to your translations as well as your resources/lang/vendor folder when publishing the files.
For example having packages:
zoutapps/awesome-package
zoutapps/nice-package
you can't register the translations to be able to use them like this:
With this package you now can do this!
Installation
Via Composer
Usage
In your PackageServiceProvider
instead of using
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang', '<your-vendor-name>')
make a call to
VendorNamespace::loadTranslationsFrom(__DIR__ . '/../resources/lang', '<your-vendor-name>')
in your boot()
method.
Publishing your translations is the same as before:
What it does
All paths you register will be added to your translation namespace.
For this to happen, we wait for the application booted callback and:
- we will create a folder for every namespace
- symlink all your provided translation files in the namespace folder
- add the generated folder to the laravel
TranslationLoader
namespaces
Development
While your app environment is set to local
we will always regenerate the links.
When your app is in any other environment, we will check for existence of the lang folder inside our package
and only generate the links if it is not present.
Change log
Please see the changelog for more information on what has changed recently.
Testing
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Oliver Ziegler
- All Contributors
License
MIT. Please see the license file for more information.
All versions of laravel-lang-vendornamespace with dependencies
illuminate/filesystem Version ~5|~6|~7|~8
illuminate/support Version ~5|~6|~7|~8