[]previous and next page

DuskI18nConfig

Locales of the app (i18n in dusk.config.ts).

Locales of the app (i18n in dusk.config.ts). The default locale sets <html lang>; routing turns on automatic locale routing (see DuskI18nRoutingConfig).

Import#

ts
import type { DuskI18nConfig } from "@shadow-js/dusk/vite";

Signature#

ts
interface DuskI18nConfig {
  readonly locales: readonly string[];
  readonly defaultLocale: string;
  /** Declare it to let Dusk route by locale: the middleware, the redirects, the `hreflang` links and the client sync. */
  readonly routing?: DuskI18nRoutingConfig;
}

Members#

Name Type Description
locales readonly locales: readonly string[]
defaultLocale readonly defaultLocale: string
routing? readonly routing?: DuskI18nRoutingConfig Declare it to let Dusk route by locale: the middleware, the redirects, the hreflang links and the client sync.

Examples#

ts
const i18n: DuskI18nConfig = {
  locales: ["en", "fr"],
  defaultLocale: "en",
  routing: { instance: { module: "./src/i18n" } },
};