Leave i18n unset for a single-language site. Enable it when the repository
maintains translated content and someone owns the fallback behavior. Locale
configuration applies to enabled collections, including docs and writing.
Configure locales
import { defineConfig } from 'tidypress'
export default defineConfig({
name: 'my-project',
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
})Routes:
/docs/getting-started
/fr/docs/getting-started
/writing
/fr/writingThe default locale stays at the root path. Non-default locales use a locale prefix.
Content
site/
└── src/content/
├── writing/ # dated posts (RSS, tags, archive)
│ ├── hello.md
│ └── fr/hello.md
└── docs/ # docs collection — sidebar-ordered guides at /docs/…
├── getting-started.md
└── fr/getting-started.mdIf a non-default locale is missing a page, TidyPress falls back to the default-locale content for that route.
UI strings
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
strings: {
fr: {
searchLabel: 'rechercher',
searchPlaceholder: 'Rechercher...',
docsTitle: 'Docs',
writingTitle: 'Articles',
onThisPageLabel: 'Sur cette page',
},
},
}Keys:
docsLabelwritingLabelmoreLabelsearchLabelsearchPlaceholdersearchEmptyLabelsearchUnavailableLabelsearchNoResultsLabelsearchFilterLabelsearchFilterAllLabeluntitledLabeldocsTitlewritingTitleallDocsLabelallWritingLabelonThisPageLabeleditThisPageLabelcopyLabelcopyPageLabelcopyMarkdownLabelcopyFailedLabelcopiedLabellanguageLabel(footer language switcher wheni18n.localeshas more than one locale)chapterPreviousLabelchapterNextLabelmanualFormBadgeLabel
The switcher renders in the footer main band (main.end). See the
config reference for the footer model.
Search
Pagefind indexes the built pages. The search UI scopes localized results to the active path when possible.