Localization
The grid ships with English and Portuguese text, and any string can be overridden.
Basic usage
localization.tsx
import { DataGrid } from 'expo-flash-datagrid';
import { userColumns, users, type User } from './data';
export function PortugueseGridScreen() {
return (
<DataGrid<User>
mode="client"
rows={users}
columns={userColumns}
locale="pt"
emptyLabel="Nenhum cliente encontrado"
localeText={{
rowsPerPage: 'Itens por página',
selectedRowsLabel: '{count} cliente(s)',
operatorLabels: { contains: 'inclui' },
}}
style={{ flex: 1 }}
/>
);
}
Options
| Prop | Type | Default | Description |
|---|---|---|---|
locale | 'en' | 'pt' | 'en' | Built-in text bundle. |
localeText | Partial<DataGridLocaleText> | None | Overrides, merged over the bundle. operatorLabels merges key by key. |
Some strings take placeholders, such as selectedRowsLabel: '{count} selected'.
Exports
EN_LOCALE_TEXT and PT_LOCALE_TEXT are the full bundles. resolveLocaleText merges overrides, and formatLocale fills placeholders.
Client vs server
Localization is independent of the mode. Your column headers and filterSelectOptions labels are yours to translate.