MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / t

Function t

packages/tools/src/utils/format.ts:25–31  ·  view source on GitHub ↗
(key: TextEntryKey, locale?: string)

Source from the content-addressed store, hash-verified

23type TextEntryKey = keyof typeof i18nTexts
24
25export function t(key: TextEntryKey, locale?: string): string {
26 const text = i18nTexts[key]
27 if (typeof text === 'object' && 'zh' in text && 'en' in text) {
28 return isChineseLocale(locale) ? text.zh : text.en
29 }
30 return ''
31}
32
33export function formatTimeRange(
34 timeFilter?: { startTs: number; endTs: number },

Callers 6

handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
formatTimeRangeFunction · 0.70
formatMessageCompactFunction · 0.70

Calls 1

isChineseLocaleFunction · 0.70

Tested by

no test coverage detected