The update simplifies accessing environment keys and role warnings in Supabase clients by moving them to new functions 'getSupabaseClientKeys' and 'getServiceRoleKey'. The redundancy in the code is reduced promoting clearer and more maintainable code. The '@epic-web/invariant' import has been removed from files as it is no longer needed.
12 lines
289 B
TypeScript
12 lines
289 B
TypeScript
/**
|
|
* Resolves the translation file for a given language and namespace.
|
|
*
|
|
*/
|
|
export async function i18nResolver(language: string, namespace: string) {
|
|
const data = await import(
|
|
`../../public/locales/${language}/${namespace}.json`
|
|
);
|
|
|
|
return data as Record<string, string>;
|
|
}
|