Skip to content

Commit 79a934e

Browse files
chore: wip
1 parent 6f3005d commit 79a934e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/core/src/locale-loader.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,28 +251,25 @@ export class LocaleLoader {
251251
}
252252

253253
try {
254-
// Get the current file directory (packages/core/src)
255-
const currentDir = import.meta.dirname || __dirname || new URL('.', import.meta.url).pathname
256-
257254
// From packages/core/src, go up to packages/, then into the locale package
258255
const relativePath = `../../${localeInfo.packageName}/dist/index.js`
259256
const module = await import(relativePath)
260-
257+
261258
return module[localeInfo.normalized] || module[localeInfo.language] || module.default
262259
}
263-
catch (error) {
260+
catch {
264261
// If relative import fails, try with file:// protocol for absolute path
265262
try {
266263
const workspaceRoot = process.cwd()
267264
const packageDir = join(workspaceRoot, 'packages', localeInfo.packageName, 'dist', 'index.js')
268-
265+
269266
if (!existsSync(packageDir)) {
270267
return null
271268
}
272269

273270
const absolutePath = `file://${packageDir}`
274271
const module = await import(absolutePath)
275-
272+
276273
return module[localeInfo.normalized] || module[localeInfo.language] || module.default
277274
}
278275
catch {

0 commit comments

Comments
 (0)