Skip to content

milan607/translatable

 
 

Repository files navigation

alt text

Nova Translatable

Version Issues Code Coverage Licence

Add translation to your Nova Resources. The translations will be stored in a translatables table and not in a JSON format in your existing tables as many packages out there do.

Installation

You can install the package via composer:

composer require marshmallow/translatable

Publish configuration and assets

php artisan vendor:publish --provider="Marshmallow\Translatable\ServiceProvider"

Run the install command

php artisan translatable:install

Manual Installation

If you prefer to install manually or the automatic installation doesn't work for your setup, follow these steps:

1. Add Default Locale Configuration

Add the following line to your config/app.php file, right after the 'locale' configuration:

'locale' => env('APP_LOCALE', 'en'),

'default_locale' => env('APP_LOCALE'),

2. Set Environment Variable

Make sure you have the APP_LOCALE environment variable set in your .env file:

APP_LOCALE=en

3. Run Migration and Synchronization Commands

# Sync existing translation files to database
php artisan translatable:sync-file-to-database

# Sync missing translations
php artisan translatable:sync-missing

# Generate Nova resources (if using Laravel Nova)
php artisan marshmallow:resource Language Translatable --force
php artisan marshmallow:resource Translation Translatable --force

Usage

Please reference the official documentation at Marshmallow Documentation

Use Deepl integration

This package contains an integration with Deepl. This integration will add a button to the translations index view, that will automaticly translate your text via Deepl. Just add the following ENV variable to use this awesome feature.

TRANSLATABLE_DEEPL_API_KEY=

This will use the free version of the Deepl API. If you have a paid subscription, you can add the following as well.

TRANSLATABLE_DEEPL_API_PATH=https://api.deepl.com

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

composer test

Security

If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Add translation to your Nova Resources. The translations will be stored in a translatables table and not in a JSON format in your existing tables as many packages out there do.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 93.8%
  • JavaScript 3.3%
  • Vue 2.9%