diff --git a/babel/core.py b/babel/core.py index 7c2578e8c..2295a87cb 100644 --- a/babel/core.py +++ b/babel/core.py @@ -839,7 +839,7 @@ def time_zones(self) -> localedata.LocaleDataDict: >>> Locale('en', 'US').time_zones['Europe/London']['long']['daylight'] 'British Summer Time' >>> Locale('en', 'US').time_zones['America/St_Johns']['city'] - 'St. John\u2019s' + 'St. John’s' """ return self._data['time_zones'] @@ -870,7 +870,7 @@ def zone_formats(self) -> localedata.LocaleDataDict: >>> Locale('en', 'US').zone_formats['fallback'] '%(1)s (%(0)s)' >>> Locale('pt', 'BR').zone_formats['region'] - 'Hor\\xe1rio %s' + 'Horário %s' .. versionadded:: 0.9 """ @@ -981,7 +981,7 @@ def interval_formats(self) -> localedata.LocaleDataDict: smallest changing component: >>> Locale('fi_FI').interval_formats['MEd']['d'] - ['E d.\u2009\u2013\u2009', 'E d.M.'] + ['E d.\u2009–\u2009', 'E d.M.'] .. seealso:: @@ -1045,7 +1045,7 @@ def measurement_systems(self) -> localedata.LocaleDataDict: """Localized names for various measurement systems. >>> Locale('fr', 'FR').measurement_systems['US'] - 'am\\xe9ricain' + 'américain' >>> Locale('en', 'US').measurement_systems['US'] 'US' diff --git a/babel/dates.py b/babel/dates.py index b15b29044..484092210 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -495,7 +495,7 @@ def get_timezone_location( >>> tz = get_timezone('Europe/Berlin') >>> get_timezone_name(tz, locale='de_DE') - 'Mitteleurop\\xe4ische Zeit' + 'Mitteleuropäische Zeit' .. versionadded:: 0.9 @@ -586,9 +586,9 @@ def get_timezone_name( >>> tz = get_timezone('Europe/Berlin') >>> get_timezone_name(tz, locale='de_DE') - 'Mitteleurop\xe4ische Zeit' + 'Mitteleuropäische Zeit' >>> get_timezone_name(tz, locale='pt_BR') - 'Hor\xe1rio da Europa Central' + 'Horário da Europa Central' On the other hand, if the country uses multiple timezones, the city is also included in the representation: @@ -1049,16 +1049,16 @@ def format_interval( >>> from datetime import date, time >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi") - '15.\u201317.1.2016' + '15.–17.1.2016' >>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB") - '12:12\u201316:16' + '12:12–16:16' >>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US") '5:12\u202fAM\u2009–\u20094:16\u202fPM' >>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it") - '16:18\u201316:24' + '16:18–16:24' If the start instant equals the end instant, the interval is formatted like the instant. @@ -1068,10 +1068,10 @@ def format_interval( Unknown skeletons fall back to "default" formatting. >>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja") - '2015/01/01\uff5e2017/01/01' + '2015/01/01~2017/01/01' >>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja") - '16:18:00\uff5e16:24:00' + '16:18:00~16:24:00' >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de") '15.01.2016\u2009–\u200917.01.2016' @@ -1884,17 +1884,17 @@ def split_interval_pattern(pattern: str) -> list[str]: - https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats >>> split_interval_pattern('E d.M. – E d.M.') - ['E d.M. \u2013 ', 'E d.M.'] + ['E d.M. – ', 'E d.M.'] >>> split_interval_pattern("Y 'text' Y 'more text'") ["Y 'text '", "Y 'more text'"] >>> split_interval_pattern('E, MMM d – E') - ['E, MMM d \u2013 ', 'E'] + ['E, MMM d – ', 'E'] >>> split_interval_pattern("MMM d") ['MMM d'] >>> split_interval_pattern("y G") ['y G'] >>> split_interval_pattern('MMM d – d') - ['MMM d \u2013 ', 'd'] + ['MMM d – ', 'd'] :param pattern: Interval pattern string :return: list of "subpatterns" diff --git a/babel/lists.py b/babel/lists.py index 5217e7cb0..539aaefe5 100644 --- a/babel/lists.py +++ b/babel/lists.py @@ -51,7 +51,7 @@ def format_list( >>> format_list(['apples', 'oranges', 'pears'], locale='en') 'apples, oranges, and pears' >>> format_list(['apples', 'oranges', 'pears'], locale='zh') - 'apples\u3001oranges\u548cpears' + 'apples、oranges和pears' >>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi') 'omena, peruna tai aplari' diff --git a/babel/numbers.py b/babel/numbers.py index 5b1c97037..a6c8a558e 100644 --- a/babel/numbers.py +++ b/babel/numbers.py @@ -917,7 +917,7 @@ def format_percent( The format pattern can also be specified explicitly: >>> format_percent(25.1234, '#,##0\u2030', locale='en_US') - '25,123\u2030' + '25,123‰' By default the locale is allowed to truncate and round a high-precision number by forcing its format pattern onto the decimal part. You can bypass diff --git a/docs/dates.rst b/docs/dates.rst index 2fb98b631..f3498f3ad 100644 --- a/docs/dates.rst +++ b/docs/dates.rst @@ -354,6 +354,6 @@ display a list of time-zones to the user. >>> dt = _localize(tz, datetime(2007, 8, 15)) >>> get_timezone_name(dt, locale=Locale.parse('de_DE')) - 'Mitteleurop\xe4ische Sommerzeit' + 'Mitteleuropäische Sommerzeit' >>> get_timezone_name(tz, locale=Locale.parse('de_DE')) - 'Mitteleurop\xe4ische Zeit' + 'Mitteleuropäische Zeit'