Update i18n eslint rule to validate missing/extra icu params

This commit is contained in:
Jamie Kyle 2023-04-04 11:41:14 -07:00 committed by GitHub
parent 4e6c3ba9df
commit 8ca192a48d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 449 additions and 66 deletions

View file

@ -52,9 +52,7 @@ export function DeliveryIssueDialog(props: PropsType): React.ReactElement {
</>
);
const intlComponents = {
sender: <Emojify text={sender.title} />,
};
const senderTitle = <Emojify text={sender.title} />;
return (
<Modal
@ -80,13 +78,13 @@ export function DeliveryIssueDialog(props: PropsType): React.ReactElement {
{inGroup ? (
<Intl
id="icu:DeliveryIssue--summary--group"
components={intlComponents}
components={{ sender: senderTitle }}
i18n={i18n}
/>
) : (
<Intl
id="icu:DeliveryIssue--summary"
components={intlComponents}
components={{ sender: senderTitle }}
i18n={i18n}
/>
)}

View file

@ -92,7 +92,7 @@ export function MandatoryProfileSharingActions({
<Intl
i18n={i18n}
id="icu:MessageRequests--profile-sharing--group--link"
components={{ firstName: firstNameContact, learnMoreLink }}
components={{ learnMoreLink }}
/>
)}
</p>

View file

@ -2555,7 +2555,7 @@ export class Message extends React.PureComponent<Props, State> {
<span className="module-message__alt-accessibility-tree">
<span id={`message-accessibility-label:${id}`}>
{author.isMe
? i18n('icu:messageAccessibilityLabel--outgoing', {})
? i18n('icu:messageAccessibilityLabel--outgoing')
: i18n('icu:messageAccessibilityLabel--incoming', {
author: author.title,
})}

View file

@ -77,18 +77,10 @@ export function MessageRequestActions({
/>
)}
{conversationType === 'group' && isBlocked && (
<Intl
i18n={i18n}
id="icu:MessageRequests--message-group-blocked"
components={{ name }}
/>
<Intl i18n={i18n} id="icu:MessageRequests--message-group-blocked" />
)}
{conversationType === 'group' && !isBlocked && (
<Intl
i18n={i18n}
id="icu:MessageRequests--message-group"
components={{ name }}
/>
<Intl i18n={i18n} id="icu:MessageRequests--message-group" />
)}
</p>
<div className="module-message-request-actions__buttons">

View file

@ -136,9 +136,6 @@ export function MessageRequestActionsConfirmation({
<Intl
i18n={i18n}
id="icu:MessageRequests--delete-direct-confirm-title"
components={{
title: <ContactName key="name" title={title} />,
}}
/>
) : (
<Intl

View file

@ -30,9 +30,7 @@ export function RemoveGroupMemberConfirmationDialog({
group.accessControlAddFromInviteLink
);
const intlComponents = {
name: <ContactName title={conversation.title} />,
};
const contactName = <ContactName title={conversation.title} />;
return (
<ConfirmationDialog
@ -51,13 +49,13 @@ export function RemoveGroupMemberConfirmationDialog({
<Intl
i18n={i18n}
id="icu:RemoveGroupMemberConfirmation__description__with-link"
components={intlComponents}
components={{ name: contactName }}
/>
) : (
<Intl
i18n={i18n}
id="icu:RemoveGroupMemberConfirmation__description"
components={intlComponents}
components={{ name: contactName }}
/>
)
}

View file

@ -57,11 +57,7 @@ export function SafetyNumberNotification({
i18n={i18n}
/>
) : (
<Intl
id="icu:safetyNumberChanged"
components={{ name }}
i18n={i18n}
/>
<Intl id="icu:safetyNumberChanged" i18n={i18n} />
)
}
button={

View file

@ -50,28 +50,23 @@ function UnsupportedMessageContents({ canProcessNow, contact, i18n }: Props) {
/>
);
}
return (
<Intl
id="icu:Message--from-me-unsupported-message"
components={{ contact: contactName }}
i18n={i18n}
/>
);
return <Intl id="icu:Message--from-me-unsupported-message" i18n={i18n} />;
}
if (canProcessNow) {
return (
<Intl
id="icu:Message--from-me-unsupported-message-ask-to-resend"
components={{ contact: contactName }}
i18n={i18n}
/>
);
}
return (
<Intl
id="icu:Message--from-me-unsupported-message"
components={{ contact: contactName }}
id="icu:Message--unsupported-message"
i18n={i18n}
components={{
contact: contactName,
}}
/>
);
}