We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 105e0fd commit 3de8a5cCopy full SHA for 3de8a5c
utils/getLanguage.ts
@@ -107,7 +107,12 @@ function getLocale() {
107
}
108
109
async function loadLanguageFile(filePath: string): Promise<Language> {
110
- return (await import(pathToFileURL(filePath).toString(), { with: { type: 'json' } })).default
+ return await fs.promises.readFile(filePath, 'utf-8').then((data) => {
111
+ const parsedData = JSON.parse(data)
112
+ if (parsedData) {
113
+ return parsedData
114
+ }
115
+ })
116
117
118
export default async function getLanguage(localesRoot: string) {
0 commit comments