Don't use the term gift

This commit is contained in:
Alvaro 2023-01-23 13:42:40 -07:00 committed by GitHub
parent 9de33e4ffd
commit ce8a1f5930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 130 additions and 46 deletions

View file

@ -2283,83 +2283,159 @@
}, },
"giftBadge--missing": { "giftBadge--missing": {
"message": "Unable to fetch gift badge details", "message": "Unable to fetch gift badge details",
"description": "Aria label for gift badge when we can't fetch the details" "description": "(deleted 2023/01/20) Aria label for gift badge when we can't fetch the details"
},
"icu:donation--missing": {
"messageformat": "Unable to fetch donation details",
"description": "Aria label for donation when we can't fetch the details."
}, },
"message--giftBadge--unopened--incoming": { "message--giftBadge--unopened--incoming": {
"message": "View this message on mobile to open it", "message": "View this message on mobile to open it",
"description": "Shown in a message's bubble when you've received a gift badge from a contact" "description": "(deleted 2023/01/20) Shown in a message's bubble when you've received a gift badge from a contact"
},
"icu:message--donation--unopened--incoming": {
"messageformat": "View this message on mobile to open it",
"description": "Shown in a message's bubble when you've received a donation badge from a contact"
}, },
"message--giftBadge--unopened--outgoing": { "message--giftBadge--unopened--outgoing": {
"message": "Tap this message on mobile to view your gift", "message": "Tap this message on mobile to view your gift",
"description": "Shown in a message's bubble when you've sent a gift badge to a contact" "description": "(deleted 2023/01/20) Shown in a message's bubble when you've sent a gift badge to a contact"
},
"icu:message--donation--unopened--outgoing": {
"messageformat": "Tap this message on mobile to view your donation",
"description": "Shown in a message's bubble when you've sent a donation badge to a contact."
}, },
"message--giftBadge--unopened--label": { "message--giftBadge--unopened--label": {
"message": "Gift", "message": "Gift",
"description": "Shown in a message's bubble when you've received a gift badge from a contact" "description": "(deleted 2023/01/20) Shown in a message's bubble when you've received a gift badge from a contact"
},
"icu:message--donation--unopened--label": {
"messageformat": "{sender} donated to Signal on your behalf",
"description": "Shown in a message's bubble when you've received a donation badge from a contact."
}, },
"message--giftBadge--unopened--toast--incoming": { "message--giftBadge--unopened--toast--incoming": {
"message": "Check your phone to open gift", "message": "Check your phone to open gift",
"description": "Shown when you've clicked on an incoming gift badge you haven't yet redeemed" "description": "(deleted 2023/01/20) Shown when you've clicked on an incoming gift badge you haven't yet redeemed"
},
"icu:message--donation--unopened--toast--incoming": {
"messageformat": "Check your phone to open this donation",
"description": "Shown when you've clicked on an incoming donation you haven't yet redeemed."
}, },
"message--giftBadge--unopened--toast--outgoing": { "message--giftBadge--unopened--toast--outgoing": {
"message": "Check your phone to view your gift", "message": "Check your phone to view your gift",
"description": "Shown when you've clicked on an outgoing gift badge" "description": "(deleted 2023/01/20) Shown when you've clicked on an outgoing gift badge"
},
"icu:message--donation--unopened--toast--outgoing": {
"messageformat": "Check your phone to view your donation",
"description": "Shown when you've clicked on an outgoing donation badge."
}, },
"message--giftBadge--preview--unopened": { "message--giftBadge--preview--unopened": {
"message": "You received a gift", "message": "You received a gift",
"description": "Shown to label the gift badge in notifications and the left pane" "description": "(deleted 2023/01/20) Shown to label the gift badge in notifications and the left pane"
},
"icu:message--donation--preview--unopened": {
"messageformat": "{sender} donated for you",
"description": "Shown to label the donation badge in notifications and the left pane."
}, },
"message--giftBadge--preview--redeemed": { "message--giftBadge--preview--redeemed": {
"message": "You redeemed a gift badge", "message": "You redeemed a gift badge",
"description": "Shown to label the redeemed gift badge in notifications and the left pane" "description": "(deleted 2023/01/20) Shown to label the redeemed gift badge in notifications and the left pane"
},
"icu:message--donation--preview--redeemed": {
"messageformat": "You redeemed a donation",
"description": "Shown to label the redeemed donation badge in notifications and the left pane."
}, },
"message--giftBadge--preview--sent": { "message--giftBadge--preview--sent": {
"message": "You sent a gift badge", "message": "You sent a gift badge",
"description": "Shown to label a gift badge you've sent in notifications and the left pane" "description": "(deleted 2023/01/20) Shown to label a gift badge you've sent in notifications and the left pane"
},
"icu:message--donation--preview--sent": {
"messageformat": "You donated for {recipient}",
"description": "Shown to label a donation badge you've sent in notifications and the left pane"
}, },
"message--giftBadge": { "message--giftBadge": {
"message": "Gift Badge", "message": "Gift Badge",
"description": "Shown to label the gift badge you've redeemed on another device" "description": "(deleted 2023/01/20) Shown to label the gift badge you've redeemed on another device"
},
"icu:message--donation": {
"messageformat": "Donation",
"description": "Shown to label the donation badge you've redeemed on another device."
}, },
"quote--giftBadge": { "quote--giftBadge": {
"message": "Gift", "message": "Gift",
"description": "Shown to label a gift badge you've replied to" "description": "(deleted 2023/01/20) Shown to label a gift badge you've replied to"
},
"icu:quote--donation": {
"messageformat": "Donation",
"description": "Shown to label a donation badge you've replied to."
}, },
"message--giftBadge--remaining--days": { "message--giftBadge--remaining--days": {
"message": "$days$ days remaining", "message": "$days$ days remaining",
"description": "Describes how long remains for the gift badge you've redeemed on another device (only rendered for days > 1)" "description": "(deleted 2023/01/20) Describes how long remains for the donation badge you've redeemed on another device (only rendered for days > 1)"
},
"icu:message--donation--remaining--days": {
"messageformat": "{days} days remaining",
"description": "Describes how long remains for the donation badge you've redeemed on another device (only rendered for days > 1)."
}, },
"message--giftBadge--remaining--hours": { "message--giftBadge--remaining--hours": {
"message": "$hours$ hours remaining", "message": "$hours$ hours remaining",
"description": "Describes how long remains for the gift badge you've redeemed on another device (only rendered for hours > 1)" "description": "(deleted 2023/01/20) Describes how long remains for the donation badge you've redeemed on another device (only rendered for hours > 1)"
},
"icu:message--donation--remaining--hours": {
"messageformat": "{hours} hours remaining",
"description": "Describes how long remains for the donation badge you've redeemed on another device (only rendered for hours > 1)"
}, },
"message--giftBadge--remaining--minutes": { "message--giftBadge--remaining--minutes": {
"message": "$minutes$ minutes remaining", "message": "$minutes$ minutes remaining",
"description": "Describes how long remains for the gift badge you've redeemed on another device (only rendered for minutes > 1)" "description": "(deleted 2023/01/20) Describes how long remains for the donation badge you've redeemed on another device (only rendered for minutes > 1)"
},
"icu:message--donation--remaining--minutes": {
"messageformat": "{minutes, plural, one {1 minute} other {# minutes}} remaining",
"description": "(deleted 2023/01/20) Describes how long remains for the donation badge you've redeemed on another device."
}, },
"message--giftBadge--remaining--one-minute": { "message--giftBadge--remaining--one-minute": {
"message": "1 minute remaining", "message": "1 minute remaining",
"description": "Describes how long remains for the gift badge you've redeemed on another device" "description": "(deleted 2023/01/20) Describes how long remains for the donation badge you've redeemed on another device"
}, },
"message--giftBadge--expired": { "message--giftBadge--expired": {
"message": "Expired", "message": "Expired",
"description": "Shows that a gift badge is expired" "description": "(deleted 2023/01/20) Shows that a gift badge is expired"
},
"icu:message--donation--expired": {
"messageformat": "Expired",
"description": "Shows that a donation badge is expired"
}, },
"message--giftBadge--view": { "message--giftBadge--view": {
"message": "View", "message": "View",
"description": "Shown when you've sent a gift badge to someone then opened it" "description": "Shown when you've sent a gift badge to someone then opened it"
}, },
"icu:message--donation--view": {
"messageformat": "View",
"description": "Shown when you've sent a donation badge to someone then opened it"
},
"message--giftBadge--redeemed": { "message--giftBadge--redeemed": {
"message": "Redeemed", "message": "Redeemed",
"description": "Shown when you've redeemed the gift badge on another device" "description": "(deleted 2023/01/20) Shown when you've redeemed the gift badge on another device"
},
"icu:message--donation--redeemed": {
"messageformat": "Redeemed",
"description": "Shown when you've redeemed the donation badge on another device"
}, },
"modal--giftBadge--title": { "modal--giftBadge--title": {
"message": "Thanks for your support!", "message": "Thanks for your support!",
"description": "The title of the outgoing gift badge detail dialog" "description": "(deleted 2023/01/20) The title of the outgoing gift badge detail dialog"
},
"icu:modal--donation--title": {
"messageformat": "Thanks for your support!",
"description": "The title of the outgoing donation badge detail dialog"
}, },
"modal--giftBadge--description": { "modal--giftBadge--description": {
"message": "You've gifted a badge to $name$. When they accept, they'll be given a choice to show or hide their badge.", "message": "You've gifted a badge to $name$. When they accept, they'll be given a choice to show or hide their badge.",
"description": "The description of the outgoing gift badge detail dialog" "description": "(deleted 2023/01/20) The description of the outgoing gift badge detail dialog"
},
"icu:modal--donation--description": {
"messageformat": "You've made a donation to Signal on behalf of {name}. They'll be given the option to show their support on their profile.",
"description": "The description of the outgoing donation badge detail dialog"
}, },
"stickers--toast--InstallFailed": { "stickers--toast--InstallFailed": {
"message": "Sticker pack could not be installed", "message": "Sticker pack could not be installed",

View file

@ -48,7 +48,7 @@ export function OutgoingGiftBadgeModal({
`${CLASS_NAME}__badge`, `${CLASS_NAME}__badge`,
`${CLASS_NAME}__badge--missing` `${CLASS_NAME}__badge--missing`
)} )}
aria-label={i18n('giftBadge--missing')} aria-label={i18n('icu:donation--missing')}
/> />
); );
@ -63,14 +63,14 @@ export function OutgoingGiftBadgeModal({
> >
<div className={CLASS_NAME}> <div className={CLASS_NAME}>
<div className={`${CLASS_NAME}__title`}> <div className={`${CLASS_NAME}__title`}>
{i18n('modal--giftBadge--title')} {i18n('icu:modal--donation--title')}
</div> </div>
<div className={`${CLASS_NAME}__description`}> <div className={`${CLASS_NAME}__description`}>
{i18n('modal--giftBadge--description', { name: recipientTitle })} {i18n('icu:modal--donation--description', { name: recipientTitle })}
</div> </div>
{badgeElement} {badgeElement}
<div className={`${CLASS_NAME}__badge-summary`}> <div className={`${CLASS_NAME}__badge-summary`}>
{i18n('message--giftBadge')} {i18n('icu:message--donation')}
</div> </div>
</div> </div>
</Modal> </Modal>

View file

@ -82,7 +82,7 @@ export function ToastManager({
if (toastType === ToastType.CannotOpenGiftBadgeIncoming) { if (toastType === ToastType.CannotOpenGiftBadgeIncoming) {
return ( return (
<Toast onClose={hideToast}> <Toast onClose={hideToast}>
{i18n('message--giftBadge--unopened--toast--incoming')} {i18n('icu:message--donation--unopened--toast--incoming')}
</Toast> </Toast>
); );
} }
@ -90,7 +90,7 @@ export function ToastManager({
if (toastType === ToastType.CannotOpenGiftBadgeOutgoing) { if (toastType === ToastType.CannotOpenGiftBadgeOutgoing) {
return ( return (
<Toast onClose={hideToast}> <Toast onClose={hideToast}>
{i18n('message--giftBadge--unopened--toast--outgoing')} {i18n('icu:message--donation--unopened--toast--outgoing')}
</Toast> </Toast>
); );
} }

View file

@ -557,7 +557,7 @@ export class Message extends React.PureComponent<Props, State> {
} }
if (giftBadge) { if (giftBadge) {
const description = i18n(`message--giftBadge--unopened--${direction}`); const description = i18n(`icu:message--donation--unopened--${direction}`);
const isDescriptionRTL = getDirection(description) === 'rtl'; const isDescriptionRTL = getDirection(description) === 'rtl';
if (giftBadge.state === GiftBadgeStates.Unopened && !isDescriptionRTL) { if (giftBadge.state === GiftBadgeStates.Unopened && !isDescriptionRTL) {
@ -1228,7 +1228,7 @@ export class Message extends React.PureComponent<Props, State> {
} }
if (giftBadge.state === GiftBadgeStates.Unopened) { if (giftBadge.state === GiftBadgeStates.Unopened) {
const description = i18n(`message--giftBadge--unopened--${direction}`); const description = i18n(`icu:message--donation--unopened--${direction}`);
const isRTL = getDirection(description) === 'rtl'; const isRTL = getDirection(description) === 'rtl';
const { metadataWidth } = this.state; const { metadataWidth } = this.state;
@ -1239,7 +1239,9 @@ export class Message extends React.PureComponent<Props, State> {
'module-message__unopened-gift-badge', 'module-message__unopened-gift-badge',
`module-message__unopened-gift-badge--${direction}` `module-message__unopened-gift-badge--${direction}`
)} )}
aria-label={i18n('message--giftBadge--unopened--label')} aria-label={i18n('icu:message--donation--unopened--label', {
sender: conversationTitle,
})}
> >
<div <div
className="module-message__unopened-gift-badge__ribbon-horizontal" className="module-message__unopened-gift-badge__ribbon-horizontal"
@ -1302,26 +1304,24 @@ export class Message extends React.PureComponent<Props, State> {
const remainingMinutes = Math.floor(duration / MINUTE); const remainingMinutes = Math.floor(duration / MINUTE);
if (remainingDays > 1) { if (remainingDays > 1) {
remaining = i18n('message--giftBadge--remaining--days', { remaining = i18n('icu:message--donation--remaining--days', {
days: remainingDays, days: remainingDays,
}); });
} else if (remainingHours > 1) { } else if (remainingHours > 1) {
remaining = i18n('message--giftBadge--remaining--hours', { remaining = i18n('icu:message--donation--remaining--hours', {
hours: remainingHours, hours: remainingHours,
}); });
} else if (remainingMinutes > 1) { } else if (remainingMinutes > 0) {
remaining = i18n('message--giftBadge--remaining--minutes', { remaining = i18n('icu:message--donation--remaining--minutes', {
minutes: remainingMinutes, minutes: remainingMinutes,
}); });
} else if (remainingMinutes === 1) {
remaining = i18n('message--giftBadge--remaining--one-minute');
} else { } else {
remaining = i18n('message--giftBadge--expired'); remaining = i18n('icu:message--donation--expired');
} }
const wasSent = direction === 'outgoing'; const wasSent = direction === 'outgoing';
const buttonContents = wasSent ? ( const buttonContents = wasSent ? (
i18n('message--giftBadge--view') i18n('icu:message--donation--view')
) : ( ) : (
<> <>
<span <span
@ -1330,7 +1330,7 @@ export class Message extends React.PureComponent<Props, State> {
`module-message__redeemed-gift-badge__icon-check--${direction}` `module-message__redeemed-gift-badge__icon-check--${direction}`
)} )}
/>{' '} />{' '}
{i18n('message--giftBadge--redeemed')} {i18n('icu:message--donation--redeemed')}
</> </>
); );
@ -1346,7 +1346,7 @@ export class Message extends React.PureComponent<Props, State> {
'module-message__redeemed-gift-badge__badge', 'module-message__redeemed-gift-badge__badge',
`module-message__redeemed-gift-badge__badge--missing-${direction}` `module-message__redeemed-gift-badge__badge--missing-${direction}`
)} )}
aria-label={i18n('giftBadge--missing')} aria-label={i18n('icu:donation--missing')}
/> />
); );
@ -1356,7 +1356,7 @@ export class Message extends React.PureComponent<Props, State> {
{badgeElement} {badgeElement}
<div className="module-message__redeemed-gift-badge__text"> <div className="module-message__redeemed-gift-badge__text">
<div className="module-message__redeemed-gift-badge__title"> <div className="module-message__redeemed-gift-badge__title">
{i18n('message--giftBadge')} {i18n('icu:message--donation')}
</div> </div>
<div <div
className={classNames( className={classNames(

View file

@ -393,7 +393,7 @@ export class Quote extends React.Component<Props, State> {
let typeLabel; let typeLabel;
if (isGiftBadge) { if (isGiftBadge) {
typeLabel = i18n('quote--giftBadge'); typeLabel = i18n('icu:quote--donation');
} else if (attachment) { } else if (attachment) {
const { contentType, isVoiceMessage } = attachment; const { contentType, isVoiceMessage } = attachment;
typeLabel = getTypeLabel({ typeLabel = getTypeLabel({

View file

@ -814,21 +814,29 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
const giftBadge = this.get('giftBadge'); const giftBadge = this.get('giftBadge');
if (giftBadge) { if (giftBadge) {
const emoji = '🎁'; const emoji = '✨';
const fromContact = getContact(this.attributes);
if (isOutgoing(this.attributes)) { if (isOutgoing(this.attributes)) {
const recipient =
fromContact?.getTitle() ?? window.i18n('unknownContact');
return { return {
emoji, emoji,
text: window.i18n('message--giftBadge--preview--sent'), text: window.i18n('icu:message--giftBadge--preview--sent', {
recipient,
}),
}; };
} }
const sender = fromContact?.getTitle() ?? window.i18n('unknownContact');
return { return {
emoji, emoji,
text: text:
giftBadge.state === GiftBadgeStates.Unopened giftBadge.state === GiftBadgeStates.Unopened
? window.i18n('message--giftBadge--preview--unopened') ? window.i18n('icu:message--giftBadge--preview--unopened', {
: window.i18n('message--giftBadge--preview--redeemed'), sender,
})
: window.i18n('icu:message--giftBadge--preview--redeemed'),
}; };
} }

View file

@ -1549,7 +1549,7 @@ describe('both/state/ducks/conversations', () => {
...changedMessage, ...changedMessage,
reactions: [ reactions: [
{ {
emoji: '🎁', emoji: '',
fromId: 'some-other-id', fromId: 'some-other-id',
timestamp: 2222, timestamp: 2222,
targetTimestamp: 1111, targetTimestamp: 1111,
@ -1580,7 +1580,7 @@ describe('both/state/ducks/conversations', () => {
...startState.messagesLookup[messageId], ...startState.messagesLookup[messageId],
reactions: [ reactions: [
{ {
emoji: '🎁', emoji: '',
fromId: 'some-other-id', fromId: 'some-other-id',
timestamp: 2222, timestamp: 2222,
targetTimestamp: 1111, targetTimestamp: 1111,