A tool for Laravel Nova to implement dynamic languages. The whole idea of this package is to rewrite the configuration files of several localization packages based on your inputs.
NOTE: This package does not support Nova 4 right now. We are working on making it available soon enough.
Use the package manager composer to install this tool.
composer require crayon/nova-language-management
Import the NovaLanguageEditor class at the top of your NovaServiceProvider like below:
use Crayon\NovaLanguageEditor\NovaLanguageEditor;
Open up NovaServiceProvider and register the tool in the tools method
/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array
*/
public function tools()
{
NovaLanguageEditor::make();
}
NovaLanguageEditor::make()->canSee(fn($request) => $request->user()->isSuperAdmin()),
This tool is uses
Nova Translatable
Macamara Laravel Localization
Nova Translation Editor
If you do not have them installed it will install them for you. Also, make sure to publish the configuration files:
php artisan vendor:publish --provider="Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider"
php artisan vendor:publish --tag="nova-translatable-config"
php artisan vendor:publish --provider="Bernhardh\NovaTranslationEditor\ToolServiceProvider"
Publish language_lines (Nova Translation Editor) migration
php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="migrations"
php artisan migrate
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.