Twill: More advanced translations

Created on 15 Jan 2019  路  5Comments  路  Source: area17/twill

Hi!
We need to translate blocks content and set the different set of blocks for each translation. Furthermore we need to translate browser fields and media.

After brief code research:
1) it seems like a quite bulk piece of work
2) it may cause problems with updates in future

Maybe you have any recommendations how to do it with less pain or maybe plans to implement it in nearest future?

enhancement question

Most helpful comment

@ifox
Let's say I have page Twill - about translated in two languages. In form.blade.php I set something like @formField('block_editor', [ 'blocks' => ['intro_block', 'competitors_block', ...<etc>] ])
I'd like to have ability to insert intro_block and competitors_block in English version, and only intro_block in Roman version. And translate intro_block content respectively.

What volume I expect - it's quite complex question. For now I expect about 50 records * 8 languages. Next - depends on how Twill will prove themselves on this test project. If it's will be ok I expect about 500 pages * 8 languages. As an option I think to make a separate instance to each subproject, but it is the least desirable case.

All 5 comments

Hi @newvladimirov!

If I understand correctly, you'd like the ability to use different blocks per language, instead of translating the content inside the same blocks, right?

It would indeed be a lot of work, but I definitely understand your use case, for medias and browsers as well (which would be simpler to implement as we already have other complex fields that are compatible like the files input).

May I ask you about the volume of records you expect? Do you need this for specific records/modules or all of them? One solution that comes to mind would be to treat languages completely differently by simply creating a separate record per language, until we support translated block editor/medias/browser fields.

@ifox
Let's say I have page Twill - about translated in two languages. In form.blade.php I set something like @formField('block_editor', [ 'blocks' => ['intro_block', 'competitors_block', ...<etc>] ])
I'd like to have ability to insert intro_block and competitors_block in English version, and only intro_block in Roman version. And translate intro_block content respectively.

What volume I expect - it's quite complex question. For now I expect about 50 records * 8 languages. Next - depends on how Twill will prove themselves on this test project. If it's will be ok I expect about 500 pages * 8 languages. As an option I think to make a separate instance to each subproject, but it is the least desirable case.

@newvladimirov did you finally find an alternative solution to your issue ?
@ifox any update too ?

@bastienrobert yes, we did. We have solutions for all these issues in a different degree of readiness. We did it with some changes in the build script and a bunch of overrides in PHP, so it doesn't looks like a final solution yet.
We will be glad to help you if you have some specific questions!

@newvladimirov do you want to be able to create fully different layouts? Or only exclude/hide some elements in a translation?
If it's only about hiding an element it should be possible and not this hard to add a hide flag and use this or check for existing translation and only render translated blocks.
But a whole different layout would be more work to do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noxify picture noxify  路  4Comments

jayhaluska picture jayhaluska  路  4Comments

karneaud picture karneaud  路  3Comments

vacoup95 picture vacoup95  路  3Comments

layout-lab picture layout-lab  路  5Comments