# @salmonui/data-grid/engine/locale API reference

> 23 exported symbols of @salmonui/data-grid/engine/locale: 8 functions, 6 interfaces, 8 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-locale

```ts
import { … } from '@salmonui/data-grid/engine/locale';
```

## Functions

### createFormatter

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/createFormatter

```ts
function createFormatter(options?: FormatterOptions): Formatter;
```

A formatter for one locale; compiled formats and `Intl` objects are cached on the instance.

### createLocaleTextModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/createLocaleTextModule

```ts
function createLocaleTextModule<Row>(): LocaleTextModule<Row>;
```

Keeps the resolved text in the snapshot (`snapshot.modules.localeText`).
Options: `localeText` (overrides over English). `localeText.set`
replaces the overrides.

### formatLocaleText

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/formatLocaleText

```ts
function formatLocaleText(text: Readonly<Record<string, LocaleMessage>>, key: string, params?: LocaleTextParams, locale?: string): string;
```

Formats a message: picks the plural form for `params.count` (or the first
numeric parameter) and fills `{param}` placeholders; numeric parameters
use the locale's number format. Unknown keys return the key; missing
parameters stay as written. Never throws.

### formatValue

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/formatValue

```ts
function formatValue(value: unknown, format?: string | FormatOptions, options?: FormatterOptions & {
    readonly type?: ColumnType;
}): string;
```

Formats a value like a column format would (template helper). Formatters are shared per (locale, currency, time zone).

### isRtlLocale

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/isRtlLocale

```ts
function isRtlLocale(locale: string): boolean;
```

True for right-to-left locales (`ar`, `he-IL`, `fa`, `ur-PK`, `az-Arab`, ...). Invalid locales are LTR.

### parseNumber

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/parseNumber

```ts
function parseNumber(text: string, options?: ParseNumberOptions): number | null;
```

Parses localized number text: `'1.234,5'` in `de-DE` is `1234.5`. Accepts
the locale's digits, group, decimal and minus symbols (and ASCII `-`, and
`.` when it is not the group symbol), currency and percent signs, and
parentheses for accounting negatives. Returns `null` for empty text and
`NaN` when the text is not a number.

### resolveLocale

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/resolveLocale

```ts
function resolveLocale(input?: LocaleInput): ResolvedLocale;
```

Resolves the locale props to the engine options (`locale`, `direction`, `currency`, `timeZone`) and the text.

### resolveLocaleText

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/resolveLocaleText

```ts
function resolveLocaleText(...bundles: readonly (Readonly<Record<string, unknown>> | null | undefined)[]): LocaleText;
```

English merged with override bundles, left to right. Invalid entries are ignored.

## Interfaces

### ParseNumberOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/ParseNumberOptions

```ts
interface ParseNumberOptions {
    readonly locale?: string | undefined;
    readonly formatOptions?: Intl.NumberFormatOptions | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `locale` | `readonly locale?: string \| undefined;` | optional | BCP 47 locale. Default `en-US`. |
| `formatOptions` | `readonly formatOptions?: Intl.NumberFormatOptions \| undefined;` | optional | The options the text was formatted with (percent formats divide by 100). |

## Constants

### DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine-locale/DEFAULT_LOCALE_TEXT

```ts
const DEFAULT_LOCALE_TEXT: Readonly<{
    noRows: string;
    loading: string;
    loaded: {
        one: string;
        other: string;
    };
    dataError: string;
    error: string;
    retry: string;
    dataErrorTitle: string;
    rowNumberColumnHeader: string;
    true: string;
    false: string;
    lookupLoading: string;
    lookupError: string;
    selectRow: string;
    selectAllRows: string;
    selectionColumnHeader: string;
    rowsSelected: {
        one: string;
        other: string;
    };
    selectionCleared: string;
    allRowsSelected: string;
    sortAscending: string;
    sortDescending: string;
    clearSort: string;
    ascending: string;
    descending: string;
    sortedBy: string;
    sortCleared: string;
    touchMultiSort: string;
    filter: string;
    clear: string;
    ok: string;
    selectAll: string;
    blank: string;
    matchCase: string;
    and: string;
    or: string;
    noMatches: string;
    filtered: {
        one: string;
        other: string;
    };
    filterOperator: string;
    filterValue: string;
    filterBuilder: string;
    filterField: string;
    filterGroup: string;
    filterNot: string;
    addCondition: string;
    addGroup: string;
    removeCondition: string;
    removeGroup: string;
    filterFrom: string;
    filterTo: string;
    filterButton: string;
    filterMenuLabel: string;
    filterBarInput: string;
    filterBarOperator: string;
    filterStatus: string;
    filterStatusCondition: string;
    filterStatusSeparator: string;
    searchValues: string;
    operatorEqual: string;
    operatorNotEqual: string;
    operatorContains: string;
    operatorDoesNotContain: string;
    operatorStartsWith: string;
    operatorDoesNotStartWith: string;
    operatorEndsWith: string;
    operatorDoesNotEndWith: string;
    operatorIsEmpty: string;
    operatorIsNotEmpty: string;
    operatorIsNull: string;
    operatorIsNotNull: string;
    operatorGreaterThan: string;
    operatorGreaterThanOrEqual: string;
    operatorLessThan: string;
    operatorLessThanOrEqual: string;
    operatorBetween: string;
    operatorIn: string;
    operatorNotIn: string;
    operatorLike: string;
    operatorWildcard: string;
    search: string;
    searchLabel: string;
    clearSearch: string;
    searchMatches: {
        one: string;
        other: string;
    };
    groupPanel: string;
    groupPanelLabel: string;
    group: string;
    ungroup: string;
    ungroupColumn: string;
    groupByColumn: string;
    ungroupByColumn: string;
    groupChip: string;
    groupChipToggle: string;
    groupItems: {
        one: string;
        other: string;
    };
    groupLevel: {
        one: string;
        other: string;
    };
    blankGroup: string;
    groupLoading: string;
    groupLoadFailed: string;
    loadMore: string;
    expand: string;
    collapse: string;
    expandGroup: string;
    collapseGroup: string;
    expandAll: string;
    collapseAll: string;
    sum: string;
    average: string;
    min: string;
    max: string;
    count: string;
    trueCount: string;
    falseCount: string;
    custom: string;
    pagerLabel: string;
    firstPage: string;
    previousPage: string;
    nextPage: string;
    lastPage: string;
    previousPages: string;
    nextPages: string;
    pageButton: string;
    pageOf: string;
    pagerInfo: string;
    pagerItems: {
        one: string;
        other: string;
    };
    pageSize: string;
    allRows: string;
    columnChooser: string;
    chooseColumns: string;
    searchColumns: string;
    columnsShown: string;
    resizeColumn: string;
    columnResizer: string;
    autoSize: string;
    autoSizeAll: string;
    pinStart: string;
    pinEnd: string;
    unpin: string;
    columnPinnedStart: string;
    columnPinnedEnd: string;
    columnPinnedCenter: string;
    columnUnpinned: string;
    columnMenuButton: string;
    columnMenuLabel: string;
    contextMenuLabel: string;
    toolbarLabel: string;
    more: string;
    unavailable: string;
    featureEditing: string;
    featureClipboard: string;
    featureExcelExport: string;
    featurePdfExport: string;
    featureCsvExport: string;
    featurePrint: string;
    featureGrouping: string;
    featureSearch: string;
    add: string;
    edit: string;
    delete: string;
    update: string;
    cancel: string;
    save: string;
    editDialogTitle: string;
    addDialogTitle: string;
    closeDialog: string;
    confirmTitle: string;
    rowErrors: string;
    newRowErrors: string;
    confirmDelete: {
        one: string;
        other: string;
    };
    confirmSave: string;
    confirmDiscard: string;
    unsavedChangesLost: string;
    editingCell: string;
    editingRow: string;
    editSaved: string;
    editCancelled: string;
    rowAdded: string;
    rowsDeleted: {
        one: string;
        other: string;
    };
    saveFailed: string;
    saveRejected: string;
    partialSave: string;
    conflict: string;
    editorLabel: string;
    cellChanged: string;
    cellInvalid: string;
    rowNew: string;
    newRowLabel: string;
    rowDeleted: string;
    fillHandle: string;
    validationRequired: string;
    validationMin: string;
    validationMax: string;
    validationRange: string;
    validationMinLength: string;
    validationMaxLength: string;
    validationRangeLength: string;
    validationNumber: string;
    validationDigits: string;
    validationEmail: string;
    validationUrl: string;
    validationDate: string;
    validationDateIso: string;
    validationCreditcard: string;
    validationTel: string;
    validationPattern: string;
    validationValidate: string;
    chooseDate: string;
    previousMonth: string;
    nextMonth: string;
    today: string;
    timeLabel: string;
    adaptiveBarLabel: string;
    sortDialogTitle: string;
    filterDialogTitle: string;
    adaptiveSortNone: string;
    adaptiveSortAscending: string;
    adaptiveSortDescending: string;
    adaptiveApply: string;
    adaptiveClose: string;
    multiSelect: string;
    selectedCount: string;
    adaptiveFiltered: string;
    detailColumnHeader: string;
    expandDetail: string;
    collapseDetail: string;
    detailLoading: string;
    childGridLabel: string;
    rowDragColumnHeader: string;
    rowDragHandle: string;
    rowDragHandleRole: string;
    rowsGrabbed: {
        one: string;
        other: string;
    };
    rowMoved: string;
    rowsDropped: string;
    indent: string;
    outdent: string;
    export: string;
    exportExcel: string;
    exportPdf: string;
    exportCsv: string;
    exporting: string;
    preparingPrint: string;
    print: string;
    copy: string;
    paste: string;
    clipboardCopyHint: string;
    clipboardPasteHint: string;
    clipboardText: string;
}>;
```

Built-in English text for every user-visible core and renderer string. Keys are flat camelCase; parameters are listed per key. Menu and
toolbar item labels use the item id as the key (`sortAscending`,
`columnChooser`, `exportExcel`, ...).

## Re-exported entry points

- [@salmonui/data-grid/engine](https://salmonui.dev/docs/reference/data-grid/engine.md): 13 symbols: 5 interfaces and 8 types
  `Formatter`, `FormatterOptions`, `LocaleInput`, `LocaleMessage`, `LocaleText`, `LocaleTextCommand`, `LocaleTextKey`, `LocaleTextMethods`, `LocaleTextModule`, `LocaleTextParams`, `LocaleTextSetCommand`, `LocaleTextState`, `ResolvedLocale`
