MCPcopy
hub / github.com/ravendevteam/talon / t

Function t

configuration_components/localization.py:98–111  ·  view source on GitHub ↗
(key: str, params=None)

Source from the content-addressed store, hash-verified

96
97
98def t(key: str, params=None) -> str:
99 key = str(key)
100 params = dict(params or {})
101 value = _deep_get(_load_catalog(_current_language), key)
102 if value is None and _current_language != DEFAULT_LANGUAGE:
103 value = _deep_get(_load_catalog(DEFAULT_LANGUAGE), key)
104 if value is None:
105 return key
106 if not isinstance(value, str):
107 return str(value)
108 try:
109 return value.format(**params)
110 except Exception:
111 return value
112
113
114class LocalizationBridge(QObject):

Callers 15

run_screenFunction · 0.90
_build_install_uiFunction · 0.90
mainFunction · 0.90
debloat_sequenceFunction · 0.90
_check_temp_writableFunction · 0.90
_run_scriptMethod · 0.90
set_valueFunction · 0.90
get_valueFunction · 0.90
delete_valueFunction · 0.90
create_keyFunction · 0.90
delete_keyFunction · 0.90

Calls 2

_deep_getFunction · 0.85
_load_catalogFunction · 0.85

Tested by

no test coverage detected