Add new eslint plugin to check for valid i18n keys

This commit is contained in:
Jamie Kyle 2023-01-05 14:43:33 -08:00 committed by GitHub
parent 465b4cb0fb
commit 569b6e14a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 447 additions and 78 deletions

View file

@ -26,11 +26,13 @@ export function RemoveGroupMemberConfirmationDialog({
onClose,
onRemove,
}: PropsType): JSX.Element {
const descriptionKey = isAccessControlEnabled(
const accessControlEnabled = isAccessControlEnabled(
group.accessControlAddFromInviteLink
)
? 'RemoveGroupMemberConfirmation__description__with-link'
: 'RemoveGroupMemberConfirmation__description';
);
const intlComponents = {
name: <ContactName title={conversation.title} />,
};
return (
<ConfirmationDialog
@ -45,13 +47,19 @@ export function RemoveGroupMemberConfirmationDialog({
i18n={i18n}
onClose={onClose}
title={
<Intl
i18n={i18n}
id={descriptionKey}
components={{
name: <ContactName title={conversation.title} />,
}}
/>
accessControlEnabled ? (
<Intl
i18n={i18n}
id="RemoveGroupMemberConfirmation__description__with-link"
components={intlComponents}
/>
) : (
<Intl
i18n={i18n}
id="RemoveGroupMemberConfirmation__description"
components={intlComponents}
/>
)
}
/>
);