def __init__(self, app=None, date_formats=None, localeselector=None,
                 timezoneselector=None,
                 entry_point_group='invenio_i18n.translations'):
        """Initialize extension.

        :param app: Flask application.
        :param data_formats: Override default date/time formatting.
        :param localeselector: Callback function used for locale selection.
            (Default: :func:`invenio_i18n.selectors.get_locale()`)
        :param timezoneselector: Callback function used for timezone selection.
            (Default: ``BABEL_DEFAULT_TIMEZONE``)
        :param entry_point_group: Entrypoint used to load translations from.
            Set to ``None`` to not load translations from entry points.
        """
        self.domain = MultidirDomain()
        self.babel = Babel(
            date_formats=date_formats,
            configure_jinja=True,
            default_domain=self.domain,
        )
        self.localeselector = localeselector
        self.timezoneselector = timezoneselector
        self.entry_point_group = entry_point_group
        self._locales_cache = None
        self._languages_cache = None

        if app:
            self.init_app(app)
def __init__ ( self , app = None , date_formats = None , localeselector = None , timezoneselector = None , entry_point_group = 'invenio_i18n.translations' ) : self . domain = MultidirDomain ( ) self . babel = Babel ( date_formats = date_formats , configure_jinja = True , default_domain = self . domain , ) self . localeselector = localeselector self . timezoneselector = timezoneselector self . entry_point_group = entry_point_group self . _locales_cache = None self . _languages_cache = None if app : self . init_app ( app )
Initialize extension.

        :param app: Flask application.
        :param data_formats: Override default date/time formatting.
        :param localeselector: Callback function used for locale selection.
            (Default: :func:`invenio_i18n.selectors.get_locale()`)
        :param timezoneselector: Callback function used for timezone selection.
            (Default: ``BABEL_DEFAULT_TIMEZONE``)
        :param entry_point_group: Entrypoint used to load translations from.
            Set to ``None`` to not load translations from entry points.