File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11import type { DefaultTheme } from "vitepress/types"
2+ import { Locale } from "./types"
23
34export function projectSidebar (
4- projectIndex : string
5+ projectIndex : string ,
6+ locale ?: Locale
57) : DefaultTheme . SidebarItem [ ] {
8+ const langTag = locale && locale != Locale . EN_GB ? `/${ locale } ` : ""
69 return [
7- { text : "Intro" , link : `/projects/${ projectIndex } /` } ,
8- { text : "Usage" , link : `/projects/${ projectIndex } /usage` } ,
9- { text : "API" , link : `/projects/${ projectIndex } /api` } ,
10- { text : "Changelog" , link : `/projects/${ projectIndex } /changelog` } ,
10+ { text : "Intro" , link : `${ langTag } /projects/${ projectIndex } /` } ,
11+ { text : "Usage" , link : `${ langTag } /projects/${ projectIndex } /usage` } ,
12+ { text : "API" , link : `${ langTag } /projects/${ projectIndex } /api` } ,
13+ {
14+ text : "Changelog" ,
15+ link : `${ langTag } /projects/${ projectIndex } /changelog` ,
16+ } ,
1117 ]
1218}
Original file line number Diff line number Diff line change 1+ export enum Locale {
2+ EN_GB = "en-GB" ,
3+ ZH_CN = "zh-CN"
4+ }
You can’t perform that action at this time.
0 commit comments