How can i switch code depending on plone.app.multilingual is active or not

How can I check in the code whether a website has set up and is using PAM or not? Background: I am creating some data in a folder with a cronjob. In a site with PAM there are several folders, depending on how many languages are configured.

thats my snippet, but it doesn't feel so good

def is_multilingual_setup_active(portal):
    language_tool = getToolByName(portal, "portal_languages")
    languages = language_tool.getSupportedLanguages()
    is_pam_active = False
    for language in languages:
        if language in portal.keys():
            folder = portal[language]
            is_pam_active = folder.portal_type == "LRF"
    return is_pam_active

is there a interface on every content object if PAM is active or not?

Pseudo Code:

def is_multilingual_setup_active(object):
  if PAM_Interface_Marker.providedBy(obj):
      # the object is in a LRF Folder
      ....
  else:
    # the object is in a portal without active pam support

you can check 'plone.app.multilingual.interfaces.ILanguageRootFolder ':
https://github.com/plone/plone.app.multilingual/blob/master/src/plone/app/multilingual/profiles/default/types/LRF.xml

<property name="schema">plone.app.multilingual.interfaces.ILanguageRootFolder</property>

https://github.com/plone/plone.app.multilingual/blob/master/src/plone/app/multilingual/content/lrf.py

@implementer(ILanguageRootFolder, INavigationRoot)
class LanguageRootFolder(Container):
    """LanguageRootFolder custom base class"""

Note: your snippet code check if the last folder in languages is LRF.

plone.app.multilingual adds a browser layer when it is installed, so you could do:

from zope.globalrequest import getRequest
from plone.app.multilingual.interfaces import IPloneAppMultilingualInstalled

request = getRequest()
is_multilingual_active = IPloneAppMultilingualInstalled.providedBy(request)