fix: auth

This commit is contained in:
David Nguyen
2025-02-09 00:46:25 +11:00
parent f5bfec1990
commit e128e9369e
13 changed files with 188 additions and 142 deletions

View File

@ -3,13 +3,13 @@ import { i18n } from '@lingui/core';
import type { I18nLocaleData, SupportedLanguageCodes } from '../constants/i18n';
import { APP_I18N_OPTIONS } from '../constants/i18n';
import { env } from './env';
export async function dynamicActivate(locale: string) {
const extension = env('NODE_ENV') === 'development' ? 'po' : 'js';
// const extension = import.meta.env.PROD env('NODE_ENV') === 'development' ? 'po' : 'js';
// eslint-disable-next-line turbo/no-undeclared-env-vars
const extension = import.meta.env.PROD ? 'js' : 'po';
// Todo: Use extension (currently breaks).
const { messages } = await import(`../translations/${locale}/web.${extension}`);
i18n.loadAndActivate({ locale, messages });