Translations cleaning / workflows (#10125)

This commit is contained in:
Félix Malfait
2025-02-11 15:26:21 +01:00
committed by GitHub
parent 6da9976193
commit cc68deaab1
63 changed files with 376 additions and 164 deletions

View File

@ -1,11 +1,11 @@
import { i18n } from '@lingui/core';
import { APP_LOCALES } from 'twenty-shared';
import { APP_LOCALES, SOURCE_LOCALE } from 'twenty-shared';
export const dynamicActivate = async (locale: keyof typeof APP_LOCALES) => {
if (!Object.values(APP_LOCALES).includes(locale)) {
// eslint-disable-next-line no-console
console.warn(`Invalid locale "${locale}", defaulting to "en"`);
locale = 'en';
locale = SOURCE_LOCALE;
}
const { messages } = await import(`../../locales/generated/${locale}.ts`);
i18n.load(locale, messages);