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

Method match_translation

src/pendulum/locales/locale.py:91–96  ·  view source on GitHub ↗
(self, key: str, value: Any)

Source from the content-addressed store, hash-verified

89 return f"{number}{ordinal}"
90
91 def match_translation(self, key: str, value: Any) -> dict[str, str] | None:
92 translations = self.translation(key)
93 if value not in translations.values():
94 return None
95
96 return cast(Dict[str, str], {v: k for k, v in translations.items()}[value])
97
98 def __repr__(self) -> str:
99 return f"{self.__class__.__name__}('{self._locale}')"

Callers 1

Calls 1

translationMethod · 0.95

Tested by

no test coverage detected