MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / i18n_text

Function i18n_text

plugin/app/utils.py:85–104  ·  view source on GitHub ↗
(
    bundle_id: str,
    original: str,
    lang: str,
)

Source from the content-addressed store, hash-verified

83
84
85def i18n_text(
86 bundle_id: str,
87 original: str,
88 lang: str,
89):
90 from app.cache import get_i18n
91
92 """
93 Translate the original text to the target language using i18n.
94
95 :param bundle_id: The provider ID.
96 :param original: The original text.
97 :param lang: The target language.
98 :return: text in the target language.
99 """
100 if not lang:
101 return original
102 if original.startswith("i18n:"):
103 return get_i18n(bundle_id, lang, original[5:])
104 return original

Callers 2

to_dictMethod · 0.90
to_dictMethod · 0.90

Calls 1

get_i18nFunction · 0.90

Tested by

no test coverage detected