LLM Reference
LLM Reference: Internationalization
This is a dense reference for LLMs working with Vextro’s i18n system. The i18n system controls admin UI strings (labels, buttons, messages). It is separate from per-document content localization.
Import Path
import { defineLocale, createI18n, t, getLocale, en } from 'vextro';
Types
// Complete locale -- all keys required
type VextroLocale = {
common: Record<string, string>;
collections: Record<string, string>;
documents: Record<string, string>;
auth: Record<string, string>;
workflow: Record<string, string>;
dashboard: Record<string, string>;
alerts: Record<string, string>;
sidebar: Record<string, string>;
actions: Record<string, string>;
activity: Record<string, string>;
media: Record<string, string>;
seo: Record<string, string>;
webhooks: Record<string, string>;
localeSwitcher: Record<string, string>;
};
// Partial overrides -- only supply what you want to change
type VextroLocaleOverrides = {
[K in keyof VextroLocale]?: Partial<VextroLocale[K]>
};
defineLocale(overrides: VextroLocaleOverrides): VextroLocaleOverrides
Type-safe helper for locale overrides. Provides IDE autocomplete and key validation. Returns input unchanged.
import { defineLocale } from 'vextro';
const overrides = defineLocale({
common: { save: 'Publish' },
workflow: { draft: 'Unpublished', published: 'Live' },
});
Used in config:
import { defineVextroConfig, defineLocale } from 'vextro';
export default defineVextroConfig({
locale: defineLocale({
common: { save: 'Publish', saveChanges: 'Publish Changes' },
}),
});
createI18n(options: { locale?: VextroLocale; overrides?: VextroLocaleOverrides }): VextroLocale
Merges a base locale with partial overrides. Defaults to English when no locale is specified.
import { createI18n, en } from 'vextro';
const locale = createI18n({
locale: en,
overrides: { common: { save: 'Publish' } },
});
t(template: string, params: Record<string, unknown>): string
String interpolation. Replaces {key} placeholders.
import { t } from 'vextro';
t('Used in {count} documents', { count: 5 });
// → "Used in 5 documents"
getLocale(config: VextroConfig): VextroLocale
Resolves the active locale from a config object. Merges config.locale with English defaults, or returns English as-is.
import { getLocale } from 'vextro';
const locale = getLocale(vextroConfig);
en: VextroLocale
The complete English locale. Import to build a fully custom locale from scratch.
Locale Sections (14 total)
| Section | Description |
|---|---|
common | Save, Create, Delete, Search, Cancel, Loading, Error |
collections | Collection and global management labels |
documents | Document editor: info panel, timestamps, references |
auth | Sign-in page and authentication errors |
workflow | Status labels: Draft, Published, Scheduled, Trashed |
dashboard | Quick actions, content overview, recent activity |
alerts | Toast notifications and validation messages |
sidebar | Navigation: Access Control, Users, Roles, Media Library |
actions | Toolbar actions: Versions, Duplicate, Preview, History |
activity | Activity log entries: Created, Updated, Deleted |
media | Media Library: search, sort, filters, upload |
seo | SEO field labels and OpenGraph metadata |
webhooks | Webhook configuration and event management |
localeSwitcher | Content localization UI: default locale, copy-from |