MCPcopy
hub / github.com/ZHO-ZHO-ZHO/Nano-Bananary / t

Function t

i18n/context.tsx:39–54  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

37 };
38
39 const t = (key: string): string => {
40 const keys = key.split('.');
41 let result: any = translations[language];
42 for (const k of keys) {
43 result = result?.[k];
44 if (result === undefined) {
45 // Fallback to English if key not found in current language
46 let fallbackResult: any = translations['en'];
47 for (const fk of keys) {
48 fallbackResult = fallbackResult?.[fk];
49 }
50 return fallbackResult || key;
51 }
52 }
53 return result || key;
54 };
55
56 return (
57 <LanguageContext.Provider value={{ language, changeLanguage, t }}>

Callers 15

AppFunction · 0.85
renderInputUIFunction · 0.85
ImageEditorCanvasFunction · 0.85
UploaderBoxFunction · 0.85
MultiImageUploaderFunction · 0.85
renderGridFunction · 0.85
TransformationSelectorFunction · 0.85
ErrorMessageFunction · 0.85
LoadingSpinnerFunction · 0.85
ImagePreviewModalFunction · 0.85
ThemeSwitcherFunction · 0.85
ResultDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected