Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can plone.app.multilingual work for partially translated sites?

I'm trying to get plone.app.multilingual to work with a site which is currently in English, but will become partially translated. I'm using plone.app.multilingual rather than the more familiar LinguaPlone because of Dexterity content types used by the site which LinguaPlone does not support.

I have a test site to play with. As soon as I translate one page it seems to create a /en folder for the English content and (e.g.) /fr one for the French. I can switch back and forth between the two language variants of the page, but once I'm in the French language I can't see all the other English pages. As a site visitor this is no use and it ignores the fact that although a browser may be set to prefer French, it might also accept English. I have selected what I believe to be the relevant options to allow fallback to the default site language and it lets me view them if I know the URL of the page, but that's not much use if I don't see that the content is there in the first place.

Can plone.app.multilingual be made to work in such a way that a user can see a page of content in some language even if it's not their own, or is my only option to convert the site to use Archetypes?

Thanks.

like image 540
Richard W Avatar asked Nov 04 '22 21:11

Richard W


1 Answers

LinguaPlone would handle this case the same way: Make all content 'language neutral', except for where there is a translation.

By marking all your content 'language neutral', it'll be found and displayed to the end-user no matter what language preference has been set. Now, if any of your content does have a translsation, you do need to set English as the language for the original version so that it'll only be displayed when English is selected.

To do this, you probably can use a subscriber to the plone.multilingual.events.IObjectTranslatedEvent.

As for the creation of en/ and fr/ locations for your content, that's the task of the ITranslationLocator adapter (from plone.multilingual.interfaces, you can override that adapter to provide your own choices. See the default implementations for how this currently works.

like image 92
Martijn Pieters Avatar answered Nov 09 '22 23:11

Martijn Pieters