Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(258)  |  Call(258)  |  Derive(0)  |  Import(0)
Create a `Locale` instance for the given locale identifier.

>>> l = Locale.parse('de-DE', sep='-')
>>> l.display_name
u'Deutsch (Deutschland)'

If the `identifier` parameter is not a string, but actually a `Locale`
object, that object is returned:

>>> Locale.parse(l)(more...)

src/m/i/microblog-HEAD/flask/lib/python2.7/site-packages/flask_babel/__init__.py   microblog(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/m/e/me-HEAD/libs/flaskext/babel.py   me(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/w/e/WebPutty-HEAD/ziplibs/flaskext/babel.py   WebPutty(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/f/l/Flask-Babel-0.9/flask_babel/__init__.py   Flask-Babel(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/f/l/Flask-BabelPkg-0.9.6/flask_babelpkg/__init__.py   Flask-BabelPkg(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/f/l/flask-babel-HEAD/flask_babel/__init__.py   flask-babel(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/p/l/Plurk_Solace-0.1/solace/application.py   Plurk_Solace(Download)
            if view_lang is not None:
                try:
                    self.view_lang = Locale.parse(view_lang)
                    if not has_section(self.view_lang):
                        raise UnknownLocaleError(str(self.view_lang))
        rv = self.session.get('locale')
        if rv is not None:
            rv = Locale.parse(rv)
            # we could trust the cookie here because it's signed, but we do not
            # because the configuration could have changed in the meantime.
    def _set_locale(self, locale):
        self._locale = Locale.parse(locale)
        self.__dict__.pop('translations', None)
        self.session['locale'] = str(self._locale)
    locale = property(_get_locale, _set_locale)

src/f/l/Flask-Babel2-0.1/flask_babel.py   Flask-Babel2(Download)
                continue
            if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
                result.append(Locale.parse(folder))
        if not result:
            result.append(Locale.parse(self._default_locale))
    def default_locale(self):
        """The default locale from the configuration as instance of a
        `babel.Locale` object.
        """
        return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE'])
                locale = babel.default_locale
            else:
                locale = Locale.parse(rv)
        ctx.babel_locale = locale
    return locale

src/s/o/solace-HEAD/solace/application.py   solace(Download)
            if view_lang is not None:
                try:
                    self.view_lang = Locale.parse(view_lang)
                    if not has_section(self.view_lang):
                        raise UnknownLocaleError(str(self.view_lang))
        rv = self.session.get('locale')
        if rv is not None:
            rv = Locale.parse(rv)
            # we could trust the cookie here because it's signed, but we do not
            # because the configuration could have changed in the meantime.
    def _set_locale(self, locale):
        self._locale = Locale.parse(locale)
        self.__dict__.pop('translations', None)
        self.session['locale'] = str(self._locale)
    locale = property(_get_locale, _set_locale)

src/t/r/trac-HEAD/trac/util/datefmt.py   trac(Download)
                if l.startswith(locale.language.lower() + '_'):
                    try:
                        l = Locale.parse(l)
                        if l.territory:
                            locale = l
                            break
                    except UnknownLocaleError:
                        pass
        if not locale.territory and locale.language in LOCALE_ALIASES:
            locale = Locale.parse(LOCALE_ALIASES[locale.language])
        patterns = _I18N_PARSE_DATE_PATTERNS_LIBC
    else:
        locale = Locale.parse(locale)
        key = str(locale)
        patterns = _I18N_PARSE_DATE_PATTERNS

Previous  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next