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

Commit3de8a5c

Browse files
authored
fix: compatible with lower version node (#732)
1 parent105e0fd commit3de8a5c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎utils/getLanguage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ function getLocale() {
107107
}
108108

109109
asyncfunctionloadLanguageFile(filePath:string):Promise<Language>{
110-
return(awaitimport(pathToFileURL(filePath).toString(),{with:{type:'json'}})).default
110+
returnawaitfs.promises.readFile(filePath,'utf-8').then((data)=>{
111+
constparsedData=JSON.parse(data)
112+
if(parsedData){
113+
returnparsedData
114+
}
115+
})
111116
}
112117

113118
exportdefaultasyncfunctiongetLanguage(localesRoot:string){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp