eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Taxonomies doesn't support multi sites ( multi language )

Open Crasheng opened this issue 1 year ago • 6 comments

Creating a taxonomy that support both language doesn't work.

the dashboard enables for both language ( but one of them which is not the origin doesn't save if title filed was supporting multi lang )

Screen Shot 2022-10-20 at 9 29 15 AM Screen Shot 2022-10-20 at 9 29 38 AM

Crasheng avatar Oct 20 '22 06:10 Crasheng

I'm not a big multi-site user so its not entirely clear to me that the issue is? Are you saying that in your example there should also be a term for arabic alongside the terms for default ?

ryanmitchell avatar Oct 20 '22 06:10 ryanmitchell

I'm not a big multi-site user so its not entirely clear to me that the issue is? Are you saying that in your example there should also be a term for arabic alongside the terms for default ?

yes either having an origin column like "entries" or like "Globals" where it's being saved in the localization column (JSON), check image for reference Screen Shot 2022-10-20 at 9 44 14 AM

But some how much of modules support the multi-site expect the taxonomies

Crasheng avatar Oct 20 '22 06:10 Crasheng

It does save localisations, you can see that here: https://github.com/statamic/eloquent-driver/blob/f5fdc8175e057b3290b1fc792b0a3b56437e3aa7/src/Taxonomies/Term.php#L25-L29

But I think the issue is with line 68 here: https://github.com/statamic/eloquent-driver/blob/f5fdc8175e057b3290b1fc792b0a3b56437e3aa7/src/Taxonomies/Term.php#L67-L71

It should be assigning to $data['localizations'][$locale] - do you want to try changing that on your side to see if it helps?

ryanmitchell avatar Oct 20 '22 06:10 ryanmitchell

Screen Shot 2022-10-20 at 12 39 06 PM

As you can see i have added $data['localizations'][$locale] but still then i dump before line: 68 $source->dataForLocale($locale)->toArray() as you see in the screenshot even i have sent an Arabic text still the array being dumped is having the english text

Hope that's clear

Crasheng avatar Oct 20 '22 09:10 Crasheng

The english text is stored as a locale, so if youre doing a dump and exit it may be the first one being output. Is anything being stored under the localizations key in the data column?

ryanmitchell avatar Oct 20 '22 10:10 ryanmitchell

Screen Shot 2022-10-20 at 2 14 39 PM

Still when i add this $data['localizations'][$locale] = $source->dataForLocale($locale)->toArray(); as u see the record in db has no localization key

Crasheng avatar Oct 20 '22 11:10 Crasheng

I can confirm, that when you try and create a translation for a term, the translation is not saved - this fix in https://github.com/statamic/eloquent-driver/issues/78#issuecomment-1285034671 doesn't work. I'll look into this as well as we need it working in our new project.

FrittenKeeZ avatar Nov 02 '22 12:11 FrittenKeeZ