Skip to content

Commit f170ee3

Browse files
committed
Convert unicode literals to characters
1 parent 9e0b740 commit f170ee3

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

babel/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ def time_zones(self) -> localedata.LocaleDataDict:
839839
>>> Locale('en', 'US').time_zones['Europe/London']['long']['daylight']
840840
'British Summer Time'
841841
>>> Locale('en', 'US').time_zones['America/St_Johns']['city']
842-
'St. John\u2019s'
842+
'St. John’s'
843843
"""
844844
return self._data['time_zones']
845845

@@ -870,7 +870,7 @@ def zone_formats(self) -> localedata.LocaleDataDict:
870870
>>> Locale('en', 'US').zone_formats['fallback']
871871
'%(1)s (%(0)s)'
872872
>>> Locale('pt', 'BR').zone_formats['region']
873-
'Hor\\xe1rio %s'
873+
'Horário %s'
874874
875875
.. versionadded:: 0.9
876876
"""
@@ -981,7 +981,7 @@ def interval_formats(self) -> localedata.LocaleDataDict:
981981
smallest changing component:
982982
983983
>>> Locale('fi_FI').interval_formats['MEd']['d']
984-
['E d.\u2009\u2013\u2009', 'E d.M.']
984+
['E d.\u2009\u2009', 'E d.M.']
985985
986986
.. seealso::
987987
@@ -1045,7 +1045,7 @@ def measurement_systems(self) -> localedata.LocaleDataDict:
10451045
"""Localized names for various measurement systems.
10461046
10471047
>>> Locale('fr', 'FR').measurement_systems['US']
1048-
'am\\xe9ricain'
1048+
'américain'
10491049
>>> Locale('en', 'US').measurement_systems['US']
10501050
'US'
10511051

babel/dates.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def get_timezone_location(
495495
496496
>>> tz = get_timezone('Europe/Berlin')
497497
>>> get_timezone_name(tz, locale='de_DE')
498-
'Mitteleurop\\xe4ische Zeit'
498+
'Mitteleuropäische Zeit'
499499
500500
.. versionadded:: 0.9
501501
@@ -586,9 +586,9 @@ def get_timezone_name(
586586
587587
>>> tz = get_timezone('Europe/Berlin')
588588
>>> get_timezone_name(tz, locale='de_DE')
589-
'Mitteleurop\xe4ische Zeit'
589+
'Mitteleuropäische Zeit'
590590
>>> get_timezone_name(tz, locale='pt_BR')
591-
'Hor\xe1rio da Europa Central'
591+
'Horário da Europa Central'
592592
593593
On the other hand, if the country uses multiple timezones, the city is also
594594
included in the representation:
@@ -1051,16 +1051,16 @@ def format_interval(
10511051
10521052
>>> from datetime import date, time
10531053
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi")
1054-
'15.\u201317.1.2016'
1054+
'15.–17.1.2016'
10551055
10561056
>>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB")
1057-
'12:12\u201316:16'
1057+
'12:12–16:16'
10581058
10591059
>>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US")
10601060
'5:12\u202fAM\u2009\u20094:16\u202fPM'
10611061
10621062
>>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it")
1063-
'16:18\u201316:24'
1063+
'16:18–16:24'
10641064
10651065
If the start instant equals the end instant, the interval is formatted like the instant.
10661066
@@ -1070,10 +1070,10 @@ def format_interval(
10701070
Unknown skeletons fall back to "default" formatting.
10711071
10721072
>>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja")
1073-
'2015/01/01\uff5e2017/01/01'
1073+
'2015/01/01~2017/01/01'
10741074
10751075
>>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja")
1076-
'16:18:00\uff5e16:24:00'
1076+
'16:18:00~16:24:00'
10771077
10781078
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de")
10791079
'15.01.2016\u2009\u200917.01.2016'
@@ -1889,17 +1889,17 @@ def split_interval_pattern(pattern: str) -> list[str]:
18891889
- https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats
18901890
18911891
>>> split_interval_pattern('E d.M. – E d.M.')
1892-
['E d.M. \u2013 ', 'E d.M.']
1892+
['E d.M. ', 'E d.M.']
18931893
>>> split_interval_pattern("Y 'text' Y 'more text'")
18941894
["Y 'text '", "Y 'more text'"]
18951895
>>> split_interval_pattern('E, MMM d – E')
1896-
['E, MMM d \u2013 ', 'E']
1896+
['E, MMM d ', 'E']
18971897
>>> split_interval_pattern("MMM d")
18981898
['MMM d']
18991899
>>> split_interval_pattern("y G")
19001900
['y G']
19011901
>>> split_interval_pattern('MMM d – d')
1902-
['MMM d \u2013 ', 'd']
1902+
['MMM d ', 'd']
19031903
19041904
:param pattern: Interval pattern string
19051905
:return: list of "subpatterns"

babel/lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def format_list(
4646
>>> format_list(['apples', 'oranges', 'pears'], locale='en')
4747
'apples, oranges, and pears'
4848
>>> format_list(['apples', 'oranges', 'pears'], locale='zh')
49-
'apples\u3001oranges\u548cpears'
49+
'apples、oranges和pears'
5050
>>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi')
5151
'omena, peruna tai aplari'
5252

babel/numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ def format_percent(
921921
The format pattern can also be specified explicitly:
922922
923923
>>> format_percent(25.1234, '#,##0\u2030', locale='en_US')
924-
'25,123\u2030'
924+
'25,123'
925925
926926
By default the locale is allowed to truncate and round a high-precision
927927
number by forcing its format pattern onto the decimal part. You can bypass

docs/dates.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,6 @@ display a list of time-zones to the user.
354354
355355
>>> dt = _localize(tz, datetime(2007, 8, 15))
356356
>>> get_timezone_name(dt, locale=Locale.parse('de_DE'))
357-
'Mitteleurop\xe4ische Sommerzeit'
357+
'Mitteleuropäische Sommerzeit'
358358
>>> get_timezone_name(tz, locale=Locale.parse('de_DE'))
359-
'Mitteleurop\xe4ische Zeit'
359+
'Mitteleuropäische Zeit'

0 commit comments

Comments
 (0)