setup localization for twenty-emails (#9806)
One of the steps to address #8128 How to test: Please change the locale in the settings and click on change password button. A password reset email in the preferred locale will be sent.   Todo: - Remove the hardcoded locales for invitation, warn suspended workspace email, clean suspended workspace emails - Need to test invitation, email verification, warn suspended workspace email, clean suspended workspace emails - The duration variable `5 minutes` is always in english. Do we need to do something about that? It does seems odd in case of chinese translations. Notes: - Only tested the password reset , password update notify templates. - Cant test email verification due to error during sign up `Internal server error: New workspace setup is disabled` --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
committed by
GitHub
parent
4b9414a002
commit
39e7f6cec3
@ -16,7 +16,7 @@ import { detectTimeZone } from '@/localization/utils/detectTimeZone';
|
||||
import { getDateFormatFromWorkspaceDateFormat } from '@/localization/utils/getDateFormatFromWorkspaceDateFormat';
|
||||
import { getTimeFormatFromWorkspaceTimeFormat } from '@/localization/utils/getTimeFormatFromWorkspaceTimeFormat';
|
||||
import { ColorScheme } from '@/workspace-member/types/WorkspaceMember';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
import { APP_LOCALES, isDefined } from 'twenty-shared';
|
||||
import { WorkspaceMember } from '~/generated-metadata/graphql';
|
||||
import { useGetCurrentUserQuery } from '~/generated/graphql';
|
||||
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
|
||||
@ -70,7 +70,7 @@ export const UserProviderEffect = () => {
|
||||
return {
|
||||
...workspaceMember,
|
||||
colorScheme: (workspaceMember.colorScheme as ColorScheme) ?? 'Light',
|
||||
locale: workspaceMember.locale ?? 'en',
|
||||
locale: (workspaceMember.locale as keyof typeof APP_LOCALES) ?? 'en',
|
||||
};
|
||||
};
|
||||
|
||||
@ -93,7 +93,9 @@ export const UserProviderEffect = () => {
|
||||
: TimeFormat[detectTimeFormat()],
|
||||
});
|
||||
|
||||
dynamicActivate(workspaceMember.locale ?? 'en');
|
||||
dynamicActivate(
|
||||
(workspaceMember.locale as keyof typeof APP_LOCALES) ?? 'en',
|
||||
);
|
||||
}
|
||||
|
||||
if (isDefined(workspaceMembers)) {
|
||||
|
||||
Reference in New Issue
Block a user