ViraStack
  • About
  • Support
HomeGet StartedBuilder

Getting started

  • Introduction
  • Installation
  • llms.txt
  • llms-full.txt

CLI

  • Commands and flags
  • Templates

Project

  • Scripts
  • i18n

i18n

Only for the multi-language templates: how locales and the default language are wired.

When this applies

This page only applies if you chose multi-language support at install time (the templates-i18n copy). Plain templates have no locale routing. Template overview: templates.

Next.js (next-intl)

Config lives in src/i18n/routing.ts. The scaffold ships with en and tr.

  • locales / defaultLocale: which languages exist and which one is the fallback (en by default).
  • Copy lives in src/messages/en.json and src/messages/tr.json (loaded via src/i18n/request.ts).
  • localePrefix: "as-needed": the default locale has no URL prefix (/); others use /tr/….

For APIs and patterns beyond this scaffold, see the next-intl docs.

TanStack Start (Paraglide)

Locales are defined in project.inlang/settings.json. Routing uses the $lang segment under src/routes/.

  • sourceLanguageTag: source / default language (en by default). languageTags: all locales.
  • Messages live under messages/{languageTag}.json (for example messages/en.json).
  • App routes use /$lang: both locales are prefixed (/en/… and /tr/…). / redirects to /en (baseLocale). This is not Next-style as-needed.

For Paraglide details, see the Paraglide JS docs.

Change the default language

If you want to make another language the default:

  1. Next.js: set defaultLocale in src/i18n/routing.ts (for example "tr"). With as-needed, the new default loses its URL prefix.
  2. TanStack Start: set sourceLanguageTag in project.inlang/settings.json (and regenerate Paraglide so baseLocale updates). / will redirect to that locale; URLs stay prefixed for every language (/tr/…, /en/…).
  3. Update product copy in the matching message files. Keep site.config / SEO locale fields consistent if you expose them.

To add a new language, register it in the locale list, create its message file, and expose it in the language switcher. See the next-intl or Paraglide docs for details.

PreviousScripts

On this page

  • When this applies
  • <nextjs>Next.js</nextjs> (next-intl)
  • <tanstack>TanStack Start</tanstack> (Paraglide)
  • Change the default language
Something wrong? Fix it