MCPcopy Create free account
hub / github.com/python-pendulum/pendulum / normalize_locale

Method normalize_locale

src/pendulum/locales/locale.py:51–56  ·  view source on GitHub ↗
(cls, locale: str)

Source from the content-addressed store, hash-verified

49
50 @classmethod
51 def normalize_locale(cls, locale: str) -> str:
52 m = re.fullmatch("([a-z]{2})[-_]([a-z]{2})", locale, re.I)
53 if m:
54 return f"{m.group(1).lower()}_{m.group(2).lower()}"
55 else:
56 return locale.lower()
57
58 def get(self, key: str, default: Any | None = None) -> Any:
59 if key in self._key_cache:

Callers 1

loadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected