mirror of
https://github.com/documenso/documenso.git
synced 2026-07-17 00:30:21 +10:00
fix: mark document auth types for translation (#2331)
This commit is contained in:
@@ -1,30 +1,33 @@
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import type { TDocumentAuth } from '../types/document-auth';
|
||||
import { DocumentAuth } from '../types/document-auth';
|
||||
|
||||
type DocumentAuthTypeData = {
|
||||
key: TDocumentAuth;
|
||||
value: string;
|
||||
value: MessageDescriptor;
|
||||
};
|
||||
|
||||
export const DOCUMENT_AUTH_TYPES: Record<string, DocumentAuthTypeData> = {
|
||||
[DocumentAuth.ACCOUNT]: {
|
||||
key: DocumentAuth.ACCOUNT,
|
||||
value: 'Require account',
|
||||
value: msg`Require account`,
|
||||
},
|
||||
[DocumentAuth.PASSKEY]: {
|
||||
key: DocumentAuth.PASSKEY,
|
||||
value: 'Require passkey',
|
||||
value: msg`Require passkey`,
|
||||
},
|
||||
[DocumentAuth.TWO_FACTOR_AUTH]: {
|
||||
key: DocumentAuth.TWO_FACTOR_AUTH,
|
||||
value: 'Require 2FA',
|
||||
value: msg`Require 2FA`,
|
||||
},
|
||||
[DocumentAuth.PASSWORD]: {
|
||||
key: DocumentAuth.PASSWORD,
|
||||
value: 'Require password',
|
||||
value: msg`Require password`,
|
||||
},
|
||||
[DocumentAuth.EXPLICIT_NONE]: {
|
||||
key: DocumentAuth.EXPLICIT_NONE,
|
||||
value: 'None (Overrides global settings)',
|
||||
value: msg`None (Overrides global settings)`,
|
||||
},
|
||||
} satisfies Record<TDocumentAuth, DocumentAuthTypeData>;
|
||||
|
||||
@@ -35,7 +35,7 @@ export const DocumentGlobalAuthAccessSelect = ({
|
||||
},
|
||||
...Object.values(DocumentAccessAuth).map((authType) => ({
|
||||
value: authType,
|
||||
label: DOCUMENT_AUTH_TYPES[authType].value,
|
||||
label: _(DOCUMENT_AUTH_TYPES[authType].value),
|
||||
})),
|
||||
];
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export const DocumentGlobalAuthActionSelect = ({
|
||||
.filter((auth) => auth !== DocumentAuth.ACCOUNT)
|
||||
.map((authType) => ({
|
||||
value: authType,
|
||||
label: DOCUMENT_AUTH_TYPES[authType].value,
|
||||
label: _(DOCUMENT_AUTH_TYPES[authType].value),
|
||||
})),
|
||||
];
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export const RecipientActionAuthSelect = ({
|
||||
.filter((auth) => auth !== RecipientActionAuth.ACCOUNT)
|
||||
.map((authType) => ({
|
||||
value: authType,
|
||||
label: DOCUMENT_AUTH_TYPES[authType].value,
|
||||
label: _(DOCUMENT_AUTH_TYPES[authType].value),
|
||||
})),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user