@i18n-micro/devtools-ui
DevTools UI and Vite plugin for Nuxt I18n Micro.
Entry points: @i18n-micro/devtools-ui, @i18n-micro/devtools-ui/bridge, @i18n-micro/devtools-ui/bridge/create, @i18n-micro/devtools-ui/vite.
@i18n-micro/devtools-ui
Components
I18nDevToolsElement
const I18nDevToolsElement: VueElementConstructor
Functions
createBridge
Create a universal bridge for DevTools communication This bridge works with any framework by using an adapter pattern
function createBridge(options: CreateBridgeOptions): I18nDevToolsBridge
See CreateBridgeOptions · I18nDevToolsBridge
createRpcClient
function createRpcClient(): I18nDevToolsBridge
register
Register the i18n-devtools-ui custom element This should be called once before using the element
function register(): void
setupRpcHost
Connects an iframe to an existing Bridge.
function setupRpcHost(iframeWindow: Window, bridge: I18nDevToolsBridge): () => void
Returns — cleanup function
Types
BridgeAdapter
Adapter interface for accessing i18n instance data Each framework package will implement this adapter for their specific i18n instance
interface BridgeAdapter
CreateBridgeOptions
interface CreateBridgeOptions
base option (default '/__i18n_api').I18nDevToolsBridge
Bridge interface for communication between DevTools UI and framework-specific RPC This abstraction allows the UI to work with both Nuxt and Astro DevTools
interface I18nDevToolsBridge
JsonRpcEvent
interface JsonRpcEvent
JsonRpcRequest
interface JsonRpcRequest
JsonRpcResponse
interface JsonRpcResponse
JSONValue
type JSONValue = string | null | number | boolean | {
[key: string]: JSONValue;
}
LocaleData
type LocaleData = Record<string, TranslationContent>
TranslationContent
interface TranslationContent
TreeNode
interface TreeNode
@i18n-micro/devtools-ui/bridge
Also exports, as @i18n-micro/devtools-ui does: I18nDevToolsBridge · JSONValue · LocaleData · TranslationContent.
Constants
BRIDGE_INTERFACE_MODULE
Runtime marker so the bridge types entry can be published as a JS module.
const BRIDGE_INTERFACE_MODULE: true
@i18n-micro/devtools-ui/bridge/create
Also exports, as @i18n-micro/devtools-ui does: createBridge · BridgeAdapter · CreateBridgeOptions.
@i18n-micro/devtools-ui/vite
Functions
i18nDevToolsIntegration
The devtools as an Astro integration: an app in the dev toolbar (Astro has no transformIndexHtml, so the plugin's button never shows there).
function i18nDevToolsIntegration(
options?: Omit<DevToolsPluginOptions, 'injectButton'>,
): { … }
i18nDevToolsPlugin
function i18nDevToolsPlugin(options?: DevToolsPluginOptions): PluginOption
Types
DevToolsPluginOptions
interface DevToolsPluginOptions
/config. Default: the first locale file in translationDir./config. Default: defaultLocale.Generated from the TypeScript sources and their JSDoc by pnpm run docs:generate.
Back to all packages · Integration guides