]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Convert unicode literals to characters
authorBoris Verkhovskiy <boris.verk@gmail.com>
Thu, 16 Jan 2025 10:43:20 +0000 (03:43 -0700)
committerBoris Verkhovskiy <boris.verk@gmail.com>
Mon, 30 Jun 2025 09:22:45 +0000 (03:22 -0600)
babel/core.py
babel/dates.py
babel/lists.py
babel/numbers.py
docs/dates.rst

index f570c7e7ee0658e52c0c3426e94629af076e3c61..47e89f1518f6544c4c9c0441d60ddf86f8466f4a 100644 (file)
@@ -839,7 +839,7 @@ class Locale:
         >>> 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. Johns'
         """
         return self._data['time_zones']
 
@@ -870,7 +870,7 @@ class Locale:
         >>> 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 @@ class Locale:
         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 @@ class Locale:
         """Localized names for various measurement systems.
 
         >>> Locale('fr', 'FR').measurement_systems['US']
-        'am\\xe9ricain'
+        'américain'
         >>> Locale('en', 'US').measurement_systems['US']
         'US'
 
index 42582ec1b73297546d21684ea3fc093101e242f6..0dc98ee83a54afbcc55230648f9bdca35cf10e45 100644 (file)
@@ -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:
@@ -1051,16 +1051,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:1216: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:1816:24'
 
     If the start instant equals the end instant, the interval is formatted like the instant.
 
@@ -1070,10 +1070,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/012017/01/01'
 
     >>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja")
-    '16:18:00\uff5e16:24:00'
+    '16:18:0016:24:00'
 
     >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de")
     '15.01.2016\u2009–\u200917.01.2016'
@@ -1889,17 +1889,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"
index 24f049ad2112fc5b83ef484d32a2830dc89caf1e..daa7f80100ece644e100a4493f77f93c43024908 100644 (file)
@@ -46,7 +46,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'
 
index fbd3d9e9219c897fad21ef9752ba743398f79875..947cc2f260b0cf76e0338f42cbeb6e77f0dd4c3e 100644 (file)
@@ -921,7 +921,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
index ac5da839867e157508f48cacd46afc93526fdeb4..18b4f1f59cec3ff8680bd7b17e80d44651fe0147 100644 (file)
@@ -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'