Python flask_babelex.Domain() Examples

The following are 2 code examples of flask_babelex.Domain(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask_babelex , or try the search function .
Example #1
Source File: core.py    From flask-security with MIT License 5 votes vote down vote up
def _get_i18n_domain(app):
    return Domain(
        dirname=cv("I18N_DIRNAME", app=app), domain=cv("I18N_DOMAIN", app=app)
    ) 
Example #2
Source File: __init__.py    From flask-unchained with MIT License 5 votes vote down vote up
def _get_domain(match):
    domain_name = match.groupdict()['domain']
    try:
        domain_resources = pkg_resources.resource_filename(domain_name, 'translations')
    except ImportError:
        return current_app.extensions['babel']._default_domain

    return Domain(domain_resources, domain=domain_name)