MCPcopy
hub / github.com/opendevops-cn/opendevops / get

Function get

scripts/tornado_source_code/tornado/locale.py:63–74  ·  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

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

Callers

nothing calls this directly

Calls 1

get_closestMethod · 0.80

Tested by

no test coverage detected