MCPcopy Index your code
hub / github.com/faif/python-patterns / localize

Method localize

patterns/creational/factory.py:38–40  ·  view source on GitHub ↗

We'll punt if we don't have a translation

(self, msg: str)

Source from the content-addressed store, hash-verified

36 self.translations = {"dog": "σκύλος", "cat": "γάτα"}
37
38 def localize(self, msg: str) -> str:
39 """We'll punt if we don't have a translation"""
40 return self.translations.get(msg, msg)
41
42
43class EnglishLocalizer:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected