Localization API
Ready-made translations: provideOgeLocale() from oge-ui and the framework-free @oge-ui/locales packs it applies.
@oge-ui/locales OgeLocalePack Types
Locale wiring
Properties 2
| Name | Type | Description |
|---|---|---|
provideOgeLocale(pack) | (pack: OgeLocalePack | (() => OgeLocalePack)) => Provider[] | From oge-ui. Provides every MIT family’s config — grid / tree list, inputs, buttons, overlay, tabs, forms, upload, the layout and navigation components — with the pack’s slice merged over the English catalog, plus the pack’s locale for the grid and the editors. A function makes it live: the language follows the signals it reads. It owns those config tokens — provide a family’s own config after it to change other options. LOCALE_ID and the page’s dir stay the app’s job; commercial families take their slice through their own providers. |
pack | OgeLocalePack | (() => OgeLocalePack) | The pack to apply — a static pack, or a function reading a signal for runtime switching (provideOgeLocale(() => pack())). |
Locale packs
Properties 13
Language packs
| Name | Type | Description |
|---|---|---|
de | OgeLocalePack | German — every catalog, MIT and commercial. import { de } from '@oge-ui/locales/de'. |
fr | OgeLocalePack | French — every catalog, MIT and commercial. import { fr } from '@oge-ui/locales/fr'. |
es | OgeLocalePack | Spanish — every catalog, MIT and commercial. import { es } from '@oge-ui/locales/es'. |
it | OgeLocalePack | Italian — every catalog, MIT and commercial. import { it } from '@oge-ui/locales/it'. |
ptBR | OgeLocalePack | Brazilian Portuguese — every catalog, MIT and commercial. import { ptBR } from '@oge-ui/locales/pt-BR'. |
tr | OgeLocalePack | Turkish — every catalog, MIT and commercial. import { tr } from '@oge-ui/locales/tr'. |
ja | OgeLocalePack | Japanese — every catalog, MIT and commercial. import { ja } from '@oge-ui/locales/ja'. |
zhCN | OgeLocalePack | Simplified Chinese — every catalog, MIT and commercial. import { zhCN } from '@oge-ui/locales/zh-CN'. |
ar | OgeLocalePack | Arabic (dir: 'rtl') — every catalog, MIT and commercial. import { ar } from '@oge-ui/locales/ar'. |
he | OgeLocalePack | Hebrew (dir: 'rtl') — every catalog, MIT and commercial. import { he } from '@oge-ui/locales/he'. |
Primary entry (@oge-ui/locales)
| Name | Type | Description |
|---|---|---|
en | OgeLocalePack | The English baseline — { locale: 'en', dir: 'ltr' } with no slices, so every catalog keeps its built-in strings. Switch back to it like to any other pack. |
ogeLocalePacks | Readonly<Record<OgeLocaleCode, () => Promise<OgeLocalePack>>> | Lazy loaders, one dynamic import() per language entry — a language switcher downloads only the packs a user picks. |
OGE_LOCALE_NAMES | Readonly<Record<OgeLocaleCode, string>> | Each language’s own name (Deutsch, 日本語, العربية…) — the labels of a switcher. |
Methods 1
| Name | Type | Description |
|---|---|---|
ogeMergeMessages(defaults, slice) | <T extends object>(defaults: T, slice: OgeDeepPartial<T> | undefined) => T | Lays a pack slice over a complete catalog, nested blocks key by key — every key the slice lacks keeps the English string. Use it to hand a slice to a family provider yourself (commercial families, or a family whose other options you also set): messages: ogeMergeMessages(OGE_DEFAULT_SCHEDULER_MESSAGES, tr.scheduler). |
Types 5
| Name | Type | Description |
|---|---|---|
OgeLocalePack | { locale; dir: 'ltr' | 'rtl'; grid?; inputs?; buttons?; overlay?; tabs?; forms?; upload?; layout?; navigation?; pivot?; scheduler?; gantt?; kanban?; bpmn?; charts? } | One language: the BCP 47 locale for Intl formats, the writing direction and a deep-partial slice per message catalog. The tree list reads the grid’s catalog, so grid covers both. The commercial slices are typed with import type from the engines — erased by the build, so the MIT package has no runtime dependency on them. |
OgeLocaleLayoutMessages | { accordion?; progressBar?; loadIndicator?; splitter?; toolbar? } | The layout family’s catalogs, one per component. |
OgeLocaleNavigationMessages | { breadcrumb?; drawer?; menubar?; pagination?; stepper?; treeView? } | The navigation family’s catalogs, one per component. |
OgeDeepPartial<T> | mapped type | Every key optional, nested blocks included — a key a newer release adds is simply missing from an older pack and falls back to English. |
OgeLocaleCode | 'en' | 'de' | 'fr' | 'es' | 'it' | 'pt-BR' | 'tr' | 'ja' | 'zh-CN' | 'ar' | 'he' | The languages this package ships, plus the English baseline. |