Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit39b4a69

Browse files
committed
docs: docs support i18n.md
1 parent3a7bcc8 commit39b4a69

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎docs/web/config/i18n.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ export const i18nConfig: I18nConfig = {
151151
}
152152

153153
// Helper function to get current language from URL or localStorage
154-
exportfunctiongetCurrentLanguage():string{
154+
exportfunctiongetCurrentLanguage(router?:any):string{
155+
if(router?.href.includes('zh')){
156+
return'zh'
157+
}
158+
if(router?.href.includes('en')){
159+
return'en'
160+
}
155161
if(typeofwindow!=='undefined'){
156162
// Check URL path first
157163
constpath=window.location.pathname

‎docs/web/pages/docs/fetch.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getConfig } from './config'
44

55
exportdefaultasync({ router},ctx?:ISSRContext)=>{
66
constpage=router.params.page
7-
constlang=getCurrentLanguage()
7+
constlang=getCurrentLanguage(router)
88
constdata=(awaitimport(`@/markdown/${lang}/${page.replace(/\$/g,'/')}.md`)).default
99
if(__isBrowser__){
1010
if(page==='features/v7'){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp