mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
fix: resolve internal pdf translations
This commit is contained in:
@ -5,11 +5,17 @@ import type { I18nLocaleData, SupportedLanguageCodes } from '../constants/i18n';
|
||||
import { APP_I18N_OPTIONS } from '../constants/i18n';
|
||||
import { env } from './env';
|
||||
|
||||
export async function dynamicActivate(locale: string) {
|
||||
export async function getTranslations(locale: string) {
|
||||
const extension = env('NODE_ENV') === 'development' ? 'po' : 'mjs';
|
||||
|
||||
const { messages } = await import(`../translations/${locale}/web.${extension}`);
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
export async function dynamicActivate(locale: string) {
|
||||
const messages = await getTranslations(locale);
|
||||
|
||||
i18n.loadAndActivate({ locale, messages });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user