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

Commit 3de8a5c

Browse files
authored
fix: compatible with lower version node (#732)
1 parent 105e0fd commit 3de8a5c

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
async function loadLanguageFile(filePath: string): Promise<Language> {
110-
return (await import(pathToFileURL(filePath).toString(), { with: { type: 'json' } })).default
110+
return await fs.promises.readFile(filePath, 'utf-8').then((data) => {
111+
const parsedData = JSON.parse(data)
112+
if (parsedData) {
113+
return parsedData
114+
}
115+
})
111116
}
112117

113118
export default async function getLanguage(localesRoot: string) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /