Download the PHP package bbs-lab/nova-translation without Composer
On this page you can find all versions of the php package bbs-lab/nova-translation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-translation
Laravel Nova Translation
Contents
- Installation
- Usage
- Locale resource
- TranslationMatrix tool
- GraphQL
Installation
You can install the nova tool in to a Laravel app that uses Nova via composer:
The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php
file:
You can tailor default in your application by running:
You need to run migrations and seeds Locales.
Models setup
// @TODO... Explain
-
use Traits\Translatable
-
auto_synced_models
in config.php -
Define
$nonTranslatable
attributes (attributes that will be overridden during in all translations during an entry update). -
Define
$onCreateTranslatable
attributes (attributes that will be copied during translations entry creation). - If your using
michielkempen/nova-order-field
package you must override system in model with:
Configration
You can publish the default configuration by running the following command :
Using Cookies
By default, the locale is stored in the session upon change, but if you need to access it before the session is started, you can instruct the package to save it in the cookies by enabling it in the config :
The cookie will hold the same name defined in locale_session_key
💡 NOTE: The cookie will be encrypted by default, to have it excluded you can add it to your EncryptCookies
middleware :
Config Nova
Add SetLocale
middleware in application kernel.
Usage
TranslationMatrix tool
You must register the translation matrix backend tool with Nova:
Nova resource
Nova Resource MUST extends BBSLab\NovaTranslation\Resources\TranslatableResource
to work.
Locale resource
And you can add the Locale Nova Resource within your application:
GraphQL
If your using Lighthouse PHP you can add some default Directive and endpoints for Locale
and Label
.
Directives @allTranslations
, @paginateTranslations
, @firstTranslation
related
Acting as similar @all
, @paginate
, @first
.
You need to add package Directives path to your lighthouse.php configuration file:
Schema
You can include those in your existing schema:
Flags resources
Flags UTF-8 (e.g en.json
) came from EmojiTerra
TODO
- [ ] Add order button on keys heading
- [ ] Add search bar to filter keys
- [ ] Add checkboxes to enable/disable display of locale
- [ ] Add custom message/component when no locale is selected
All versions of nova-translation with dependencies
ext-json Version *
bbs-lab/nova-cloudinary-field Version ^0.3
illuminate/contracts Version ^6.2 || ^7.0 || ^8.0 || ^9.0
illuminate/database Version ^6.2 || ^7.0 || ^8.0 || ^9.0
illuminate/support Version ^6.2 || ^7.0 || ^8.0 || ^9.0