Skip to main content
Glama
editorLocale.ts757 B
import { MessageKey } from '@intlayer/editor'; import type { Locale } from '@intlayer/types'; import { inject, watch } from 'vue'; import { INTLAYER_SYMBOL, type IntlayerProvider } from '../client'; import { createSharedComposable } from './createSharedComposable'; import { useCrossFrameState } from './useCrossFrameState'; export const useEditorLocale = createSharedComposable(() => { const client = inject<IntlayerProvider>(INTLAYER_SYMBOL); if (!client) { throw new Error('IntlayerEditor state not found'); } const [_data, setData] = useCrossFrameState<Locale>( MessageKey.INTLAYER_CURRENT_LOCALE ); watch( client.locale, (newValue) => { setData(newValue); }, { immediate: true } ); return client; });

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