def METHOD_NAME(self, language: str | None):
    """Load a dictionary for the language specified in the config.
    If that fails, we load a mock dictionary so that lookups don't
    crash. Note that enchant will allow loading an empty string as
    a tag, but this will fail later on. See issue #1096.
    """
    self._enchant = FakeEnchant()
    self._broker = None
    self._language = None
    try:
        import enchant
        if language and enchant.dict_exists(language):
            self._broker = enchant.Broker()
            self._enchant = self._broker.request_dict(language)
            self._language = language
            logger.debug("Enchant spell checking for language '%s' loaded", language)
        else:
            logger.warning("Enchant found no dictionary for language '%s'", language)
    except Exception:
        logger.error("Failed to load enchant spell checking for language '%s'", language)
    if self._enchant is None:
        self._enchant = FakeEnchant()
    else:
        self._userDict.load()
        for word in self._userDict:
            self._enchant.add_to_session(word)
    return