ldwoolley [Fri, 7 Oct 2016 23:39:04 +0000 (16:39 -0700)]
Improve Date Fields descriptions for issue #419
Described recommendation to use "Y" with "w" for consistent results in ISO year-week and indicated possible surprising results for year rollover and total number of weeks in a year.
Max Shenfield [Mon, 11 Jul 2016 15:17:15 +0000 (10:17 -0500)]
Updated plurals.py to match Mozilla and CLDR references
This commit updates the plural rules, and in some cases the plural
number, for languages based on review of
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals,
and
http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html.
I changed the interface (either the number of plurals, or the meaning
of each index), for the following languages:
• Arabic (ar): numplurals same, semantics differ per Mozilla's "Plural rule #12". 3 has been made more accurate, 4 has been switched with 5, and the meaning of both has been refined to match the rule.
• Belarusian (ar): numplurals updated to 3, using Mozilla's "Plural
rule #7". Previously the default, where anything except one is plural.
• Breton (br): numplurals updated to 6, using Mozilla's "Plural rule
• Bosnian (bs): numplurals updated to 3, using Mozilla's "Plural rule
• Irish Gaelic (ga): numplurals update from 3 to 5, using Mozilla's
"Plural rule #11". Cases have been added for n between 3 and 6, and n
between 7 and 10.
• Icelandic (is): same numplurals (2), semantics updated using
Mozilla's "Plural rule #15". 0 now means that n ends in 1, and is not
11, instead of just the number 1.
• Maltese (mt): same numplurals, same rule. Fixed rule, index 1 now
includes numbers ending in 1 (except the number 1)
I'm ignoring these two rules listed on the Mozilla resource
• Hungarian - listed as `(n != 1)`. It is not required to pluralize a
noun if a qualitative or quantitative amount precedes it
http://www.hungarianreference.com/plurals.aspx.
• Vietnamese - listed as `(n != 1)`. It only seems to have one plural
according to this lesson:
http://yourvietnamese.com/vietnamese-grammar/nouns-in-vietnamese/.
There are some additional languages listed in the Mozilla reference
that are not in the plurals document, and could be added:
• Lower Sorbian (dsb) (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 ||
n%100==4 ? 2 : 3)')
• Upper Sorbian (hsb) (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 ||
n%100==4 ? 2 : 3)')
• Scottish Gaelic (gd) (4, '(n==1 || n==11 ? 0 : n==2 || n==12 ? 1 :
(n>=3 && n<=10) || (n>=13 && n<=19) ? 2 : 3)')
• Faroese (fo) (2, '(n != 1)')
• Frisian (fy) (2, '(n != 1)')
• Macedonian (mk) (3, '(n%10==1 ? 0 : n%10==2 ? 1 : 2)')
Nicolas Grilly [Fri, 24 Jun 2016 19:49:06 +0000 (21:49 +0200)]
Fix extraction order
Before Babel 2.3, the input directories were always extracted
in the order specified by the command line arguments.
For example, `pybabel extract dir_a dir_b dir_c` would process
`dir_a` first, then `dir_b`, and finally `dir_c`.
Since Babel 2.3, the inputs are stored in a Python dictionary,
and we loop over items in the dictionary using items().
This makes the order unspecified, not matching the order
specified on the command line anymore.
Kenny Root [Fri, 17 Jun 2016 06:11:56 +0000 (23:11 -0700)]
Read locale from .po if it has Language header
When a .po file was written out it would write the "Language"
header, but it wouldn't subsequently read that header back in. This
change makes that symmetric so you can write out a file and get back the
same Catalog by reading it in again.
Additionally other values like charset get overridden when the header is
read, so codify the behavior that the read "Language" header gets set as
the locale of the Catalog object.
Adam Chainz [Sun, 29 May 2016 13:50:32 +0000 (14:50 +0100)]
Convert readthedocs link for their .org -> .io migration for hosted projects
As per their email ‘Changes to project subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
Isaac Jurado [Sun, 29 May 2016 08:50:42 +0000 (10:50 +0200)]
Fix the way local time is constructed in tests
In summer time zones, the test for "get_timezone_name" failed because the
construct used to obtain a local time did not deal properly with DST offsets.
As recommended by pytz, it is better to convert to local time from UTC.
Isaac Jurado [Sun, 29 May 2016 07:40:24 +0000 (09:40 +0200)]
Simplify the selection of decimal implementation
Instead of selecting individual symbols, expose only the chosen decimal module
through babel._compat. This forces Babel to always use "decimal." prefix.
Howver, it will simplify the code for users that need to manipulate the decimal
context.
Isaac Jurado [Sat, 28 May 2016 21:00:24 +0000 (23:00 +0200)]
Remove explicit enforcement from Decimal rounding
Allow the rounding mode to be controlled from the currently active decimal
context. This gives the caller the ability to control rounding mode, precision,
exponent range and all attributes that affect decimal operations.
dates: Use format context and fallback through widths
`zh_Hant` locale data does not have names for the
`am` and `pm` day periods in the `format`/`abbreviated` context,
so fallback logic is added to deal with that eventuality.
plurals: correct plural forms for cs and sk locales
Change plural forms for Czech (cs) and Slovak (sk) locales from Plural rule #_7_ to Plural rule #_8_ according to https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals .