MCPcopy Index your code
hub / github.com/BasicProtein/AugmentCode-Free / _get_fallback_text

Method _get_fallback_text

language_manager.py:116–138  ·  view source on GitHub ↗

Get fallback text from English

(self, key_path: str, **kwargs)

Source from the content-addressed store, hash-verified

114 return key_path
115
116 def _get_fallback_text(self, key_path: str, **kwargs) -> str:
117 """Get fallback text from English"""
118 try:
119 lang_data = self.languages.get("en_US", {})
120 keys = key_path.split('.')
121 value = lang_data
122
123 for key in keys:
124 if isinstance(value, dict) and key in value:
125 value = value[key]
126 else:
127 return key_path
128
129 if isinstance(value, str) and kwargs:
130 try:
131 return value.format(**kwargs)
132 except KeyError:
133 return value
134
135 return str(value)
136
137 except Exception:
138 return key_path
139
140 def get_language_display_name(self, language_code: str = None) -> str:
141 """Get display name for language"""

Callers 1

get_textMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected