MCPcopy
hub / github.com/GitbookIO/gitbook / tString

Function tString

packages/gitbook/src/intl/translate.tsx:51–58  ·  view source on GitHub ↗
(
    language: TranslationLanguage,
    id: TranslationKey,
    ...args: React.ReactNode[]
)

Source from the content-addressed store, hash-verified

49 * Version of `t` that returns a string.
50 */
51export function tString(
52 language: TranslationLanguage,
53 id: TranslationKey,
54 ...args: React.ReactNode[]
55): string {
56 const result = t(language, id, ...args);
57 return reactToString(result);
58}
59
60function reactToString(el: React.ReactNode): string {
61 if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {

Callers 15

AIChatControlButtonFunction · 0.90
AIResponseFeedbackFunction · 0.90
HoldMessageFunction · 0.90
CookiesToastFunction · 0.90
PageFeedbackFormFunction · 0.90
AIChatProviderFunction · 0.90
PDFPageFunction · 0.90
AIChatSuggestedQuestionsFunction · 0.50
AIChatFunction · 0.50
AIChatSubtitleFunction · 0.50
AIChatBodyFunction · 0.50
AIChatErrorFunction · 0.50

Calls 2

tFunction · 0.70
reactToStringFunction · 0.70

Tested by

no test coverage detected