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

Function useLanguage

packages/gitbook/src/intl/client.ts:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 * Use the current language to translate a string.
11 */
12export function useLanguage(): TranslationLanguage {
13 const language = React.useContext(TranslateContext);
14 if (!language) {
15 throw new Error('The hook useLanguage should be wrapped in a <TranslateContext>');
16 }
17 return language;
18}

Callers 15

AIChatControlButtonFunction · 0.90
AIChatSuggestedQuestionsFunction · 0.90
AIResponseFeedbackFunction · 0.90
AIChatToolConfirmationsFunction · 0.90
HoldMessageFunction · 0.90
AIChatButtonFunction · 0.90
AIChatFunction · 0.90
AIChatSubtitleFunction · 0.90
AIChatBodyFunction · 0.90
AIChatErrorFunction · 0.90
AIChatInputFunction · 0.90
CookiesToastFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected