daypress
admin route/d-admin/languages
doc versionv1.0.4
reading time5 min read
section group08 · Content & Editorial
Docs/Content & Editorial
/d-admin/languages5 min readv1.0.4

Multilingual Sites (i18n): Locale Routing, hreflang & Switchers

Daypress ships native Polylang and WPML parity under Settings → Languages (/d-admin/languages)—routing localized URLs, emitting hreflang alternates, and switching visitor locales without third-party plugins.

1. Configure site languages & URL prefix strategy

Open Settings → Languages (/d-admin/languages) to register your active locales (including built-in presets for German, Dutch, French, Spanish, Italian, Japanese, Arabic/Hebrew with automatic dir="rtl" support, or any custom ISO code):

  • Unprefixed Default Locale (Recommended): Serves your primary language cleanly at root (/pricing/) and secondary locales under their ISO prefix (/nl/prijzen/, /de/preise/, /es/precios/).
  • Prefix All Locales: Routes every language—including the default locale—under its ISO prefix (/en/pricing/, /nl/prijzen/).
http://localhost:8090/d-admin/languages — Multilingual Routing & Coverage Matrix
Daypress Languages and Multilingual screen showing Configured Site Languages, URL Routing strategy, Add Language form, and Translation Coverage Matrix
Settings -> Languages (/d-admin/languages) manages active locales, prefix strategy, and the site-wide Translation Coverage Matrix.

Each localized page is a full first-class post or page in SQLite with its own translated slug, SEO metadata, and DayStudio layout AST:

  1. Clone the source page: Click Duplicate on /d-admin/edit?post_type=page (or call daypress_duplicate_post) so the localized page inherits the exact visual structure.
  2. Translate & publish: Update the title, localized slug (e.g. over-ons), prose, and SEO description.
  3. Link into a Translation Group: Connect the pages in the Link Existing Translations panel on /d-admin/languages, inside the editor's Translations meta box, or via daypress_link_translations:

Once linked, Daypress automatically injects reciprocal <link rel="alternate" hreflang="..."> tags (plus x-default) in every page's SSR <head> and outputs <xhtml:link rel="alternate"> entries in /sitemap.xml.

3. Place the LanguageSwitcher widget

When a visitor clicks a language in the switcher on /pricing/, Daypress routes directly to its linked counterpart (/nl/prijzen/), falling back gracefully to that locale's homepage (/nl/) if an individual post isn't translated yet:

json / shortcode
// DayStudio AST node inside your Header template:
{
  "id": "header_lang_switcher",
  "type": "LanguageSwitcher",
  "data": {
    "display_style": "pills",   // "pills" | "dropdown" | "inline"
    "show_flags": false,
    "show_names": false         // false = compact ISO codes (EN | NL | DE)
  },
  "styles": {}
}

// Or embed anywhere via shortcode: