Messages and localization
Customize internal text, accessible labels, and formatting locales.
Internal labels and messages come from a shared English registry. Override only the keys your application needs; the remaining keys keep their defaults.
Global messages
export default defineAppConfig({
selaras: {
locale: 'id-ID',
messages: {
close: 'Tutup',
clear: 'Hapus',
search: 'Cari...',
noOptions: 'Tidak ada pilihan',
paginationInfo: (page: number, total: number) => `Halaman ${page} dari ${total}`,
},
},
})
Messages include accessible labels as well as visible text. Function-valued messages must remain functions with the documented arguments. See useMessages for every key and its default.
For interpolated announcements such as Stepper progress, keep the message as a
function: stepperProgress: (step, total) => `Langkah ${step} dari ${total}`.
The Stepper progress slot
also allows an individual instance to supply its own text.
Local content
<SInput placeholder="Search customers..." />
<SButton>Save changes</SButton>
Text you supply through props, item labels, and slots stays under your control. Use each component's documented props or slots to customize individual instances. There is no generic per-component messages prop or scoped message registry on STheme.
Formatting locale
selaras.locale sets the BCP 47 locale used by locale-aware formatting and date controls. It does not translate the message registry. Configure both when localizing an application. Selaras does not ship additional translation packs.
Use useLocale and useMessages in your own components to share the application's configuration.