Ant Design Svelte

Localization and direction

The application interface language, component signatures and value format are configured separately. The ConfigProvider passes the locale to the components of its subtree.

Component locale

To translate component labels, import a dictionary and pass it to ConfigProvider.locale. The package includes all 73 dictionaries from Ant Design 6.6.8. For example, import French from @woodger/antd/locale/fr_FR or Simplified Chinese from @woodger/antd/locale/zh_CN.

Working examples of calendar, pagination and dialog are available in ConfigProvider.

To customize labels, pass a partial Locale dictionary. An AntDesignLocale supplies a language dictionary. Omitted sections use the English labels.

Form messages and application text

Component signatures, validation messages and application text are at different levels. General rule messages are set via locale.Form.defaultValidateMessages or ConfigProvider.form.validateMessages. Form.validateMessages and rule.message have higher priority.

Change headers, texts of application buttons and your own validator messages separately. For a rich label, set messageVariables.label explicitly if it is needed in the message. Example Form templates shows priorities and substitution of nested groups.

Dates and Day.js

To format Day.js, connect the desired locale and assign it to the date instance. Dayjs is stored in the model, not a ready-made string for the server.

<script lang="ts">
  import { ConfigProvider, DatePicker } from '@woodger/antd';
  import frFR from '@woodger/antd/locale/fr_FR';
  import dayjs, { type Dayjs } from 'dayjs';
  import 'dayjs/locale/fr.js';

  let value = $state<Dayjs | null>(dayjs('2026-11-08').locale('fr'));
</script>

<ConfigProvider locale={frFR}>
  <DatePicker
    aria-label="Date de l’événement"
    {value}
    onChange={next => { value = next; }}
  />
</ConfigProvider>

The display format, time zone and sending format are selected for the task. For cross-language SSRs, do not change the Day.js global locale in the per-request handler. Read more about the values ​​in DatePicker.

Letter direction

Direction:rtl in ConfigProvider enables right-to-left direction for components that support it. Use the CSS boolean properties margin-inline, padding-inline, and text-align:start in your own markup. Check the order of operations, drop-down panels and keyboard in both directions.

Language and direction with SSR

Pass the selected locale and direction from the page or application data so that the server and the first client render match. Don't change the Day.js global locale for every server request: assign it to date instances.

Dir:rtl does not translate text or serialize values. Check dates, order of operations, mixed text and keyboard navigation separately. Areas with different locales and direction can be nested via ConfigProvider, preserving field models.