Translations - Crowdin, Set workspace member locale on signup, and optimizations (#10091)

More progress on translations:
- Migrate from translations.io to crowdin
- Optimize performance and robustness 
- Set workspaceMember/user locale upon signup
This commit is contained in:
Félix Malfait
2025-02-09 22:10:41 +01:00
committed by GitHub
parent fd3f01ab80
commit bb24c97f80
163 changed files with 84053 additions and 2554 deletions

View File

@ -2,6 +2,11 @@ import { i18n } from '@lingui/core';
import { APP_LOCALES } 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';
}
const { messages } = await import(`../../locales/generated/${locale}.ts`);
i18n.load(locale, messages);
i18n.activate(locale);