How to autotranslate with 5.5.0 on Plone 5.2.1


we are developing an extension for Plone which customizes Plone 5.2.1 with multiple new content types and some Javascript and CSS. But all of them are really very simple types with some additional fields and certain views. So nothing special or deeply integrated stuff.

We already added many objects to the site root and also changed the default view for the site root. Last week I enabled and enabled "German" and "English" because "German" is the main language of the site. I now cut and pasted all objects from the site root to /de.

  • How can I mirror the german content to the /en subfolder? Copy and paste?
  • Shouldn't there be a button somewhere in the settings which does exactly that for me?
  • How can I add another language in the future without clicking the "Translate" action on every already existing content object and working me from the top level down to every child?

We have a product that adds an action to allow to copy all the contents of a given folder to another language:

1 Like

Thank you. That sounds great. I will give it a try.

Works good so far.

At the moment that whole multi-language system is a bit weird. I was hoping there will be some kind of fallback. E.g. If a folder in /en is empty it should fallback to the correspondent folder within /de and show this content instead. Like when a translation is missing. Do you know of such a possibility?

Or when I add a new langugage, e.g. /fr it should automatically fall back to /de again when someone tries to switch to French. At the moment I have to explain to our customer that he has to execute your content-copier using the toolbar's action menu and then manually translate all the folders recursively and changing their titles and ids, so the path makes sense in that language.

No, solution has no fallbacks by default. What I really would find weird would be to find 'de' content in a site that I am actually browsing in 'fr' or 'en'.

We think that before showing content in a non-requested language, you should at least show a page saying: "Sorry this content is not in your language, you can find it in 'XX'". You can achieve that changing your configuration in Plone's Control Panel.

Regarding the id-changing stuff, you would need anyway to actually edit the content in the translated language. You could use solutions like slc.xliff to ease your work in case your client uses or can use XLIFF based translation software.

You could also easily build a browser view or form to recursively change the ids of the contents based on its titles. It could also be an addon or an addon for our product.

That view to recursively change the ids would be really nice. Maybe I will try to create such a view in the future.

Maybe you can also help me with another question regarding

I have a Plone site with only one language, German. It is already productive and full of content. When I install the extension and add English to the configuration it automatically creates a /de and an /en LRF. At this point the page seem to work normal. Now I guess I have to move all the objects from the root folder to /de. Is that correct? The issue here is that I am not able to set an other default view for the LRF object. There are only a few and it seems not possible to add my own view.
I tried to add my view using the Dextery Types settings but it changes nothing. Any advice?

Yes that's the correct procedure.

To add a new view, you need to write your own view and then register it to be available for LRFs in the portal_types/LRF object, either going to the ZMI and editing there, or adding it in your genericsetup profile of your addon package .

You are very quick! :slight_smile:

I registered that view for="*" in my configure.zcml and it is in fact callable using @@myview.

And you know what? That's weird. I just tried to add the view in portal_types/LRF and it works. But I was sure to have tested this already.

So thank you again. I hope all questions were answered now. Have a nice day.

Plone Foundation Code of Conduct