Skip to content

Internationalization (i18n)

Starlight Changelogs relies on Starlight’s built-in support for internationalization to provide multilingual support for changelogs in your documentation.

See the Starlight internationalization documentation for more information on how to configure i18n in your Starlight website.

By default, changelog titles default to 'Changelog' and can be customized using the title property in the configuration of the provider used to load the changelog file. To provide a different title for different languages, you can pass an object to the title configuration option.

src/content.config.ts
import { docsLoader } from '@astrojs/starlight/loaders'
import { docsSchema } from '@astrojs/starlight/schema'
import { defineCollection } from 'astro:content'
import { changelogsLoader } from 'starlight-changelogs/loader'
export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
changelogs: defineCollection({
loader: changelogsLoader([
{
provider: 'changeset',
base: 'changelog',
changelog: '../packages/my-packages/CHANGELOG.md',
title: 'Version History',
title: {
en: 'Version History',
fr: 'Historique des versions',
},
},
]),
}),
}

Changelog sidebar links generated using the makeChangelogsSidebarLinks() helper function can also be translated by passing an object to the title property of the sidebar link configuration.

astro.config.mjs
// @ts-check
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightChangelogs, { makeChangelogsSidebarLinks } from 'starlight-changelogs'
export default defineConfig({
integrations: [
starlight({
plugins: [starlightChangelogs()],
title: 'My Docs',
sidebar: [
...makeChangelogsSidebarLinks([
{
type: 'all',
base: 'changelog',
label: 'Version History',
label: {
en: 'Version History',
fr: 'Historique des versions',
},
},
]),
],
}),
],
})

The Starlight Changelogs plugin allows you to translate the default UI strings used by the plugin so that generated changelog pages can be fully localized and readers can enjoy a seamless experience in their preferred language.

English, French, and German translated UI strings are provided out of the box.

To provide translations for additional languages you support — or override the default ones — check the “Translate Starlight’s UI” guide in the Starlight documentation.

These are the English defaults of the existing strings Starlight Changelogs ships with:

{
"starlightChangelogs.compare.label": "All versions forward",
"starlightChangelogs.compare.title": "All versions since {{version}}",
"starlightChangelogs.pagination.next": "Older versions",
"starlightChangelogs.pagination.prev": "Newer versions",
"starlightChangelogs.version.date": "{{date, datetime(dateStyle: medium)}}",
"starlightChangelogs.version.find": "Find a version",
"starlightChangelogs.version.open": "View on {{provider}}",
"starlightChangelogs.version.title": "Version {{version}}",
"starlightChangelogs.versions.all": "All versions"
}