Open webmappsrl opened 1 year ago
Hi @webmappsrl
Can you please describe the problem in more detail?
Hi, I have a model trails where i have defined which database column should be translatable:
...
public $translatable = [
'name'
];
...
Then i have the nova for this model where i use it:
...
public function fields(NovaRequest $request)
{
return [
NovaTabTranslatable::make([
Text::make(__('Name'), 'name')->sortable(),
])
]
}
...
I have 2 languages for this project: 'EN' and 'IT'; even though it's english every one is writing in their own language like:
But i have an other model without the 'NovaTabTranslatable' with similar names and the search is working:
If it's not enough tell me exactly what you need? Thanks.
@webmappsrl
I checked the search and it works for me.
Maybe you forgot to include "name" in the "$search" array?
Or it could be a nova issue. my nova version is: 4.19.5
"TranslatableTabToRowTrait" worked for me too (image 4)
Hi, My plugins are up to date. The search is correct:
public static $search = [
'id','name','ref','member.acronym'
];
in the database is see the value for name saved like this:
{"en":"Doli\u010d - Kuzma - Serdi\u0161ki breg","it":"Doli\u010d - Kuzma - Serdi\u0161ki breg"}
The other columns that are not using the NovaTabTranslatable save the value like this in the database: Dolič
and again the search works while searching with accents for other columns.
on my database.php file under 'pgsql'=> i have 'charset' => 'utf8'
@webmappsrl
i am using mysql
with 'charset' => 'utf8mb4', collate => 'utf8mb4_unicode_ci'
It's strange that I don't do any operations with the character
try to remove "HasTranslations" and "$translatable" in the same model and remove "NovaTabTranslatable::make()", and instead add just a text field, see how it saves to the database.
It saves like this: Koča
and nova search works.
I will install Postgres and try to solve the problem
Hi, I am using Laravel 9 with Nova 4 and this plugin but search on resource page is not working when i use accented characters like š, č or Ž How can i fix this? I have also used the trait: TranslatableTabToRowTrait but it has not resolved it.
thanks