(cls, locale: str)
| 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: |