Skip to content
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

Blocks: no output on translated page when translate:false #3012

Open
caplod opened this issue Dec 17, 2020 · 13 comments
Open

Blocks: no output on translated page when translate:false #3012

caplod opened this issue Dec 17, 2020 · 13 comments
Labels
needs: delay ⏳️ Requires more time, on hold type: bug 🐛 Is a bug; fixes a bug

Comments

@caplod
Copy link
Contributor

caplod commented Dec 17, 2020

Describe the bug
on Kirby 3.5
content that has 'translate: false' in the blueprint has no output on translated pages.

To Reproduce
I have a blueprint for a block, in site/blueprints/blocks/textmedia.yml

name: Text (mit Bild)
fields:
  text:
    label: Text
    type: textarea
  image:
    label: Bild
    type: files
    max: 1
    layout: cards
    translate: false

In the frontend I render the block with:

<?php
foreach($page->mybuilder()->toBlocks() as $block):
  snippet('blocks/' . $block->type(), array('data' => $block));
endforeach;
?>

Expected behavior
If I edit the translated page block, the text is editable, the image is greyed out, but I see the original image. That is how I think it should be.

In the frontend on the default language the image is rendered but on the translated page, the image is missing?

@afbora afbora added the type: bug 🐛 Is a bug; fixes a bug label Dec 17, 2020
@afbora
Copy link
Member

afbora commented Dec 17, 2020

Similar issue on structure field #2790

@hdodov
Copy link
Contributor

hdodov commented Nov 16, 2021

We decided to implement localization on our website and this issue forces us to refactor the entirety of it, since our content is mainly stored in blocks. That's soul-crushing...

@MathiasGmeiner
Copy link

We stumbled upon the same issue just now!

@stale stale bot added the type: stale 💤 Will be closed soon because there was no recent activity label Aug 10, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2022
@squareclouds
Copy link

any updates on this?

@lukasbestle lukasbestle reopened this Dec 22, 2022
@lukasbestle lukasbestle removed the type: stale 💤 Will be closed soon because there was no recent activity label Dec 22, 2022
@MathiasGmeiner
Copy link

Would be nice to have a comment from the Kirby team about this issue. Currently we have three multilingual sites (unfortunately all for the same client) and they have a really hard time with the editing process, especially because of pictures inside blocks that should not be translatable but are because of this bug.

@bastianallgeier
Copy link
Member

I'm sorry for the silence on this issue. We are struggling big times with fallback logic for nested translated objects. I wish we had a simple solution, but every time we look into it, it's giving us lots of headaches. We will keep on working on this, but we don't have a solution yet.

@MathiasGmeiner
Copy link

I'm sorry for the silence on this issue. We are struggling big times with fallback logic for nested translated objects. I wish we had a simple solution, but every time we look into it, it's giving us lots of headaches. We will keep on working on this, but we don't have a solution yet.

Thanks a lot for your reply! I can image that this is not an easy problem. If we can help, please don't hesitate to ask. Currently, any multilingual page feels like a workaround.

@hdodov
Copy link
Contributor

hdodov commented May 10, 2023

@bastianallgeier it would be a huge breaking change, but the most adequate solution in my eyes is to have a single TXT file for all translations. This way you wouldn't have to merge fallback fields from the default language with the localized fields. It would avoid the issue of having to sync up deeply nested data structures.

You can check how Payload CMS does it. It works out great for them.

@MathiasGmeiner
Copy link

After thinking about for about 30 seconds (sorry 😬): could be a good solution! For example, it could optionally be possible that only the standard language can add new entries (e.g. structure field or block elements), the other languages would then always have the same structure and the default content as a fallback.

For smaller, simpler sites we had a workaround with a similar idea behind:
Just one language but every field was created multiple times.

e.g.

title_de:
  type: text
title_en:
  type: text
title_fr:
  type: text

@lukasbestle
Copy link
Member

We have an internal concept that experiments with getting rid of the translation merging behavior. But our solution would work by always having a content file without language code next to the translation files. This file will then be used for every field that is not translatable. This also allows to translate a model in a secondary language while leaving the primary language untranslated.

This concept is so far only an experiment, so I can't say if and when it will be in the core. But I agree that we need to get rid of the translation merging at some point.

@cedrvanh
Copy link

@bastianallgeier any update on this?

@luclucluc
Copy link

I couldn't believe that Kirby could have a weakness about this. I spent a whole day struggling with this. Still the same with Kirby 4. Nothing new about this @bastianallgeier ?

@bastianallgeier
Copy link
Member

Sorry for the lack of updates. We honestly navigated ourselves into a really difficult situation with the way translations are handled. We are not just ignoring this, but finding the right solution proves to be super hard.

@getkirby getkirby deleted a comment from stale bot Jul 30, 2024
@distantnative distantnative added the needs: delay ⏳️ Requires more time, on hold label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: delay ⏳️ Requires more time, on hold type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

10 participants