Skip to content

Commit 77d0eba

Browse files
committed
feat(docs): i18n config (zh-cn, ja)
1 parent b3df436 commit 77d0eba

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

site/astro.config.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ export default defineConfig({
1010
integrations: [
1111
starlight({
1212
title: 'Echo',
13+
defaultLocale: 'root',
14+
locales: {
15+
root: { label: 'English', lang: 'en' },
16+
'zh-cn': { label: '简体中文', lang: 'zh-CN' },
17+
ja: { label: '日本語', lang: 'ja' },
18+
},
1319
logo: {
1420
light: './src/assets/logo-light.svg',
1521
dark: './src/assets/logo-dark.svg',
@@ -73,9 +79,9 @@ export default defineConfig({
7379
// Autogenerated from the content dirs — new pages appear automatically,
7480
// ordered by each page's `sidebar.order` frontmatter.
7581
sidebar: [
76-
{ label: 'Guide', items: [{ autogenerate: { directory: 'guide' } }] },
77-
{ label: 'Middleware', items: [{ autogenerate: { directory: 'middleware' } }] },
78-
{ label: 'Cookbook', items: [{ autogenerate: { directory: 'cookbook' } }] },
82+
{ label: 'Guide', translations: { 'zh-CN': '指南', ja: 'ガイド' }, items: [{ autogenerate: { directory: 'guide' } }] },
83+
{ label: 'Middleware', translations: { 'zh-CN': '中间件', ja: 'ミドルウェア' }, items: [{ autogenerate: { directory: 'middleware' } }] },
84+
{ label: 'Cookbook', translations: { 'zh-CN': '示例', ja: 'クックブック' }, items: [{ autogenerate: { directory: 'cookbook' } }] },
7985
],
8086
// tune the built-in code theme toward our terminal palette
8187
expressiveCode: { themes: ['github-dark', 'github-light'] },

0 commit comments

Comments
 (0)