def METHOD_NAME(language=None):
    """Extracts the default system language and applies it on systems that
    don't set the 'LANGUAGE' environment variable by default (Windows,
    macOS)"""
    if not language and os.getenv("LANGUAGE") is None:
        if sys.platform == "win32":
            import ctypes
            windll = ctypes.windll.kernel32
            language = locale.windows_locale.get(windll.GetUserDefaultUILanguage())
        elif sys.platform == "darwin":
            try:
                import subprocess
                language_output = subprocess.check_output(("defaults", "read", "-g", "AppleLanguages"))
                languages = language_output.decode("utf-8").strip('()\n" ').split(",")
                language = next(iter(languages), None)
            except Exception as error:
                print("Cannot load translations for default system language: %s", error)
    if language:
        os.environ["LANGUAGE"] = language