2023-08-22 12:34:55 +00:00
|
|
|
import { CALCOM_VERSION } from "@calcom/lib/constants";
|
2022-07-22 17:27:06 +00:00
|
|
|
import { trpc } from "@calcom/trpc/react";
|
2021-10-12 13:11:33 +00:00
|
|
|
|
2023-10-10 16:36:28 +00:00
|
|
|
export function useViewerI18n(locale: string) {
|
2023-08-19 00:46:17 +00:00
|
|
|
return trpc.viewer.public.i18n.useQuery(
|
2023-08-22 12:34:55 +00:00
|
|
|
{ locale, CalComVersion: CALCOM_VERSION },
|
2023-08-19 00:46:17 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* i18n should never be clubbed with other queries, so that it's caching can be managed independently.
|
|
|
|
**/
|
|
|
|
trpc: {
|
|
|
|
context: { skipBatch: true },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
2021-10-14 19:10:44 +00:00
|
|
|
}
|