- Daniel Neuhäuser <dasdasich@gmail.com>
- Nick Retallack <nick@bitcasa.com>
- Thomas Waldmann <tw@waldmann-edv.de>
+- Lennart Regebro <regebro@gmail.com>
Babel was previously developed under the Copyright of Edgewall Software. The
following copyright notice holds true for releases before 2013: "Copyright (c)
2007 - 2011 by Edgewall Software"
+
+In addition to the regular contributions Babel includes a fork of Lennart
+Regebro's tzlocal that originally was licensed under the CC0 license. The
+original copyright of that project is "Copyright 2013 by Lennart Regebro".
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
+"""
+ babel
+ ~~~~~
-"""Integrated collection of utilities that assist in internationalizing and
-localizing applications.
+ Integrated collection of utilities that assist in internationalizing and
+ localizing applications.
-This package is basically composed of two major parts:
+ This package is basically composed of two major parts:
- * tools to build and work with ``gettext`` message catalogs
- * a Python interface to the CLDR (Common Locale Data Repository), providing
- access to various locale display names, localized number and date
- formatting, etc.
+ * tools to build and work with ``gettext`` message catalogs
+ * a Python interface to the CLDR (Common Locale Data Repository), providing
+ access to various locale display names, localized number and date
+ formatting, etc.
-:see: http://www.gnu.org/software/gettext/
-:see: http://docs.python.org/lib/module-gettext.html
-:see: http://www.unicode.org/cldr/
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from babel.core import UnknownLocaleError, Locale, default_locale, \
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-
import sys
PY2 = sys.version_info[0] == 2
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Core locale representation and locale data access."""
+"""
+ babel.core
+ ~~~~~~~~~~
+
+ Core locale representation and locale data access.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import os
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Locale dependent formatting and parsing of dates and times.
-
-The default locale for the functions in this module is determined by the
-following environment variables, in that order:
-
- * ``LC_TIME``,
- * ``LC_ALL``, and
- * ``LANG``
+"""
+ babel.dates
+ ~~~~~~~~~~~
+
+ Locale dependent formatting and parsing of dates and times.
+
+ The default locale for the functions in this module is determined by the
+ following environment variables, in that order:
+
+ * ``LC_TIME``,
+ * ``LC_ALL``, and
+ * ``LANG``
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from __future__ import division
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Low-level locale data access.
-
-:note: The `Locale` class, which uses this module under the hood, provides a
- more convenient interface for accessing the locale data.
+"""
+ babel.localedata
+ ~~~~~~~~~~~~~~~~
+
+ Low-level locale data access.
+
+ :note: The `Locale` class, which uses this module under the hood, provides a
+ more convenient interface for accessing the locale data.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
+# -*- coding: utf-8 -*-
+"""
+ babel.localtime
+ ~~~~~~~~~~~~~~~
+
+ Babel specific fork of tzlocal to determine the local timezone
+ of the system.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
+
import sys
import pytz
import time
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
+"""
+ babel.messages
+ ~~~~~~~~~~~~~~
-"""Support for ``gettext`` message catalogs."""
+ Support for ``gettext`` message catalogs.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from babel.messages.catalog import *
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Data structures for message catalogs."""
+"""
+ babel.messages.catalog
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Data structures for message catalogs.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from cgi import parse_header
from datetime import datetime, time as time_
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Various routines that help with validation of translations.
-
-:since: version 0.9
+"""
+ babel.messages.checkers
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Various routines that help with validation of translations.
+
+ :since: version 0.9
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from babel.messages.catalog import TranslationError, PYTHON_FORMAT
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Basic infrastructure for extracting localizable messages from source files.
-
-This module defines an extensible system for collecting localizable message
-strings from a variety of sources. A native extractor for Python source files
-is builtin, extractors for other sources can be added using very simple plugins.
-
-The main entry points into the extraction functionality are the functions
-`extract_from_dir` and `extract_from_file`.
+"""
+ babel.messages.extract
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Basic infrastructure for extracting localizable messages from source files.
+
+ This module defines an extensible system for collecting localizable message
+ strings from a variety of sources. A native extractor for Python source
+ files is builtin, extractors for other sources can be added using very
+ simple plugins.
+
+ The main entry points into the extraction functionality are the functions
+ `extract_from_dir` and `extract_from_file`.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Frontends for the message extraction functionality."""
+"""
+ babel.messages.frontend
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Frontends for the message extraction functionality.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
try:
from ConfigParser import RawConfigParser
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2008-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""A simple JavaScript 1.5 lexer which is used for the JavaScript
-extractor.
+"""
+ babel.messages.jslexer
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ A simple JavaScript 1.5 lexer which is used for the JavaScript
+ extractor.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
from operator import itemgetter
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Writing of files in the ``gettext`` MO (machine object) format.
-
-:since: version 0.9
-:see: `The Format of MO Files
- <http://www.gnu.org/software/gettext/manual/gettext.html#MO-Files>`_
+"""
+ babel.messages.mofile
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Writing of files in the ``gettext`` MO (machine object) format.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import array
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Plural form definitions."""
+"""
+ babel.messages.plurals
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Plural form definitions.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
from babel.core import default_locale, Locale
from operator import itemgetter
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Reading and writing of files in the ``gettext`` PO (portable object)
-format.
-
-:see: `The Format of PO Files
- <http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files>`_
+"""
+ babel.messages.pofile
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Reading and writing of files in the ``gettext`` PO (portable object)
+ format.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import os
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Locale dependent formatting and parsing of numeric data.
-
-The default locale for the functions in this module is determined by the
-following environment variables, in that order:
-
- * ``LC_NUMERIC``,
- * ``LC_ALL``, and
- * ``LANG``
+"""
+ babel.numbers
+ ~~~~~~~~~~~~~
+
+ Locale dependent formatting and parsing of numeric data.
+
+ The default locale for the functions in this module is determined by the
+ following environment variables, in that order:
+
+ * ``LC_NUMERIC``,
+ * ``LC_ALL``, and
+ * ``LANG``
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
# TODO:
# Padding and rounding increments in pattern:
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2008-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""CLDR Plural support. See UTS #35. EXPERIMENTAL"""
+"""
+ babel.numbers
+ ~~~~~~~~~~~~~
+
+ CLDR Plural support. See UTS #35.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import re
'to_python']
-
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
_fallback_tag = 'other'
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Several classes and functions that help with integrating and using Babel
-in applications.
-
-.. note: the code in this module is not used by Babel itself
+"""
+ babel.support
+ ~~~~~~~~~~~~~
+
+ Several classes and functions that help with integrating and using Babel
+ in applications.
+
+ .. note: the code in this module is not used by Babel itself
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
"""
import gettext
__all__ = ['Format', 'LazyProxy', 'NullTranslations', 'Translations']
-
class Format(object):
"""Wrapper class providing the various date and number formatting functions
bound to a specific locale and time-zone.
# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007-2011 Edgewall Software
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://babel.edgewall.org/wiki/License.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For the exact contribution history, see the revision
-# history and logs, available at http://babel.edgewall.org/log/.
-
-"""Various utility classes and functions."""
+"""
+ babel.util
+ ~~~~~~~~~~
+
+ Various utility classes and functions.
+
+ :copyright: (c) 2013 by the Babel Team.
+ :license: BSD, see LICENSE for more details.
+"""
import codecs
from datetime import timedelta, tzinfo
'LOCALTZ']
-
def distinct(iterable):
"""Yield all items in an iterable collection that are distinct.