Skip to content

Translations ​

Inertia Forms translates its own copy in two places:

  • Laravel translations cover backend validation messages, upload endpoint responses, and validation rules.
  • Frontend translations cover built-in UI copy, client-side labels, empty states, dialogs, upload status, and accessibility text.

Your form classes still pass application-owned copy, such as field labels, help text, placeholders, option labels, fieldset legends, and wizard step titles. Use your application's own translation keys for that copy:

php
use InertiaUI\Forms\Fields\TextInput;

TextInput::make('email')
    ->label(__('profile.email'))
    ->placeholder(__('profile.email_placeholder'));

Laravel Translations ​

To override the built-in PHP messages, publish the package language files:

bash
php artisan vendor:publish --tag=inertia-forms-lang

This creates lang/vendor/inertia-forms/en/inertia-forms.php, where you may override the backend-owned package messages:

php
return [
    'fields' => [
        'blocks' => [
            'max_per_type' => 'The :attribute field may not contain more than :max :label blocks.',
        ],
    ],

    'file_uploads' => [
        'validation' => [
            'invalid_or_expired' => 'This upload expired. Please choose the file again.',
        ],
    ],
];

Laravel uses these strings for package-provided validation messages, public upload endpoint responses, and backend validation rules. See the Laravel translation file for the full list of available backend keys and defaults.

Built-in frontend UI defaults live in the Vue and React translation registry instead. These include the submit button text, wizard navigation labels, checkbox group select-all labels, and option group fallback labels.

Developer-facing exception messages and Artisan command output are intentionally plain English, so logs, Sentry events, and terminal output stay stable.

Frontend Translations ​

Vue and React share the same frontend translation registry. Import setTranslations() and call it once in your app entry file, before any form renders:

ts
import { createApp } from 'vue'
import { setTranslations } from '@inertiaui/form-vue'

setTranslations({
    action_cancel: 'Annuleren',
    action_delete: 'Verwijderen',
    file_upload_click_to_upload: 'Klik om te uploaden',
    option_no_results: 'Geen resultaten gevonden',
    repeater_add: ':name toevoegen',
})

createApp({}).mount('#app')
tsx
import { createRoot } from 'react-dom/client'
import { setTranslations } from '@inertiaui/form-react'

setTranslations({
    action_cancel: 'Annuleren',
    action_delete: 'Verwijderen',
    file_upload_click_to_upload: 'Klik om te uploaden',
    option_no_results: 'Geen resultaten gevonden',
    repeater_add: ':name toevoegen',
})

createRoot(document.getElementById('app')).render(<App />)

The setTranslations function merges your overrides with the package defaults. Missing keys render as the key name, which makes incomplete translation sets easier to spot during development.

Replacement Tokens ​

String values use :name style replacement tokens:

ts
setTranslations({
    action_delete_field: ':name verwijderen',
    collection_move_up: ':name omhoog verplaatsen',
    wizard_progress: 'Stap :current van :total',
})

For labels that need pluralization or custom formatting, provide a function instead of a string. A function-valued TranslationValue receives the same replacement parameters that the component passes to the string formatter:

ts
import { setTranslations, type TranslationValue } from '@inertiaui/form-vue'

const wizardProgress: TranslationValue = ({ current, total }) => {
    const number = new Intl.NumberFormat('nl-NL')

    return `Stap ${number.format(Number(current))} van ${number.format(Number(total))}`
}

setTranslations({
    wizard_progress: wizardProgress,
})
tsx
import { setTranslations, type TranslationValue } from '@inertiaui/form-react'

const wizardProgress: TranslationValue = ({ current, total }) => {
    const number = new Intl.NumberFormat('nl-NL')

    return `Stap ${number.format(Number(current))} van ${number.format(Number(total))}`
}

setTranslations({
    wizard_progress: wizardProgress,
})

Function values only work for the regular frontend registry. Date and calendar defaults come from the same frontend translation source as the rest of the UI.

Available Frontend Translations ​

See the frontend translation source for the full list of available frontend keys and defaults.