Add i18n support for site title #1282
Replies: 2 comments
-
Thanks for the feature request @ybw0014! I agree we should support this. For some context, we did previously start work on support for this in #281 but agreed we’d prefer an approach where fields like this can either be a simple string as currently: title: 'My site' OR an object defining the translations: title: {
en: 'My site',
fr: 'Mon site',
}, i.e. avoid introducing dedicated fields for translations (e.g. So that would probably be the API we’d like to implement in case someone is interested in contributing a PR. |
Beta Was this translation helpful? Give feedback.
-
Starlight Documentation for this feature is available here but the change would be: import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
export default defineConfig({
integrations: [
starlight({
- title: 'My Docs',
+ title: {
+ en: 'My Docs',
+ 'zh-CN': '我的文档',
+ },
defaultLocale: 'en',
locales: {
en: { label: 'English' },
'zh-cn': { label: '简体中文', lang: 'zh-CN' },
},
}),
],
}); |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?0.15.0
What is your idea?
Allows site title to be translated by i18n.
Why is this feature necessary?
Current i18n is fine, but I would like the site title to be able to be translated as well.
Do you have examples of this feature in other projects?
My site's title is
ybw0014's Minecraft plugin documents
. It should be translated in other languages. It is not like a product name that can choose not to translate.Participation
Beta Was this translation helpful? Give feedback.
All reactions