A user interface as a Livewire component for managing translatable interface string using the database.
This package depends on kkomelin/laravel-translatable-string-exporter for extracting translations.
It uses spatie/laravel-translation-loader for storing/displaying the translation.
By default this package scans app
and resources
folders. If you want to scan additional folders or vendor folders
please refer to the kkomelin/laravel-translatable-string-exporter readme on how to do this.
This package is not yet battle tested!
You do not have to export the translations, this package takes care of reading and inserting strings into the database.
- Test bigger projects
- Include/parse lang folder.
You can install the package via composer:
composer require haringsrob/laravel-interface-translation
You must publish the styles.
php artisan vendor:publish --tag=assets
Publish the config file and update it to your needs. Make sure you update the middleware used if you want to load the routes. If you just want to embed the component there is no need to load the routes.
In the config file set the languages you want to manage using the interface.
vendor:publish --tag=laravel-interface-translation-config
Then you can parse the translatable strings and prepare them in the database.
php artisan ui-translations:update
Set the translation loader in the config of spatie's translation loader:
'translation_manager' => \Haringsrob\LaravelInterfaceTranslation\TranslationLoaderManager::class,
This package comes with a standalone livewire component that you can add to any page in your project.
Simply add to any page:
<link rel="stylesheet" href="{{ asset('vendor/laravel-interface-translation/style.css') }}">
<livewire:laravel-interface-translation.list />
Please make sure Livewire is installed correctly or this will not work.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.