Closed AIC-BV closed 1 year ago
Found this old post, must've had the same issue months ago: https://github.com/wintercms/winter/issues/448#issuecomment-1176199547
Are you using the latest version of the plugin?
This line was added to prevent exactly that: https://github.com/wintercms/wn-translate-plugin/blob/main/classes/EventRegistry.php#L133
Yes i'm on the latest version. I have that line in the Class EventRegistry.php
Composer.json has "winter/wn-translate-plugin": "~2.1.1", CMS -> Plugins -> Translate says its only 2.1.0 I ran composer update and winter:up but nothing changed
When you're in the create form, do you see only the top most title field with the localePicker (language selection) or do you also see this when creating the nested form title entry?
It is also within the nested form title entry
title: label: Title field repeater: form: fields: data: type: nestedForm form: fields: title: label: Title field in repeater
Probably cleaned code a little bit too much in my code example, fields need to be in a nestedform -> form -> tabs -> fields -> x, where 'tabs' seem to be the cause @LukeTowers
So 'tabs' need to be added in the code above for the bug to happen
Can someone please look in to this? I'm willing to pay for the fix. @mjauvin @LukeTowers @bennothommo @jaxwilko https://github.com/wintercms/wn-test-plugin/pull/14
When adding a key to the $translatable array:
I noticed that the translation is picking up all
title/image/...
fields What I mean with this is that when you have the following structure (simplified it):The translation will pick up
[title]
but alsorepeater[x][data][title]
. Meaning[title]
will always have the value ofrepeater[lastIndex][data][title]
. This also occurs with my image (which I posted about in Discord), which is why when removing[image]
is not working because the translation is savingrepeater[lastIndex][data][image]
in my[image]
fieldI would expect it would only pick the
title/image
field located inPlugin[image]
and that fields inside a jsonable field are ignored.The workaround is to create unique keys. Instead of
title
in repeater, userepeater_title
, ... Note thatrepeater[x][data][title]
is also getting the locale switcher thingyNote how
RLTranslate
sets image on theBlog[image]
but also onBlog[blocks][0][data][image]