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/b/a/Babel-CLDR-HEAD/babel/messages/frontend.py   Babel-CLDR(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/j/i/jinjet-HEAD/jinjet.py   jinjet(Download)
    strings. A no-op translation is added for the `default_locale`.
    """
    baselocale = Locale.parse(cli.baselocale)
    result = {baselocale.language: baselocale}
    if not os.path.isdir(cli.catalog):
            print "Warning: Translation found for the base locale [{}]".format(folder)
        if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)):
            locale = Locale.parse(folder)
            result[locale.language] = locale
    return result.values()

src/s/o/solace-HEAD/solace/database.py   solace(Download)
    def process_result_value(self, value, dialect):
        if value is not None:
            return Locale.parse(value)
 
    def is_mutable(self):

src/c/o/coinbox-core-HEAD/cbpos/core.py   coinbox-core(Download)
        for lang in languages:
            try:
                locale = Locale.parse(lang)
            except ValueError:
                logger.debug('Babel does not understand locale %s', repr(lang))

src/l/o/lodgeit-HEAD/lodgeit/i18n/__init__.py   lodgeit(Download)
def get_translations(locale):
    """Get the translation for a locale."""
    locale = Locale.parse(locale)
    translations = _translations.get(str(locale))
    if translations is not None:
            continue
        try:
            l = Locale.parse(filename)
        except UnknownLocaleError:
            continue

src/s/p/spacepaste-HEAD/spacepaste/i18n/__init__.py   spacepaste(Download)
def get_translations(locale):
    """Get the translation for a locale."""
    locale = Locale.parse(locale)
    translations = _translations.get(str(locale))
    if translations is not None:
            continue
        try:
            l = Locale.parse(filename)
        except UnknownLocaleError:
            continue

src/i/n/inyoka-legacy-HEAD/inyoka/i18n/__init__.py   inyoka-legacy(Download)
    if locale is None:
        locale = ctx.cfg['language']
    locale = Locale.parse(locale)
    return locale
 
            continue
        try:
            l = Locale.parse(filename)
        except UnknownLocaleError:
            continue

src/p/o/PO-Projects-0.3.5.1/po_projects/forms.py   PO-Projects(Download)
            data = "_".join(data.split("-"))
            try:
                self.locale_trans = Locale.parse(data)
            except UnknownLocaleError:
                raise forms.ValidationError("Invalid locale")

src/f/i/FireCheckIn-HEAD/kay/management/update_translations.py   FireCheckIn(Download)
      if path.exists(filename):
        print_status('Updating %s' % filename, nl=False)
        locale = Locale.parse(lang_dir)
        f = file(filename)
        try:

src/f/i/FireCheckIn-HEAD/kay/management/add_translations.py   FireCheckIn(Download)
  """
  try:
    locale = Locale.parse(lang)
  except (UnknownLocaleError, ValueError), e:
    print_status("You must specify lang.")

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