File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1- import { DEFAULT_LOCALE } from "@/lib/constants"
1+ import { existsSync } from "fs"
2+ import { join } from "path"
23
3- import { loadMessages } from "@/lib/i18n/loadMessages "
4+ import { DEFAULT_LOCALE } from "@/lib/constants "
45
56/**
67 * Determine whether all required i18n namespaces exist for a given locale.
@@ -12,8 +13,9 @@ export async function areNamespacesTranslated(
1213) : Promise < boolean > {
1314 if ( locale === DEFAULT_LOCALE ) return true
1415
15- const localeMessages = await loadMessages ( locale )
16+ const intlPath = join ( process . cwd ( ) , "src/intl" )
17+
1618 return namespaces . every ( ( ns ) =>
17- Object . prototype . hasOwnProperty . call ( localeMessages , ns )
19+ existsSync ( join ( intlPath , locale , ` ${ ns } .json` ) )
1820 )
1921}
You can’t perform that action at this time.
0 commit comments