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
useLocale.ts•677 B
import configuration from '@intlayer/config/built';
import type { Locales, LocalesValues } from '@intlayer/config/client';
import { IntlayerServerContext } from './IntlayerServerProvider';
import { getServerContext } from './serverContext';
/**
* On the server side, Hook that picking one dictionary by its key and return the content
*
* If the locale is not provided, it will use the locale from the server context
*/
export const useLocale = () => {
const { defaultLocale } = configuration?.internationalization ?? {};
const locale =
(getServerContext<LocalesValues>(IntlayerServerContext) as Locales) ??
(defaultLocale as Locales);
return { locale };
};