]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Update to CLDR 28 (with test updates) 292/head
authorAarni Koskela <akx@iki.fi>
Sun, 20 Dec 2015 19:29:21 +0000 (21:29 +0200)
committerAarni Koskela <akx@iki.fi>
Mon, 21 Dec 2015 17:01:12 +0000 (19:01 +0200)
* 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.

Closes #226
Closes #290

babel/core.py
babel/dates.py
babel/numbers.py
scripts/download_import_cldr.py
tests/messages/test_plurals.py
tests/test_dates.py
tests/test_numbers.py
tests/test_plural.py

index 84ee1892012e4fcbf7479aeefef598337b75b4d2..06070d5150e00c6f1e2ccf5ffe4ec322394242b5 100644 (file)
@@ -113,10 +113,10 @@ class Locale(object):
     If a locale is requested for which no locale data is available, an
     `UnknownLocaleError` is raised:
 
-    >>> Locale.parse('en_DE')
+    >>> Locale.parse('en_XX')
     Traceback (most recent call last):
         ...
-    UnknownLocaleError: unknown locale 'en_DE'
+    UnknownLocaleError: unknown locale 'en_XX'
 
     For more information see :rfc:`3066`.
     """
@@ -432,8 +432,8 @@ class Locale(object):
     script_name = property(get_script_name, doc="""\
         The localized script name of the locale if available.
 
-        >>> Locale('ms', 'SG', script='Latn').script_name
-        u'Latin'
+        >>> Locale('sr', 'ME', script='Latn').script_name
+        u'latinica'
     """)
 
     @property
index 0b73538801df34ad52900c4f15e71e4db5981a7e..ab2d4fb2962938e93e900eb8f9a729282c16ac48 100644 (file)
@@ -582,7 +582,7 @@ def format_datetime(datetime=None, format='medium', tzinfo=None,
 
     >>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'),
     ...                 locale='fr_FR')
-    u'dimanche 1 avril 2007 17:30:00 heure d\u2019\xe9t\xe9 d\u2019Europe centrale'
+    u'dimanche 1 avril 2007 \xe0 17:30:00 heure d\u2019\xe9t\xe9 d\u2019Europe centrale'
     >>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz",
     ...                 tzinfo=get_timezone('US/Eastern'), locale='en')
     u'2007.04.01 AD at 11:30:00 EDT'
@@ -742,7 +742,7 @@ def format_timedelta(delta, granularity='second', threshold=.85,
     The format parameter controls how compact or wide the presentation is:
 
     >>> format_timedelta(timedelta(hours=3), format='short', locale='en')
-    u'3 hrs'
+    u'3 hr'
     >>> format_timedelta(timedelta(hours=3), format='narrow', locale='en')
     u'3h'
 
index f0b0ca1bd4196f3f23a0f08207c3c03a064636e3..e4b3e8ee433702ea60992c83730c7f776f3173a1 100644 (file)
@@ -265,7 +265,7 @@ def format_currency(number, currency, format=None, locale=LC_NUMERIC,
     >>> format_currency(1099.98, 'USD', locale='en_US')
     u'$1,099.98'
     >>> format_currency(1099.98, 'USD', locale='es_CO')
-    u'US$1.099,98'
+    u'US$\\xa01.099,98'
     >>> format_currency(1099.98, 'EUR', locale='de_DE')
     u'1.099,98\\xa0\\u20ac'
 
index f9523aac55fc49368b192020436507458bce805b..4da3423494927246c1ab12f1272483a037680b15 100755 (executable)
@@ -5,7 +5,6 @@ import sys
 import shutil
 import hashlib
 import zipfile
-import urllib
 import subprocess
 try:
     from urllib.request import urlretrieve
@@ -13,9 +12,9 @@ except ImportError:
     from urllib import urlretrieve
 
 
-URL = 'http://unicode.org/Public/cldr/26/core.zip'
-FILENAME = 'core-26.zip'
-FILESUM = '46220170238b092685fd24221f895e3d'
+URL = 'http://unicode.org/Public/cldr/28/core.zip'
+FILENAME = 'core-28.zip'
+FILESUM = 'bc545b4c831e1987ea931b04094d7b9fc59ec3d8'
 BLKSIZE = 131072
 
 
@@ -53,7 +52,7 @@ def is_good_file(filename):
     if not os.path.isfile(filename):
         log('Local copy \'%s\' not found', filename)
         return False
-    h = hashlib.md5()
+    h = hashlib.sha1()
     with open(filename, 'rb') as f:
         while 1:
             blk = f.read(BLKSIZE)
index 8c11745ffc693575215ab0a685c9fa2acc679226..d54857f7baafd2e2bd3a9af4a45ddb41d8b56a75 100644 (file)
@@ -34,7 +34,7 @@ def test_get_plural_accpets_strings():
 
 
 def test_get_plural_falls_back_to_default():
-    assert plurals.get_plural('aa') == (2, '(n != 1)')
+    assert plurals.get_plural('ii') == (2, '(n != 1)')
 
 
 def test_plural_tuple_attributes():
index 0f099f31f379357a0bbfd457378896a18e4cf2b7..ea4805bb876c471d07633cb0db422d49058c22d8 100644 (file)
@@ -282,14 +282,14 @@ class FormatTimedeltaTestCase(unittest.TestCase):
         self.assertEqual('0 seconds', string)
         string = dates.format_timedelta(timedelta(seconds=0), locale='en',
                                         format='short')
-        self.assertEqual('0 secs', string)
+        self.assertEqual('0 sec', string)
         string = dates.format_timedelta(timedelta(seconds=0),
                                         granularity='hour', locale='en')
         self.assertEqual('0 hours', string)
         string = dates.format_timedelta(timedelta(seconds=0),
                                         granularity='hour', locale='en',
                                         format='short')
-        self.assertEqual('0 hrs', string)
+        self.assertEqual('0 hr', string)
 
     def test_small_value_with_granularity(self):
         string = dates.format_timedelta(timedelta(seconds=42),
@@ -465,7 +465,7 @@ def test_format_datetime():
 
     full = dates.format_datetime(dt, 'full', tzinfo=timezone('Europe/Paris'),
                                  locale='fr_FR')
-    assert full == (u'dimanche 1 avril 2007 17:30:00 heure '
+    assert full == (u'dimanche 1 avril 2007 à 17:30:00 heure '
                     u'd\u2019\xe9t\xe9 d\u2019Europe centrale')
     custom = dates.format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz",
                                    tzinfo=timezone('US/Eastern'), locale='en')
index f042833b38875115bca27d7b61e7f45b3391ae87..4b8a48dcecd0ecb858089909092357f3101b3f44 100644 (file)
@@ -230,7 +230,7 @@ def test_format_currency():
     assert (numbers.format_currency(1099.98, 'USD', locale='en_US')
             == u'$1,099.98')
     assert (numbers.format_currency(1099.98, 'USD', locale='es_CO')
-            == u'US$1.099,98')
+            == u'US$\xa01.099,98')
     assert (numbers.format_currency(1099.98, 'EUR', locale='de_DE')
             == u'1.099,98\xa0\u20ac')
     assert (numbers.format_currency(1099.98, 'EUR', u'\xa4\xa4 #,##0.00',
index b0cad8da2cea2860fd456ac728599b07288b94c5..fce1b8e0e5a0e628976dfdb62a37093a2c5b49f4 100644 (file)
@@ -133,10 +133,10 @@ def test_plural_within_rules():
 
 def test_locales_with_no_plural_rules_have_default():
     from babel import Locale
-    aa_plural = Locale.parse('aa').plural_form
-    assert aa_plural(1) == 'other'
-    assert aa_plural(2) == 'other'
-    assert aa_plural(15) == 'other'
+    pf = Locale.parse('ii').plural_form
+    assert pf(1) == 'other'
+    assert pf(2) == 'other'
+    assert pf(15) == 'other'
 
 
 WELL_FORMED_TOKEN_TESTS = (