-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations should not remove non-translatable fields in structures #2790
Comments
There seems to be one more problem.
Even if the field is removed by hand in the txt file, Kirby will not display the default translation for the field 'number' . default.yml
default.de.txt (default language)
default.en.yml (translation)
|
Is there any eta to get this fixed? @bastianallgeier I mentioned you because you closed #2819. I am not quite sure how hard it is to implement a consistent behaviour but we are also facing that issue on three different web pages. Having a structure, two of three fields are |
Is there any update/ETA on this? Just ran into the issue myself with a structure field. It unfortunately makes them quite unusable in multi-language setups when you have fields that are not meant to be translated. |
This issue is a continuation of #1571. @afbora asked me to open a new issue.
Describe the bug
When you save a translation, all non-translatable fields should be skipped. This was fixed in #1571. But now there's a problem in structures - there, non-translatable fields should not be skipped because it leads to unexpected behavior.
To Reproduce
I have the following
site.yml
:...and the following
site.en.txt
:Then, I update the Bulgarian translation with the values
Text = FooBG
andTest/text = fooBG
. That's the resultingsite.bg.txt
:As you can see, the
Textconst
field is missing, and it should be - this way Kirby will use the default translation value. However, thetextconst
field in the structure is also missing. This means that I get the valuenull
for it in the template:At the same time, that value is grayed out in the panel and you can't fill it:
What's interesting is that even if I add
textconst
insite.bg.txt
manually with my text editor, refresh the panel, and update the translation, it gets removed. (1)Expected behavior
I see two solutions for that:
toStructure()
call, Kirby also loads the default translation values and doesarray_replace_recursive()
with the current translation valuesI'm currently working on a plugin that traverses the page blueprints and synchronizes structures according to them. For the most part, it works great, but it fails when it tries to copy values from the default translation - they are lost in the
$page->update()
call. If you implement the second solution I proposed, my plugin would be able to solve the problem.Kirby Version
3.4.2
The text was updated successfully, but these errors were encountered: