Skip to main content

Localization

i18n Pattern

Always write hardcoded strings in English wrapped with __() to support localization. This pattern works in both PHP and TypeScript.

PHP Example

return redirect()->back()->withSuccess(__('User was created'));

TypeScript Example

<Button>{__('Save changes')}</Button>

Guidelines

  • Write the English text directly inside __()
  • Don’t use translation keys like __('users.created')
  • The system will extract and manage translations automatically