The best way to control Claude Code, Codex and more from any computer or phone

main
tsx 15 lines 584 Bytes
Raw
1 import { GTProvider } from "gt-react";
2 import { useSyncExternalStore, type ReactNode } from "react";
3
4 import { getI18nSnapshot, persistGTLocale, subscribeI18n } from "./runtime";
5
6 const reloadToSetting = (state: { readonly locale: string }) => persistGTLocale(state.locale);
7
8 export function I18nProvider({ children }: { readonly children: ReactNode }) {
9 const { locale, translations } = useSyncExternalStore(subscribeI18n, getI18nSnapshot);
10 return (
11 <GTProvider locale={locale} translations={translations} _reload={reloadToSetting}>
12 {children}
13 </GTProvider>
14 );
15 }