Skip to content

Text & translation

Set texts on the provider for application-wide labels, or on one table:

React

<AppTable
prop="users"
customization={{
texts: {
search: { placeholder: 'Search team members…' },
filters: { searchFields: 'Find a field…' },
empty: { label: 'No matching team members.' },
pagination: { pageSummary: '{page} / {lastPage}' },
boolean: { true: 'Enabled', false: 'Disabled' },
},
}}
/>

Unspecified messages keep their defaults. Pass translated strings from your application’s localization system.

Keep placeholders such as {page}, {lastPage}, {selected}, {total}, and {column} in the messages that use them. The built-in UI substitutes their values.

Translate column headings, filter labels, select option labels, and comparison labels in PHP. Laravel supplies these labels with the table definition:

Laravel

use InertiaX\Table\Columns\BooleanColumn;
use InertiaX\Table\Filters\Clauses\Enums\ClauseType;
use InertiaX\Table\Filters\TextFilter;
BooleanColumn::make('active', __('Active'))
->trueLabel(__('Enabled'))
->falseLabel(__('Disabled'));
TextFilter::make('name', __('Name'))
->replaceClause(ClauseType::Contains->make(__('Contains text')));

nullable() and automatic filters label their emptiness comparisons Is not empty and Is empty. To translate them, declare the filter and add both clauses yourself with addClauses([ClauseType::IsSet->make(__('Is not empty')), ClauseType::IsNotSet->make(__('Is empty'))]); nullable() adds only the ones a filter lacks.

texts.boolean sets the choices of Boolean filter inputs and the fallback labels for cells without server labels. Laravel’s BooleanColumn always supplies cell labels, so translate those with trueLabel() and falseLabel(). Likewise, texts.clauses is a fallback for comparisons without server labels; it does not override the labels Laravel sends.

See React customization API for all groups and keys.

View Markdown