diff options
author | Aarni Koskela <akx@iki.fi> | 2023-01-20 16:55:38 +0200 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-01-20 17:09:15 +0200 |
commit | d76db13414a6104019edc0dbafa82410e8d08e63 (patch) | |
tree | 3561491f7d69fdfdca78dbe1ed0283c21e1f1703 /babel | |
parent | 87ba449463cf590947ecd664a5c9ad8a3881e488 (diff) | |
download | babel-d76db13414a6104019edc0dbafa82410e8d08e63.tar.gz |
Adjust tests for CLDR 42
The space changes around English seem to be on purpose, see:
* https://unicode-org.atlassian.net/browse/CLDR-14032
* https://github.com/unicode-org/cldr/commit/a83026ab8c8fa6ed88f1047c4d0c6089f88b7e5d
Diffstat (limited to 'babel')
-rw-r--r-- | babel/core.py | 4 | ||||
-rw-r--r-- | babel/dates.py | 18 | ||||
-rw-r--r-- | babel/numbers.py | 4 | ||||
-rw-r--r-- | babel/support.py | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/babel/core.py b/babel/core.py index ce564d7..7d31910 100644 --- a/babel/core.py +++ b/babel/core.py @@ -855,7 +855,7 @@ class Locale: Babel versions. >>> Locale('en', 'US').time_formats['short'] - <DateTimePattern u'h:mm a'> + <DateTimePattern u'h:mm\u202fa'> >>> Locale('fr', 'FR').time_formats['long'] <DateTimePattern u'HH:mm:ss z'> """ @@ -869,7 +869,7 @@ class Locale: Babel versions. >>> Locale('en').datetime_formats['full'] - u"{1} 'at' {0}" + u'{1}, {0}' >>> Locale('th').datetime_formats['medium'] u'{1} {0}' """ diff --git a/babel/dates.py b/babel/dates.py index e626df5..ce79318 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -497,7 +497,7 @@ def get_time_format(format: _PredefinedTimeFormat = 'medium', locale: Locale | s format. >>> get_time_format(locale='en_US') - <DateTimePattern u'h:mm:ss a'> + <DateTimePattern u'h:mm:ss\u202fa'> >>> get_time_format('full', locale='de_DE') <DateTimePattern u'HH:mm:ss zzzz'> @@ -580,14 +580,14 @@ def get_timezone_location( >>> tz = get_timezone('America/St_Johns') >>> print(get_timezone_location(tz, locale='de_DE')) - Kanada (St. John’s) Zeit + Kanada (St. John’s) (Ortszeit) >>> print(get_timezone_location(tz, locale='en')) Canada (St. John’s) Time >>> print(get_timezone_location(tz, locale='en', return_city=True)) St. John’s >>> tz = get_timezone('America/Mexico_City') >>> get_timezone_location(tz, locale='de_DE') - u'Mexiko (Mexiko-Stadt) Zeit' + u'Mexiko (Mexiko-Stadt) (Ortszeit)' If the timezone is associated with a country that uses only a single timezone, just the localized country name is returned: @@ -823,13 +823,13 @@ def format_datetime( >>> from datetime import datetime >>> dt = datetime(2007, 4, 1, 15, 30) >>> format_datetime(dt, locale='en_US') - u'Apr 1, 2007, 3:30:00 PM' + u'Apr 1, 2007, 3:30:00\u202fPM' For any pattern requiring the display of the timezone: >>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'), ... locale='fr_FR') - 'dimanche 1 avril 2007 à 17:30:00 heure d’été d’Europe centrale' + 'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe 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' @@ -864,7 +864,7 @@ def format_time( >>> from datetime import datetime, time >>> t = time(15, 30) >>> format_time(t, locale='en_US') - u'3:30:00 PM' + u'3:30:00\u202fPM' >>> format_time(t, format='short', locale='de_DE') u'15:30' @@ -905,7 +905,7 @@ def format_time( u'15:30:00 heure normale d\u2019Europe centrale' >>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'), ... locale='en_US') - u'3:30:00 PM Eastern Standard Time' + u'3:30:00\u202fPM Eastern Standard Time' :param time: the ``time`` or ``datetime`` object; if `None`, the current time in UTC is used @@ -1137,7 +1137,7 @@ def format_interval( '12:12\u201316:16' >>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US") - '5:12 AM \u2013 4:16 PM' + '5:12\u202fAM\u2009–\u20094:16\u202fPM' >>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it") '16:18\u201316:24' @@ -1156,7 +1156,7 @@ def format_interval( '16:18:00\uff5e16:24:00' >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de") - '15.01.2016 \u2013 17.01.2016' + '15.01.2016\u2009–\u200917.01.2016' :param start: First instant (datetime/date/time) :param end: Second instant (datetime/date/time) diff --git a/babel/numbers.py b/babel/numbers.py index 399b70b..d107046 100644 --- a/babel/numbers.py +++ b/babel/numbers.py @@ -558,9 +558,9 @@ def format_currency( """Return formatted currency value. >>> format_currency(1099.98, 'USD', locale='en_US') - u'$1,099.98' + '$1,099.98' >>> format_currency(1099.98, 'USD', locale='es_CO') - u'US$\\xa01.099,98' + u'US$1.099,98' >>> format_currency(1099.98, 'EUR', locale='de_DE') u'1.099,98\\xa0\\u20ac' diff --git a/babel/support.py b/babel/support.py index 242b492..aa7d827 100644 --- a/babel/support.py +++ b/babel/support.py @@ -83,7 +83,7 @@ class Format: >>> from babel.dates import get_timezone >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern')) >>> fmt.datetime(datetime(2007, 4, 1, 15, 30)) - u'Apr 1, 2007, 11:30:00 AM' + u'Apr 1, 2007, 11:30:00\u202fAM' """ return format_datetime(datetime, format, tzinfo=self.tzinfo, locale=self.locale) @@ -98,7 +98,7 @@ class Format: >>> from babel.dates import get_timezone >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern')) >>> fmt.time(datetime(2007, 4, 1, 15, 30)) - u'11:30:00 AM' + u'11:30:00\u202fAM' """ return format_time(time, format, tzinfo=self.tzinfo, locale=self.locale) |