MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / t

Function t

packages/node-runtime/src/ai/preprocessor/format.ts:31–37  ·  view source on GitHub ↗
(key: TextEntryKey, locale?: string)

Source from the content-addressed store, hash-verified

29type TextEntryKey = Exclude<keyof typeof i18nTexts, 'dailySummary'>
30
31export function t(key: TextEntryKey, locale?: string): string | string[] {
32 const text = i18nTexts[key]
33 if (typeof text === 'object' && 'zh' in text && 'en' in text) {
34 return isChineseLocale(locale) ? text.zh : text.en
35 }
36 return ''
37}
38
39const MAX_MESSAGE_CONTENT_LENGTH = 200
40

Callers 3

formatMessageCompactFunction · 0.70
formatTimeRangeFunction · 0.70
agentTFunction · 0.50

Calls 1

isChineseLocaleFunction · 0.70

Tested by

no test coverage detected