Giter Site home page Giter Site logo

nova-translatable's People

Contributors

andypa avatar benjamincrozat avatar d8vjork avatar jimmitjoo avatar mrmonat avatar ronmelkhior avatar royduin avatar vmitchell85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nova-translatable's Issues

'required' validation rule only enforced on one locale

  • Laravel 6.0.4
  • Laravel Nova 2.9.2
  • mrmonat/nova-translatable 2.0.2

Say we have a field like:

Translatable::make( __('Slug'),  'slug')->rules('required')->sortable()->help(__('help.tips.slug')),

In our application, we have two locales.

If I try to submit the form without entering a value for either locale, I get a validation error stating that the field is required.

However, if I enter a value for only one of the two locales, the submission goes through.

How can we require that all a value is present for all locales?

A "required" field doesn't have a red asterisk

Hi

The default field in nova has an asterisk if it is required but unfortunately, this field doesn't have that. I would create a pull request in the next couple of hours, would you consider merging it?

Best regards,
Andy

PS: Here's the PR

Translation Indicator

I've build the same component for one of my projects. The only difference, I used an indicator to show if the translation was already filled out.

component

Do you have any plans to implement this functionality? Or would you accept a Pull-Request for this?

Cheers,
Stan

Help with setup

Hi, I have a problem with creating translatable field. I have spatie/laravel-translatable so my model looks like this however i am not able to show any of these fields as translatable...what can be wrong
`use Spatie\Translatable\HasTranslations;

class Manufacturer extends Model
{
use HasTranslations;

protected $translatable = ['name','description','description_short','meta_title','meta_keywords','meta_description'];

`

show the translated attribute in current app locale

Is it possible to have the current app locale dictate which translation tab is selected by default when the edit/show page is loaded? I mean when I have my app locale set to say 'bg' I want to see the Bulgarian translation of the field selected by default then click to check out the rest of the translations. Can you help with this? Thanks. Cheers!

Does not work with the new "withFiles()" method

The Field does not work with the new "withFiles()" method when using Trix:

Translatable::make('Content')->trix()
                ->withFiles('public')
                ->hideFromIndex()
                ->sortable()
                ->rules('required'),

It throws Call to undefined method MrMonat\\Translatable\\Translatable::withFiles()

Language switcher

It's nice to have the index text displayed by default using the app()->getLocale()

What about having a language switcher card? so the admins can easily switch the language?

I don't now if Nova table offer better customization options to include the language switcher before or after each table, but at least the switcher card can help overcome the problem right now?

Index preview

Is there any plan to support the display of translations in the index/list view?

Rename package

Hi,

thanks for creating this package and using ours as an underlying dependency.

The current name of your package could make people think that we created it. Could you rename it so it doesn't have spatie in it anymore?

I'd also accept a PR to spatie/laravel-translatable that adds a link in the readme to your nova package.

Thanks!

field size

hi, could you tell me how to change the size of the field?
I found:
<div class= "px-8 py-6": class= "computedWidth">

but even after compilation nothing changes.

Global locales

Why not to have global locales array within config file? with the ability to override the array for each fields like the current syntax?

The right way to display translations in website

Hi. First thanks for this amazing package. I like it a lot.

I need a little help with how can I use translations on the website. Like I want to switch languages and keep in the cookie.
Spatie documentation is only for Nova and cannot be figured out how to use translations. I really need help.

Thanks.

Allow more field types

I use trix and markdown field types for translatable content, adding support to this field types will be really useful.

Please change the error-text to match Nova classes and type

Please change the element classes, and type, on the help-text/error-text.
It is much easier to set custom styles if the classes and type, are the same as in Nova.

In your component the error and help text is:

<p class="my-2 text-danger"></p>

In Nova field components the error-text is a <div>.

<div class= "help-text error-text mt-2 text-danger"></div>

Could not find a matching version

Could not find a matching version of package mrmonat/nova-translatable. Check the package spelling, your version constraint and that the package is available in a   
  stability which matches your minimum-stability (stable).  

it seems the error related to the repo name change?

Allow to create "translatable" images

Hey, really amazing project.

I have a request though, it would be nice to provide ability to create translatable images.

Lets say we have an image field in the database with the json column type.
If we are creating a blog post with multiple locales, we also need to have an ability to attach image for those locales. This is quite useful if main post image contains text in different locales.

Global search not working with translatable package

Global search and resource search are powerful tools in Nova, but sadly they did not work with translatable package if the title or name field is translatable.

I think this is a killer issue that need to be addressed. It may be out of scope of this package itself, but how can we address this issue?

Help text not appearing

Hi There!

Appreciate the work you've done, thanks to your package our project became feasible with Nova ๐Ÿ˜„
But, there's a slight problem... the Nova Field base class allows for appending a help text to the fields, this is not currently supported by the package ๐Ÿ˜ข
I think that a general (not locale dependent) help text would be enough for a start.

Attaching a manyToMany relation with translatable pivot field does not work

Simplified example:

Resource: Post (db-table posts)
Resource: Attribute (db-table attributes)

There is a belongsToMany relation between the two (db-table attribute_post).
This relation has one pivot field called value.
It's a translatable field.
There is a model (PostAttributes) for the relation as well:

App\Post.php (attribute relation)

    public function attributes()
    {
        return $this->belongsToMany( Attribute::class )
            ->withPivot(['value'])
            ->using( PostAttributes::class );
    }

App\Attribute.php (post relation)

    public function posts()
    {
        return $this->belongsToMany( Post::class )
            ->withPivot('value')
            ->using( PostAttributes::class );
    }

App\PostAttributes.php

use Spatie\Translatable\HasTranslations;
use Illuminate\Database\Eloquent\Relations\Pivot;

class PostAttributes extends Pivot
{
    use HasTranslations;
    public $translatable = ['value'];
}

Whenever the relation exists in the database it can be edited using Nova.
But when I want to attach a new Attribute to the Post I get the following error:
screen shot 2018-09-14 at 15 10 58

Default locale not selected on detail view

After upgrading to version 2.1, it doesn't seem that any of the locales are being set by default for the resource detail views. I have to click a locale to see the fields value.

Nova v3.7.0
Laravel v7

Screen Shot 2020-06-30 at 3 04 39 PM

Change tab to fallback_locale on display

Hi all,

I think changing the activated tab to the indexLocale (defined meta) or, instead of this (only when this translation isn't available), change to the defined translatable.fallback_locale config

Support Laravel-translatable 5.*

Laravel-translatable has moved to a 5.* series, but this package locks 4.*.

Could you please tag a release that supports 5.*? Thanks!

Validation: rules not working on update

Hi!
I'm encountering this issue.
When I try to update field without value, submit pass and update takes effect.
PS: I added 'required' in validation rules.
issue-git

Any workaround ?

Text direction for RTL languages

Hi,

Any chance we can have the text direction to be RTL if any RTL languages selected Ex. "Arabic or Hebrew", as typing in RTL language with LTR direction looks very weird.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.