Skip to main content
Glama
getDictionary.ts1.07 kB
import { getDictionary as getDictionaryCore, type Plugins, } from '@intlayer/core'; import type { DeclaredLocales, Dictionary, LocalesValues, } from '@intlayer/types'; import { type DeepTransformContent, intlayerNodePlugins, markdownPlugin, svelteNodePlugins, } from './plugins'; /** * Get dictionary content for a specific locale in Svelte applications * @param dictionary The dictionary object to transform * @param locale The target locale (optional, defaults to current locale) * @param additionalPlugins Additional transformation plugins * @returns Transformed dictionary content optimized for Svelte */ export const getDictionary = < T extends Dictionary, L extends LocalesValues = DeclaredLocales, >( dictionary: T, locale?: L, additionalPlugins?: Plugins[] ) => { const plugins: Plugins[] = [ intlayerNodePlugins, svelteNodePlugins, markdownPlugin, ...(additionalPlugins ?? []), ]; return getDictionaryCore( dictionary, locale, plugins ) as any as DeepTransformContent<T['content']>; };

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