crayon/nova-language-management

A Laravel Nova tool that helps you implement dynamic languages.

2.0.2 2023-07-13 13:39 UTC

This package is auto-updated.

Last update: 2024-03-13 15:24:18 UTC


README

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.

Installation

Use the package manager composer to install this tool.

composer require crayon/nova-language-management

Usage

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();
}

Permissions

    NovaLanguageEditor::make()->canSee(fn($request) => $request->user()->isSuperAdmin()),

Clarification

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"

Migration

Publish language_lines (Nova Translation Editor) migration

php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="migrations"
php artisan migrate

Contributing

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.

Screenshots

Nova language management

License

MIT