Translation:false is not disabling fields inside structure, and not saving toggles and files data

I am using Kirby 5, and I have a structure of Team members, with some fields. Text fields like Name, Image, etc, should not be translated, and I am adding translate:false to them. Even when doing so, the field still displays as editable in the secondary language, but it imports the value from the base value.

I have another field inside the same structure, which should also not be translatable (and translate:false is also set on it) but it is a toggles field. This field, whenever is saved, loses all information if translate is set to false. The image field information is also lost and not replicated between translations, and the field appears as empty in the secondary language.

I would like to:

  1. translate:false to work as expected, disabling fields, and not saving unnecessary data in the secondary language.
  2. that the toggles value is not lost when translate:false is set.

Does anyone has a hint on this? Thanks in advance.

translate: false only works on the (upper) field level, not for fields inside a structure, because there is no relation between items inside the structure between languages.

Regarding the toggle field, could you post your toggle field definition for testing? Thanks!

1 Like

Got it! I might have not seen that while searching in the documentation.
That explains it all. All fields I mentioned are inside a structure, including the Picture and the Toggles. That is why the translate:false is not working then.
I edited my initial post for clarity in the future.
Thanks!

Oops, that’s exactly what I am stumbling over right now :wink:

Similar use case for me: I have a bunch of key-value pairs organized in a structure field and I want the panel users to translate only the values, but not the keys! So the only way to achieve this seems to be providing detailed instructions in the panel and hoping for user compliance …

Hm, I wonder if it makes sense to try to “synchronize” the structure data when the translated page gets updated by hooking in the PageActions::update() method (in a custom model in my case), but I am not sure yet?!

What about introducing some sort of “internal” unique ID for the structure items, as it is with blocks? If so, it should be possible to have single fields inside the structure configured translate: false since we can resolve a particular item in each language version. Furthermore, in my particular use case I won’t need a dedicated key field any longer, since I could could rely on the internal ID.

1 Like