Skip to content
OGE logoOGE

Localization

Every user-facing string — empty states, aria labels, validation errors, tooltips — lives in a typed message catalog. Nothing is hardcoded: provide a catalog once for the whole application, or override single strings per component instance.

messages provideOge…Config [messages] locale

How it works

Each package exports a messages interface (for example OgeGridMessages, OgeInputsMessages). Catalogs are partial — you only supply the strings you change, the rest keep their English defaults. Patterns support {placeholder} interpolation for dynamic values.

The catalogs themselves are shared. Message names, defaults and placeholder syntax live in the framework-free packages, so a translation written once is correct in both render layers. Only the delivery differs: Angular takes a provideOge…Config() provider, React an <Oge…ConfigProvider> — the same object, handed over the way each framework expects.

Ready-made translations

@oge-ui/locales (MIT) translates every catalog of the suite — MIT and commercial families alike — into German, French, Spanish, Italian, Brazilian Portuguese, Turkish, Japanese, Simplified Chinese, Arabic and Hebrew, with each language's plural forms in the count-bearing keys. Each language is its own entry point (@oge-ui/locales/tr), so an app bundles only the pack it imports. A pack is plain data — a typed OgeLocalePack with the locale for Intl formats, the writing dir and one slice per catalog — and every key it does not carry yet stays English. A CI check keeps each pack's keys, placeholders and plurals in step with the English source.

npm install @oge-ui/locales

provideOgeLocale(pack) from oge-ui provides every MIT family's config — grid and tree list, inputs, buttons, overlay, tabs, forms, upload, layout and navigation — with the pack's slice and, where a family formats data, its locale. LOCALE_ID (Angular's own pipes) and the page's dir remain the app's job.

// app.config.ts
import { provideOgeLocale } from 'oge-ui';
import { tr } from '@oge-ui/locales/tr'; // only this language is bundled

export const appConfig: ApplicationConfig = {
  providers: [
    { provide: LOCALE_ID, useValue: 'tr' }, // Angular's own pipes — the app's job
    provideOgeLocale(tr), // grid + tree list, inputs, buttons, overlay, tabs,
                          // forms, upload, layout and navigation — strings and locale
  ],
};
// right-to-left packs (ar, he) carry dir: 'rtl' — set <html dir> from pack.dir

An app that ships only some families can apply just their slices — provideOgeGridLocale(), provideOgeInputsLocale() and so on, one per family — so the other families’ catalogs and config never reach its bundle (the one-call form pulls in every family’s English catalog, about 16 kB gzip; a single slice is a fraction of that).

// app.config.ts — an app that uses the grid and the inputs only
import { provideOgeGridLocale, provideOgeInputsLocale } from 'oge-ui';
import { tr } from '@oge-ui/locales/tr';

export const appConfig: ApplicationConfig = {
  providers: [provideOgeGridLocale(tr), provideOgeInputsLocale(tr)],
};
// provideOgeLocale(tr) is these slices for every MIT family at once

Pick a language: the date box (open its calendar), the select box (search it, clear it) and the grid's filter row, pager and empty texts switch at once; Arabic and Hebrew mirror the layout. Each pack is downloaded the first time it is picked.

@oge-ui/locales provideOgeLocale OgeLocaleProvider
Customer
Placed
Amount
Anadolu Ltd.
1/5/2026
€1,234.50
Berlin GmbH
3/17/2026
€89.90
Paris SARL
6/30/2026
€15,600.00
4 rows

Switch at runtime with the lazy ogeLocalePacks map and the live form (provideOgeLocale(() => pack()); in React, pass a new pack). provideOgeLocale owns the family config tokens it sets, so a family whose other options you also tune is provided after it, with the slice merged in through ogeMergeMessages:

import { signal } from '@angular/core';
import { provideOgeLocale } from 'oge-ui';
import { en, ogeLocalePacks, type OgeLocaleCode, type OgeLocalePack } from '@oge-ui/locales';

export const uiPack = signal<OgeLocalePack>(en);

// each language is its own chunk — only the packs a user picks are downloaded
export async function useLanguage(code: OgeLocaleCode): Promise<void> {
  const pack = await ogeLocalePacks[code]();
  uiPack.set(pack);
  document.documentElement.lang = pack.locale;
  document.documentElement.dir = pack.dir;
}

providers: [
  // a function: every OGE component re-renders when uiPack changes
  provideOgeLocale(() => uiPack()),
  // a family whose other options you also set: provide it after, merge yourself
  provideOgeGridConfig(() => ({
    rowHeight: 32,
    locale: uiPack().locale,
    messages: ogeMergeMessages(OGE_DEFAULT_GRID_MESSAGES, uiPack().grid),
  })),
]

The commercial families (pivot, scheduler, Gantt, Kanban, BPMN, charts) are translated in the same packs, but the MIT umbrellas never depend on them — hand their slice to their own provider. The full key-by-key reference is the Localization API.

// The MIT umbrella never depends on the commercial packages, so their slices
// are passed to their own providers — merged over the English catalog, so a
// key a newer release adds stays English instead of going blank:
import { ogeMergeMessages } from '@oge-ui/locales';
import { tr } from '@oge-ui/locales/tr';
import { OGE_DEFAULT_SCHEDULER_MESSAGES, provideOgeSchedulerConfig } from '@oge-ui/scheduler';
import { OGE_DEFAULT_GANTT_MESSAGES, provideOgeGanttConfig } from '@oge-ui/gantt';

providers: [
  provideOgeLocale(tr),
  provideOgeSchedulerConfig({
    locale: tr.locale,
    messages: ogeMergeMessages(OGE_DEFAULT_SCHEDULER_MESSAGES, tr.scheduler),
  }),
  provideOgeGanttConfig({
    locale: tr.locale,
    messages: ogeMergeMessages(OGE_DEFAULT_GANTT_MESSAGES, tr.gantt),
  }),
  // pivot: provideOgePivotMessages(ogeMergeMessages(OGE_DEFAULT_PIVOT_MESSAGES, tr.pivot))
  // kanban / bpmn / charts / spreadsheet: the same shape with tr.kanban /
  // tr.bpmn / tr.charts / tr.spreadsheet
]

// React: <OgeSchedulerConfigProvider config={{ locale: tr.locale,
//   messages: ogeMergeMessages(OGE_DEFAULT_SCHEDULER_MESSAGES, tr.scheduler) }}>

Global configuration

import { provideOgeGridConfig } from '@oge-ui/grid';
import { provideOgeInputsConfig } from '@oge-ui/inputs';
import { provideOgeButtonsConfig } from '@oge-ui/buttons';

// app.config.ts — a Turkish application
providers: [
  provideOgeGridConfig({
    messages: {
      noData: 'Kayıt bulunamadı',
      search: 'Ara…',
      pagerInfo: '{count} satır',
      summaryLabels: { sum: 'Toplam', avg: 'Ort', min: 'Min', max: 'Maks', count: 'Adet' },
    },
  }),
  provideOgeInputsConfig({
    messages: {
      requiredError: 'Bu alan zorunludur',
      clearButton: 'Temizle',
      counterAria: '{max} karakterden {count} tanesi kullanıldı',
    },
  }),
  provideOgeButtonsConfig({
    messages: { loading: 'Yükleniyor', holdToConfirm: 'Onaylamak için basılı tutun' },
  }),
]

Switching language at runtime

Every provideOge…Config() also accepts a function. The config then follows the signals that function reads: flip your language signal and every OGE component re-renders its strings — and, with locale, its number and date formats — without reloading the page or fetching the catalog before bootstrap. A component-level [messages] input still wins over it. In React, pass a new config to the <Oge…ConfigProvider>; context already re-renders.

import { signal } from '@angular/core';
import { provideOgeGridConfig } from '@oge-ui/grid';
import { provideOgeInputsConfig } from '@oge-ui/inputs';
import { GRID_TR, INPUTS_TR } from './i18n/tr';

/** The app's own language state — a cookie, a store, a user setting… */
export const uiLanguage = signal<'en' | 'tr'>('en');

// Pass a function instead of an object: the config becomes live. Every OGE
// component re-renders its strings when a signal the function reads changes —
// no reload, no re-bootstrap. English is the built-in default, so '{}' is enough.
export const appConfig = {
  providers: [
    provideOgeGridConfig(() => ({
      messages: uiLanguage() === 'tr' ? GRID_TR : {},
    })),
    provideOgeInputsConfig(() => ({
      messages: uiLanguage() === 'tr' ? INPUTS_TR : {},
      locale: uiLanguage() === 'tr' ? 'tr-TR' : 'en-US', // Intl formats follow too
    })),
  ],
};

// anywhere: uiLanguage.set('tr');

Per-component overrides

Components accept the same catalog through a [messages] input. Instance values win over the global provider, which wins over the built-in defaults:

<!-- the [messages] input overrides the global catalog for one instance -->
<oge-grid [data]="rows" [messages]="{ noData: 'No matching orders' }" />

<oge-text-box
  label="Coupon code"
  [messages]="{ requiredError: 'Enter a coupon to continue' }"
/>

Validation messages

Input editors resolve validation errors from the catalog — the same strings serve standalone validation, reactive forms and Signal Forms, so translating them once covers all three binding modes:

// Message patterns interpolate the constraint that failed:
provideOgeInputsConfig({
  messages: {
    minError: 'Value must be at least {min}',
    maxLengthError: 'Enter no more than {requiredLength} characters',
  },
})

// Priority when an editor resolves its error text:
// 1. errorText input          (always wins when set)
// 2. parse errors             (e.g. invalid number)
// 3. form errors              (Signal Forms / reactive), mapped through the catalog

Number & date locales

Formatting is separate from message catalogs. Every formatter comes from one shared Intl cache in @oge-ui/core, in the component's locale: the grid, tree list and pivot take a locale input (React: prop) and a global one through their config — provideOgeGridConfig({ locale }), provideOgePivotConfig({ locale }) or the React providers. Unset, Angular uses LOCALE_ID and React navigator.language. Default date cells, declarative column formats, summaries, group captions, header-filter values, the filter row's number parsing, the pager and exported text all follow it. Unformatted number columns stay raw — give them a format for the locale's separators.

Switch the locale: dates, currency, percentages, grouped numbers, the total summary and the plural sentence below re-render. Type 1234,5 into the Amount filter under de-DE or tr-TR — it parses as one thousand two hundred thirty-four and a half.

locale OgeValueFormat ogeFormatMessage
Id
Placed
Placed (medium)
Amount
Share
Quantity
1
5.1.2026
05.01.2026
1.234,50 €
12,5 %
12.500
2
17.3.2026
17.03.2026
89,90 €
50,0 %
3
3
30.11.2026
30.11.2026
15.600,00 €
37,5 %
1

3 orders

Set the locale once for the whole application — live, like messages:

import { signal } from '@angular/core';
import { provideOgeGridConfig } from '@oge-ui/grid';
import { provideOgePivotConfig } from '@oge-ui/pivot';

export const uiLocale = signal('de-DE');

providers: [
  // grids and tree lists; a [locale] input on one instance still wins
  provideOgeGridConfig(() => ({ locale: uiLocale() })),
  provideOgePivotConfig(() => ({ locale: uiLocale() })),
]
// unset everywhere: Angular's LOCALE_ID (React: navigator.language)

Editors format and parse through the same cache, honoring an explicit locale input or Angular's LOCALE_ID. Grouped input like 1.234,56 parses correctly in every locale:

<!-- Intl-powered: grouping, decimal separator and currency follow the locale -->
<oge-number-box
  label="Price"
  locale="de-DE"
  [format]="{ style: 'currency', currency: 'EUR' }"
/>

<!-- without an explicit locale, editors use Angular's LOCALE_ID -->

Plural messages

Count-bearing catalog keys — the grid's row count, selection and paste announcements and pager text, the validation summary heading, the uploader's file counts, the tag box's overflow chip — are ICU plurals rendered by ogeFormatMessage with Intl.PluralRules. One key holds every plural form of a language (zero one two few many other, plus exact =0 matches); # is the count in the locale's digits. A plain {count} pattern keeps working. The old singular keys (rowCountOneAnnouncement, validationSummaryTitleOne, rowsSuffix) are deprecated: still honoured for one minor, with a dev-mode warning.

provideOgeGridConfig({
  messages: {
    // Polish has one / few / many — all in one key; # is the count
    rowCountAnnouncement:
      '{count, plural, one {# wiersz} few {# wiersze} many {# wierszy} other {# wiersza}}',
    pagerInfo: '{count, plural, one {# wiersz} few {# wiersze} many {# wierszy} other {# wiersza}}',
  },
}),
provideOgeFormsConfig({
  messages: {
    validationSummaryTitle:
      '{count, plural, =1 {Bir alan düzeltilmeli} other {# alan düzeltilmeli}}',
  },
}),

// the same formatter is public — use it for your own strings
ogeFormatMessage('{n, plural, one {# plik} few {# pliki} many {# plików} other {# pliku}}', { n: 5 }, 'pl');
// → '5 plików'

Behavior defaults

The config providers also centralize timing and interaction defaults, so product-wide tuning does not require touching templates:

// The same providers also carry non-text defaults:
provideOgeButtonsConfig({
  clickGuardMs: 300,       // default clickGuard window
  holdToConfirmMs: 1000,   // default hold duration
}),
provideOgeInputsConfig({
  spinRepeatDelayMs: 300,  // number-box spin: delay before repeating
  spinRepeatIntervalMs: 60,
  copiedResetMs: 1500,     // "copied" indicator duration
})

Right-to-left

Direction is not a setting: every component follows the page's dir. Layout mirrors through CSS logical properties, and everything decided in script — mirrored Left/Right arrow keys, drag deltas, timeline and chart axes, which side a popup opens on — resolves the direction through one shared helper, ogeResolveDirection from @oge-ui/behavior, so both render layers agree. The BPMN canvas is the deliberate exception: diagram coordinates are absolute, so only its chrome (palette, properties panel, context pad) mirrors.

<!-- 1. Most components need nothing: layout uses CSS logical properties,
        so setting dir on <html> (or any ancestor) mirrors them. -->
<html lang="ar" dir="rtl">

<!-- 2. Components that compute geometry in script (grid, tree list, charts,
        scheduler, Gantt, kanban, pivot) follow the page too, and re-mirror
        when dir changes at runtime. rtlEnabled forces a direction for one
        instance and also sets dir on its host: -->
<oge-scheduler [dataSource]="appointments" [rtlEnabled]="true" />

// 3. Your own widgets can share the same rule (SSR-safe):
import { ogeIsRtl, observeDirection } from '@oge-ui/behavior';

const rtl = ogeIsRtl(hostElement); // computed direction, then the nearest dir
const stop = observeDirection(hostElement, (direction) => {
  // 'ltr' | 'rtl' — mirror your arrow keys / drag maths here
});