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/s/o/solace-HEAD/solace/views/users.py   solace(Download)
        if len(settings.LANGUAGE_SECTIONS) == 1:
            return redirect(url_for('users.userlist'))
        locale = Locale.parse(locale)
        query = query.active_in(locale)
    query = query.order_by(User.reputation.desc())

src/s/o/solace-HEAD/solace/views/core.py   solace(Download)
def set_language(request, locale):
    """Sets the new locale."""
    try:
        locale = Locale.parse(locale)
        if not has_section(locale):

src/s/o/solace-HEAD/solace/utils/api.py   solace(Download)
    if locale is not None:
        try:
            locale = Locale.parse(locale)
            if not has_locale(locale):
                raise UnknownLocaleError()

src/a/d/adhocracy-HEAD/src/adhocracy/model/user.py   adhocracy(Download)
    def _get_locale(self):
        if not self._locale:
            return None
        return Locale.parse(self._locale)
 

src/a/d/adhocracy-HEAD/src/adhocracy/model/instance.py   adhocracy(Download)
    def _get_locale(self):
        if not self._locale:
            return None
        return Locale.parse(self._locale)
 

src/b/a/babel-HEAD/babel/messages/frontend.py   babel(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/p/l/Plurk_Solace-0.1/solace/database.py   Plurk_Solace(Download)
    def process_result_value(self, value, dialect):
        if value is not None:
            return Locale.parse(value)
 
    def is_mutable(self):

src/s/t/stackgeek-gaeb-HEAD/web/basehandler.py   stackgeek-gaeb(Download)
        locales = {}
        for l in config.locales:
            current_locale = Locale.parse(self.locale)
            language = current_locale.languages[l.split('_')[0]]
            territory = current_locale.territories[l.split('_')[1]]
 
        if self.locale and len(locales) > 1:
            locale_iso = Locale.parse(self.locale)
            language_id = locale_iso.language
            territory_id = locale_iso.territory

src/z/i/zine-HEAD/zine/i18n/__init__.py   zine(Download)
    def load(cls, path, locale=None, domain='messages',
             gettext_lookup=False):
        """Load the translations from the given path."""
        locale = Locale.parse(locale)
        catalog = find_catalog(path, domain, locale, gettext_lookup)
def find_catalog(path, domain, locale, gettext_lookup=False):
    """Finds the catalog for the given locale on the path.  Return sthe
    filename of the .mo file if found, otherwise `None` is returned.
    """
    args = [path, str(Locale.parse(locale)), domain + '.mo']
    for locale in os.listdir(LOCALE_PATH):
        try:
            l = Locale.parse(locale)
        except (ValueError, UnknownLocaleError):
            continue

src/p/r/proofofexistence-HEAD/babel/messages/frontend.py   proofofexistence(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError as e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print(output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError as e:
            parser.error(e)

Previous  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12  Next