MCPcopy
hub / github.com/tornadoweb/tornado / get

Function get

tornado/locale.py:62–73  ·  view source on GitHub ↗

Returns the closest match for the given locale codes. We iterate over all given locale codes in order. If we have a tight or a loose match for the code (e.g., "en" for "en_US"), we return the locale. Otherwise we move to the next code in the list. By default we return ``en_US`` if

(*locale_codes: str)

Source from the content-addressed store, hash-verified

60
61
62def get(*locale_codes: str) -> "Locale":
63 """Returns the closest match for the given locale codes.
64
65 We iterate over all given locale codes in order. If we have a tight
66 or a loose match for the code (e.g., "en" for "en_US"), we return
67 the locale. Otherwise we move to the next code in the list.
68
69 By default we return ``en_US`` if no translations are found for any of
70 the specified locales. You can change the default locale with
71 `set_default_locale()`.
72 """
73 return Locale.get_closest(*locale_codes)
74
75
76def set_default_locale(code: str) -> None:

Callers

nothing calls this directly

Calls 1

get_closestMethod · 0.80

Tested by

no test coverage detected