Skip to main content
Glama
IntlayerServerProvider.tsx1.07 kB
import configuration from '@intlayer/config/built'; import type { LocalesValues } from '@intlayer/types'; import type { FC, PropsWithChildren } from 'react'; import { createServerContext, getServerContext } from './serverContext'; const { defaultLocale } = configuration?.internationalization ?? {}; /** * Context that store the current locale on the server side */ export const IntlayerServerContext = createServerContext<LocalesValues>(defaultLocale); /** * Hook that provides the current locale */ export const useIntlayer = () => getServerContext(IntlayerServerContext); /** * Get the current locale */ export const locale = getServerContext(IntlayerServerContext); export type IntlayerServerProviderProps = PropsWithChildren & { locale?: LocalesValues; }; /** * Provider that store the current locale on the server side */ export const IntlayerServerProvider: FC<IntlayerServerProviderProps> = ({ children, locale = defaultLocale, }) => ( <IntlayerServerContext.Provider value={locale}> {children} </IntlayerServerContext.Provider> );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server