Spatie Translatable - Checkbox list
Hello everyone. I am using the "Spatie Translatable" package in the project. When I use the "Checkbox list" the texts are not visible. Where am I doing wrong? Thank you
27 Replies
@toeknee 😳sorry for the tag
I appreciate you are sorry, but try to refrain as per the #✅┊rules
Provide the code please.
Actually, when I use the "Spatie Translatable" Plugin, the "CheckboxList" names do not appear
I'm sorry about that. I will pay attention to this
Introduction | laravel-translatable
laravel-translatable
yep
Is the
name
a json column? name: "{"en":"xxx"}"
?
Are you using HasTranslations
in the model?{"en": "Test package name", "es": "Nombre del conjunto de pruebas"} Yes in json format
Yes, the room is attached.
Did you add HasTranslations to the model?
Yes
Would you like me to share the entire package with you?
what is the output if you remove
HasTranslations
?I save the data I want to show in the "CheckboxList" here. When I want to show it in the 2nd image, its name is not visible. When I remove "HasTranslations" from the model, I get the same result.
can you try using the fork:
https://github.com/lara-zeus/translatable
its working with me
make sure your model
MarineVehiclePackage
has the translatable trait and you defined the translatable attributesThanks so much for your time. This package worked. Now the names appear, but when the language is changed with "Switcher" there is no change.
in this case you will need to query the active locale:
and import
This still doesn't work when I try to create a new page.
its working for me and this is my code:
you do have the trait
Translatable
in the create page class?test:
Oh yes. If you want to take a look, it's here
what the output of
->options(fn(Livewire $livewire) => dd($livewire->activeLocale)),
it should return the active locale, when you switchActually, I do everything you say, but I can't get the result I want. Is there a chance you could share the source if you don't mind ?
this is the versions
I am using the fork
lara-zeus/translatable
but I checked its also working with the filament/spatie-laravel-translatable-plugin/translatable
I tried everything you suggested again. But I still get the same result. I did as you said in the example below. When I show this on the new content creation page, the language selector does not show the result. I'm sharing the example if you want to check it out. Thank you very much for your time 😭
if you can share the code on a repo or git gist I will look into it
https://github.com/engbz/demo Thank you very much
my code didnt work on your app not sure why, but try this:
Oh you are amazing. Finally the problem was fixed. You spent a lot of time on this. Thank you very much indeed 😊