# Path: mkdocs/config/base.py
# class ValidationError(Exception):
#     """Raised during the validation process of the config on errors."""


import os
import logging
from jinja2.ext import Extension, InternationalizationExtension
from mkdocs.config.base import ValidationError
    from babel.core import Locale, UnknownLocaleError
    from babel.support import Translations, NullTranslations
    from mkdocs.utils.babel_stub import Locale, UnknownLocaleError


try:
    has_babel = True
except ImportError:  # pragma: no cover
    has_babel = False


log = logging.getLogger(__name__)
base_path = os.path.dirname(os.path.abspath(__file__))


class NoBabelExtension(InternationalizationExtension):  # pragma: no cover
    def __init__(self, environment):
        Extension.__init__(self, environment)
        environment.extend(
            install_null_translations=self._install_null,
            newstyle_gettext=False,
        )


def parse_locale(locale):
    try:
        return Locale.parse(locale, sep='_')

# Path: mkdocs/config/base.py
# class ValidationError(Exception):
#     """Raised during the validation process of the config on errors."""


# Path: mkdocs/localization.py
import os
import logging
from jinja2.ext import Extension, InternationalizationExtension
from mkdocs.config.base import ValidationError
    from babel.core import Locale, UnknownLocaleError
    from babel.support import Translations, NullTranslations
    from mkdocs.utils.babel_stub import Locale, UnknownLocaleError



try:
    has_babel = True
except ImportError:  # pragma: no cover
    has_babel = False


log = logging.getLogger(__name__)
base_path = os.path.dirname(os.path.abspath(__file__))


class NoBabelExtension(InternationalizationExtension):  # pragma: no cover
    def __init__(self, environment):
        Extension.__init__(self, environment)
        environment.extend(
            install_null_translations=self._install_null,
            newstyle_gettext=False,
        )


def parse_locale(locale):
    try:
        return Locale.parse(locale, sep='_')

    except (ValueError, UnknownLocaleError, TypeError) as e: