Normalize i18n() calls to prepare for ICU migration
This commit is contained in:
parent
7c8e7c1013
commit
c02c8d9640
17 changed files with 377 additions and 273 deletions
|
@ -571,7 +571,10 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
if (giftBadge) {
|
||||
const description = i18n(`icu:message--donation--unopened--${direction}`);
|
||||
const description =
|
||||
direction === 'incoming'
|
||||
? i18n('icu:message--donation--unopened--incoming')
|
||||
: i18n('icu:message--donation--unopened--outgoing');
|
||||
const isDescriptionRTL = getDirection(description) === 'rtl';
|
||||
|
||||
if (giftBadge.state === GiftBadgeStates.Unopened && !isDescriptionRTL) {
|
||||
|
|
|
@ -49,13 +49,23 @@ export function MessageRequestActionsConfirmation({
|
|||
onChangeState(MessageRequestState.default);
|
||||
}}
|
||||
title={
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id={`MessageRequests--block-${conversationType}-confirm-title`}
|
||||
components={{
|
||||
title: <ContactName key="name" title={title} />,
|
||||
}}
|
||||
/>
|
||||
conversationType === 'direct' ? (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MessageRequests--block-direct-confirm-title"
|
||||
components={{
|
||||
title: <ContactName key="name" title={title} />,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="MessageRequests--block-group-confirm-title"
|
||||
components={{
|
||||
title: <ContactName key="name" title={title} />,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
actions={[
|
||||
...(conversationType === 'direct'
|
||||
|
@ -74,7 +84,9 @@ export function MessageRequestActionsConfirmation({
|
|||
},
|
||||
]}
|
||||
>
|
||||
{i18n(`MessageRequests--block-${conversationType}-confirm-body`)}
|
||||
{conversationType === 'direct'
|
||||
? i18n('MessageRequests--block-direct-confirm-body')
|
||||
: i18n('MessageRequests--block-group-confirm-body')}
|
||||
</ConfirmationDialog>
|
||||
);
|
||||
}
|
||||
|
@ -104,7 +116,9 @@ export function MessageRequestActionsConfirmation({
|
|||
},
|
||||
]}
|
||||
>
|
||||
{i18n(`MessageRequests--unblock-${conversationType}-confirm-body`)}
|
||||
{conversationType === 'direct'
|
||||
? i18n('MessageRequests--unblock-direct-confirm-body')
|
||||
: i18n('MessageRequests--unblock-group-confirm-body')}
|
||||
</ConfirmationDialog>
|
||||
);
|
||||
}
|
||||
|
@ -128,13 +142,18 @@ export function MessageRequestActionsConfirmation({
|
|||
}
|
||||
actions={[
|
||||
{
|
||||
text: i18n(`MessageRequests--delete-${conversationType}`),
|
||||
text:
|
||||
conversationType === 'direct'
|
||||
? i18n('MessageRequests--delete-direct')
|
||||
: i18n('MessageRequests--delete-group'),
|
||||
action: () => deleteConversation(conversationId),
|
||||
style: 'negative',
|
||||
},
|
||||
]}
|
||||
>
|
||||
{i18n(`MessageRequests--delete-${conversationType}-confirm-body`)}
|
||||
{conversationType === 'direct'
|
||||
? i18n('MessageRequests--delete-direct-confirm-body')
|
||||
: i18n('MessageRequests--delete-group-confirm-body')}
|
||||
</ConfirmationDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -285,12 +285,13 @@ function getConfirmationMessage({
|
|||
|
||||
// Requesting a membership since they weren't added by anyone
|
||||
if (membershipType === StageType.DENY_REQUEST) {
|
||||
const params = {
|
||||
name: firstMembership.member.title,
|
||||
};
|
||||
return isAccessControlEnabled(conversation.accessControlAddFromInviteLink)
|
||||
? i18n('PendingRequests--deny-for--with-link', params)
|
||||
: i18n('PendingRequests--deny-for', params);
|
||||
? i18n('PendingRequests--deny-for--with-link', {
|
||||
name: firstMembership.member.title,
|
||||
})
|
||||
: i18n('PendingRequests--deny-for', {
|
||||
name: firstMembership.member.title,
|
||||
});
|
||||
}
|
||||
|
||||
if (membershipType === StageType.APPROVE_REQUEST) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue