Download the PHP package marshmallow/translatable without Composer

On this page you can find all versions of the php package marshmallow/translatable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package translatable

alt text

Nova Translatable

Latest Version on Packagist Tests Total Downloads License

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:

Publish the configuration:

Run the install command. This updates config/app.php, syncs your existing language files into the database, syncs inline translations and generates the Nova resources:

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:

2. Set Environment Variable

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

3. Run Migration and Synchronization Commands

Usage

Please reference the official documentation at Marshmallow Documentation.

Make a model translatable

Add the Translatable trait to any Eloquent model whose attributes you want to translate. When the trait is enabled, translated values are stored in the translatables table and the translatable relationship is eager loaded automatically to avoid N+1 queries.

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.

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

Configuration

After publishing, the configuration lives in config/translatable.php:

Key Default Description
driver database Translation storage driver. Supported: file, database. Migrations are only loaded when set to database.
nova_translatable_fields true Show the language selector when editing a resource in Laravel Nova.
flag_icon ['height' => 40, 'width' => 40] Ratios for the flag uploader.
translation_methods ['trans', '__'] Methods the scanner looks for when finding missing translations.
scan_paths [app_path(), resource_path()] Directories scanned when looking for missing translations.
models Language, Translation, Translatable, MissingTranslation Model classes used by the package. Override to swap in your own.
force_locale_query_string force_locale Query string parameter that forces the locale, useful for testing and deep linking.
deepl.api_path env('TRANSLATABLE_DEEPL_API_PATH', 'https://api-free.deepl.com') Deepl API endpoint.
deepl.api_key env('TRANSLATABLE_DEEPL_API_KEY') Deepl API key.
auto_translator.active env('TRANSLATABLE_AUTO_TRANSLATOR_ACTIVE', false) Enable the auto-translator.
missing_translations.active env('MISSING_TRANSLATIONS_ACTIVE', false) Enable missing-translation tracking.

Artisan Commands

The package ships the following Artisan commands:

Command Description
translatable:install Install the package: update config, sync files to database and generate Nova resources.
translatable:add-language Add a new language.
translatable:add-translation-key Add a new translation key.
translatable:list-languages List the configured languages.
translatable:list-missing List missing translation keys.
translatable:sync-file-to-database Sync existing language files into the database.
translatable:sync-missing Sync missing translation keys.
translatable:sync-translations Synchronise translations.
translatable:duplicates Find duplicate translations.
translatable:fix-placeholders Fix translated placeholders.
translatable:generate-preset Generate a preset.
translatable:preset Apply a preset.
translatable:index-missing-translatables Index missing translatables.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of translatable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/nova Version ^4.0|^5.0
marshmallow/commands Version ^v1.2.1
marshmallow/helpers Version ^v2.11.1
marshmallow/live-update Version ^v2.0
marshmallow/nova-advanced-image Version ^v2.0
marshmallow/sluggable Version ^v1.3.0
spatie/laravel-package-tools Version ^1.13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marshmallow/translatable contains the following files

Loading the files please wait ...