Sven Anderson [Wed, 27 Jan 2016 14:35:20 +0000 (15:35 +0100)]
Frontend: Add multi-domain support to compile_catalog command
Some projects have their translations split up into several text
domains within one package. This change adds the possibility to
specify a space seperated list of domains in the configuration, like
'setup.py compile_catalog --domain="foo bar"', for instance.
Eoin Nugent [Mon, 11 Jan 2016 22:43:58 +0000 (14:43 -0800)]
extraction: Babel now supports extraction by filename as well as by dir
One can now supply a filename or a directory to be extracted. For
large codebases, this allows the consumer to optimize their
string extraction process by, for instance, only supplying the
files that have actually been changed on the given dev's branch
compared to master.
Relates to https://github.com/python-babel/babel/issues/253 . I
don't want to say "fixes", but makes further optimization
unnecessary for most use cases.
Michael Birtwell [Mon, 28 Sep 2015 16:44:30 +0000 (17:44 +0100)]
Add support for date-time skeletons
The skeletons for dates and times are described on
http://cldr.unicode.org/translation/date-time-patterns under
Additional Date-Time Formats. And are useful when you want to some more
control over formatting dates and times but don't want to force all
locales to use the same pattern.
Roman Imankulov [Tue, 13 Oct 2015 11:18:48 +0000 (11:18 +0000)]
Fix UnicodeEncodeError on file encoding detection
If the first line of a python file is not a valid latin-1 string,
parse_encoding dies with "UnicodeDecodeError". These strings nonetheless can be
valid in some scenarios (for example, Mako extractor uses
babel.messages.extract.extract_python), and it makes more sense to ignore this
exception and return None.
David Stanek [Thu, 5 Sep 2013 17:15:57 +0000 (13:15 -0400)]
Updates a catalog's header to from the template
A language specific catalog's initial header is based on the template
when it is created. Updates to the template's header were previously
not getting into the catalog during the update_catalog process.
Aarni Koskela [Sun, 20 Dec 2015 19:29:21 +0000 (21:29 +0200)]
Update to CLDR 28 (with test updates)
* Aside from the usual data changes, the provisional aa locale is no longer,
so we can't use it for tests. Instead, ii is used (chosen by virtue of ii.xml
being fairly small, i.e. probably as incomplete as aa).
* ms_Latn_SG is not in use anymore either; use sr_Latn_ME instead.
Lasse Schuirmann [Mon, 21 Dec 2015 09:50:45 +0000 (10:50 +0100)]
catalog: Remove unneeded documentation
Those documentation comments aren't adding any new information compared
to the documentation comment of their respective functions and are thus
redundant.
Those comments where introduced first in 7ab115ce with no notice why
they exist.
Aarni Koskela [Sun, 20 Dec 2015 22:43:39 +0000 (00:43 +0200)]
Test/CI: Add requisite doctest flags; ignore setup.py and venvs
This requires a newer version of py.test, so the requirement is pinned in
the CI configuration.
See https://pytest.org/latest/doctest.html
See https://pytest.org/latest/example/pythoncollection.html#customizing-test-collection-to-find-all-py-files
Michael Birtwell [Wed, 21 Oct 2015 21:01:59 +0000 (22:01 +0100)]
plurals: Fix selection for chinese
Provide only one option in chinese. The 3 previous options where all the
same any how and I've checked with a chinese colleague she thinks that
applies to all variants on the chinese language.
Refactor the get_plural tests a bit so they are split up to test specific
things
Isaac Jurado [Sun, 11 Oct 2015 12:26:04 +0000 (14:26 +0200)]
tests: Use the automatically chosen Decimal class
Now that the babel._compat module can automatically select a faster decimal
implementation if available, be more consistent across the rest of the code when
dealing with Decimal instances.
Isaac Jurado [Sun, 4 Oct 2015 18:49:23 +0000 (20:49 +0200)]
numbers: Use cdecimal by default when available
The drop-in replacement cdecimal is a CPython extension that implements the same
decimal interface with a much better performance. Whenever it is installed, we
favour its use.
Isaac Jurado [Sun, 11 Oct 2015 12:20:01 +0000 (14:20 +0200)]
travis: Add new environments that install cdecimal
For the next change, we will need alternate environments for Python 2.6 and 2.7
where the cdecimal module can be installed and tested. This commit adds new
environments to Tox and Travis to automate the process.
Isaac Jurado [Sun, 4 Oct 2015 18:36:02 +0000 (20:36 +0200)]
numbers: Implement rounding with Decimal
Drop the old bankersround related code and implement rounding using the decimal
module instead. This change will enable some other goodies such as: use the
drop-in replacement cdecimal when available, or allow for more rounding
algorithms by exposing one more parameter.
Todd M. Guerra [Wed, 30 Sep 2015 20:11:06 +0000 (16:11 -0400)]
setup: change to using include_package_data
Instead of manually writing includes to various package data,
we now just set include_package_data to True to make it more efficient.
Reference: http://pythonhosted.org/setuptools/setuptools.html#new-and-changed-setup-keywords