|
4 | 4 | """ |
5 | 5 |
|
6 | 6 | import re |
7 | | -from collections.abc import Mapping, Sequence |
| 7 | +from collections.abc import Sequence |
8 | 8 | from datetime import date, datetime, time, tzinfo |
9 | 9 | from typing import cast |
10 | 10 |
|
|
13 | 13 | from babel.dates import get_datetime_format, get_timezone_name, match_skeleton, parse_pattern |
14 | 14 | from babel.lists import format_list |
15 | 15 |
|
16 | | -from couchers.resources import get_language_dict, get_region_code_iso3166_alpha3_to_alpha2, get_region_dict |
| 16 | +from couchers.resources import get_region_code_iso3166_alpha3_to_alpha2 |
17 | 17 |
|
18 | 18 |
|
19 | 19 | def localize_list(items: Sequence[str], locale: babel.Locale) -> str: |
@@ -57,28 +57,6 @@ def try_localize_region_name_from_iso3166(code: str, locale: babel.Locale) -> st |
57 | 57 | return region_name |
58 | 58 |
|
59 | 59 |
|
60 | | -def get_localized_language_names(locale: babel.Locale) -> Mapping[str, str]: |
61 | | - """ |
62 | | - Maps every allowed language code to its standalone display name in the given locale |
63 | | - (falling back to English), ordered by code. |
64 | | - """ |
65 | | - return { |
66 | | - code: try_localize_language_name_from_iso639(code, locale, standalone=True) or english_name |
67 | | - for code, english_name in sorted(get_language_dict().items()) |
68 | | - } |
69 | | - |
70 | | - |
71 | | -def get_localized_region_names(locale: babel.Locale) -> Mapping[str, str]: |
72 | | - """ |
73 | | - Maps every region alpha3 code to its display name in the given locale |
74 | | - (falling back to English), ordered by code. |
75 | | - """ |
76 | | - return { |
77 | | - alpha3: try_localize_region_name_from_iso3166(alpha3, locale) or english_name |
78 | | - for alpha3, english_name in sorted(get_region_dict().items()) |
79 | | - } |
80 | | - |
81 | | - |
82 | 60 | def localize_date( |
83 | 61 | value: date, locale: babel.Locale, *, abbrev: bool = False, with_year: bool = True, with_day_of_week: bool = False |
84 | 62 | ) -> str: |
|
0 commit comments