Translations
Inertia Forms has two translation surfaces:
- Laravel translations for backend validation messages, upload endpoint responses, and validation rules.
- Frontend translations for built-in UI copy, client-side labels, empty states, dialogs, upload status, and accessibility text.
Application-owned copy, such as field labels, help text, placeholders, option labels, fieldset legends, and wizard step titles, is still passed from your form classes. Use your application's own translation keys for that copy:
TextInput::make('email')
->label(__('profile.email'))
->placeholder(__('profile.email_placeholder'));Laravel Translations
Publish the package language files when you want to override built-in PHP messages:
php artisan vendor:publish --tag=inertia-forms-langThis creates lang/vendor/inertia-forms/en/inertia-forms.php. Override backend-owned package messages there:
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, such as submit button text, wizard navigation labels, checkbox group select-all labels, and option group fallback labels, live in the Vue and React translation registry.
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() once in your app entry file before forms render:
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')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 />)setTranslations() 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:
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 the component passes to the string formatter:
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,
})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 are for the regular frontend registry. Date and calendar defaults use 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.