Convert site to multilingual

Getting this up because has a lot of precious informations. Maybe this should go to p.a.m. documentation?

I've also found you've to save the object again to have the pam language set, a catalog reindex is not enough. So the strategy is to walk the site, and set the language on the content. This is the browser view I've used to set 'it' on everything other than '/en' where 'en' is set:

from plone.dexterity.browser.view import DefaultView
from zope.component import getMultiAdapter
from plone.app.uuid.utils import uuidToURL
from Products.CMFPlone.interfaces import ILanguage
from zope.component.hooks import getSite
from zope.interface import alsoProvides
from plone.protect.interfaces import IDisableCSRFProtection
from zope.event import notify
from zope.lifecycleevent import modified

class FixView(DefaultView):
    """ Library forms page """

    def __init__(self, context, request):
        self.context = context
        self.request = request

    def __call__(self):
        """"""
        alsoProvides(self.request, IDisableCSRFProtection)
        portal = getSite()
        catalog = portal.portal_catalog

        brains = catalog(path='/Plone/')

        for b in brains:
            path = b.getPath()
            if '/en/' not in path:
                lang ='it'
            else:
                lang='en'
            obj = b.getObject()
            print(path, obj.Language())
            ILanguage(obj).set_language(lang)
            notify(modified(obj))
            print(path, obj.Language())
        return 'done'

(inspired by How do you use collective.lineage (for folders as subsites)? - #5 by pbauer)

This fix most of the problem when converting a site from a manual multilingual (/it, /en and language get from the path, no p.a.m) to a pam site.