Use ICU number/plural formatting

This commit is contained in:
Jamie Kyle 2023-04-03 12:03:00 -07:00 committed by GitHub
parent aba8882d0a
commit da24cc5e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 254 additions and 222 deletions

View file

@ -100,7 +100,7 @@
"description": "(deleted 03/29/2023) Shown below the group name when selecting a group to invite a contact to"
},
"icu:GroupListItem__message-default": {
"messageformat": "{count} members",
"messageformat": "{count, plural, one {1 member} other {# members}}",
"description": "Shown below the group name when selecting a group to invite a contact to"
},
"GroupListItem__message-already-member": {
@ -768,7 +768,7 @@
"description": "(deleted 03/25/2023) Message shown on the loading screen when we're catching up on the backlog of messages"
},
"icu:loadingMessages--other": {
"messageformat": "Loading messages from {daysAgo} days ago...",
"messageformat": "Loading messages from {daysAgo, plural, one {1 day} other {# days}} ago...",
"description": "Message shown on the loading screen when we're catching up on the backlog of messages from day before yesterday and earlier"
},
"icu:loadingMessages--yesterday": {
@ -832,7 +832,7 @@
"description": "(deleted 03/29/2023) Text for unread message separator, with count"
},
"icu:unreadMessages": {
"messageformat": "{count} Unread Messages",
"messageformat": "{count, plural, one {1 Unread Message} other {# Unread Messages}}",
"description": "Text for unread message separator, with count"
},
"messageHistoryUnsynced": {
@ -1376,7 +1376,7 @@
"description": "An error popup when the user has attempted to add an attachment"
},
"icu:fileSizeWarning": {
"messageformat": "Sorry, the selected file exceeds message size restrictions. {limit}{units}",
"messageformat": "Sorry, the selected file exceeds message size restrictions. {limit, number}{units}",
"description": "Shown in a toast if the user tries to attach too-large file"
},
"unableToLoadAttachment": {
@ -3635,7 +3635,7 @@
"description": "(deleted 03/29/2023) Contracted form of 'X hours ago' which works both for singular and plural"
},
"icu:hoursAgo": {
"messageformat": "{hours}h",
"messageformat": "{hours, number}h",
"description": "Contracted form of 'X hours ago' which works both for singular and plural"
},
"minutesAgo": {
@ -3643,7 +3643,7 @@
"description": "(deleted 03/29/2023) Contracted form of 'X minutes ago' which works both for singular and plural"
},
"icu:minutesAgo": {
"messageformat": "{minutes}m",
"messageformat": "{minutes, number}m",
"description": "Contracted form of 'X minutes ago' which works both for singular and plural"
},
"justNow": {
@ -4107,7 +4107,7 @@
"description": "(deleted 03/29/2023) Shown in the alert when you add the maximum number of group members"
},
"icu:chooseGroupMembers__maximum-group-size__body": {
"messageformat": "Signal groups can have a maximum of {max} members.",
"messageformat": "Signal groups can have a maximum of {max, number} members.",
"description": "Shown in the alert when you add the maximum number of group members"
},
"chooseGroupMembers__maximum-recommended-group-size__title": {
@ -4123,7 +4123,7 @@
"description": "(deleted 03/29/2023) Shown in the alert when you add the maximum recommended number of group members"
},
"icu:chooseGroupMembers__maximum-recommended-group-size__body": {
"messageformat": "Signal groups perform best with {max} members or less. Adding more members will cause delays sending and receiving messages.",
"messageformat": "Signal groups perform best with {max, number} members or less. Adding more members will cause delays sending and receiving messages.",
"description": "Shown in the alert when you add the maximum recommended number of group members"
},
"setGroupMetadata__title": {
@ -4384,7 +4384,7 @@
"description": "(deleted 03/29/2023) Aria label for the conversation list item"
},
"icu:ConversationList__aria-label": {
"messageformat": "Conversation with {title}, {unreadCount} new messages, last message: {lastMessage}.",
"messageformat": "Conversation with {title}, {unreadCount, plural, one {1 new message} other {# new messages}}, last message: {lastMessage}.",
"description": "Aria label for the conversation list item"
},
"ConversationList__last-message-undefined": {
@ -4568,11 +4568,11 @@
"description": "Shown to label a donation badge you've replied to."
},
"icu:message--donation--remaining--days": {
"messageformat": "{days} days remaining",
"messageformat": "{days, plural, one {1 day} other {# days}} remaining",
"description": "Describes how long remains for the donation badge you've redeemed on another device (only rendered for days > 1)."
},
"icu:message--donation--remaining--hours": {
"messageformat": "{hours} hours remaining",
"messageformat": "{hours, plural, one {1 hour} other {# hours}} remaining",
"description": "Describes how long remains for the donation badge you've redeemed on another device (only rendered for hours > 1)"
},
"icu:message--donation--remaining--minutes": {
@ -6001,6 +6001,10 @@
},
"icu:MessageRequests--profile-sharing--group": {
"messageformat": "Continue your conversation with this group and share your name and photo with its members? {learnMore}",
"description": "(deleted 03/29/2023) Shown when user hasn't shared their profile in a group yet"
},
"icu:MessageRequests--profile-sharing--group--link": {
"messageformat": "Continue your conversation with this group and share your name and photo with its members? <learnMoreLink>Learn more.</learnMoreLink>",
"description": "Shown when user hasn't shared their profile in a group yet"
},
"MessageRequests--profile-sharing--direct": {
@ -6009,6 +6013,10 @@
},
"icu:MessageRequests--profile-sharing--direct": {
"messageformat": "Continue this conversation with {firstName} and share your name and photo with them? {learnMore}",
"description": "(deleted 03/29/2023) Shown when user hasn't shared their profile in a 1:1 conversation yet"
},
"icu:MessageRequests--profile-sharing--direct--link": {
"messageformat": "Continue this conversation with {firstName} and share your name and photo with them? <learnMoreLink>Learn more</learnMoreLink>",
"description": "Shown when user hasn't shared their profile in a 1:1 conversation yet"
},
"MessageRequests--learn-more": {
@ -6017,7 +6025,7 @@
},
"icu:MessageRequests--learn-more": {
"messageformat": "Learn more.",
"description": "Shown at the end of profile sharing messages as a link."
"description": "(deleted 03/29/2023) Shown at the end of profile sharing messages as a link."
},
"icu:ConversationHero--members": {
"messageformat": "{count, plural, one {1 member} other {# members}}",
@ -6060,7 +6068,7 @@
"description": "(deleted 03/29/2023) Shown in the conversation hero to indicate this user is a member of 5+ mutual groups."
},
"icu:member-of-more-than-3-groups--multiple-more": {
"messageformat": "Member of {group1}, {group2}, {group3} and {remainingCount} more",
"messageformat": "Member of {group1}, {group2}, {group3} and {remainingCount, number} more",
"description": "Shown in the conversation hero to indicate this user is a member of 5+ mutual groups."
},
"ConversationHero--membership-added": {
@ -6260,7 +6268,7 @@
"description": "(deleted 03/29/2023) Shown in the incoming call bar when someone is ringing you for a group call"
},
"icu:incomingGroupCall__ringing-many": {
"messageformat": "{ringer} is calling you, {first}, {second}, and {remaining} others",
"messageformat": "{ringer} is calling you, {first}, {second}, and {remaining, plural, one {1 other} other {# others}}",
"description": "Shown in the incoming call bar when someone is ringing you for a group call"
},
"outgoingCallRinging": {
@ -6380,7 +6388,7 @@
"description": "(deleted 03/29/2023) Tooltip in disabled notification button when the call is full"
},
"icu:calling__call-notification__button__call-full-tooltip": {
"messageformat": "Call has reached capacity of {max} participants",
"messageformat": "Call has reached capacity of {max, number} participants",
"description": "Tooltip in disabled notification button when the call is full"
},
"calling__pip--on": {
@ -6789,15 +6797,15 @@
},
"icu:GroupV2--join--member-count--single": {
"messageformat": "1 member",
"description": "Shown in the metadata section if group has just one member"
"description": "(deleted 03/29/2023) Shown in the metadata section if group has just one member"
},
"GroupV2--join--member-count--multiple": {
"message": "$count$ members",
"description": "(deleted 03/29/2023) Shown in the metadata section if group has more than one member"
},
"icu:GroupV2--join--member-count--multiple": {
"messageformat": "{count} members",
"description": "Shown in the metadata section if group has more than one member"
"messageformat": "{count, number} members",
"description": "(deleted 03/29/2023) Shown in the metadata section if group has more than one member"
},
"GroupV2--join--group-metadata": {
"message": "Group · $memberCount$",
@ -6805,6 +6813,10 @@
},
"icu:GroupV2--join--group-metadata": {
"messageformat": "Group · {memberCount}",
"description": "(deleted 03/29/2023) A holder for two pieces of information - the type of conversation, and the member count"
},
"icu:GroupV2--join--group-metadata--full": {
"messageformat": "Group · {memberCount, plural, one {1 member} other {# members}}",
"description": "A holder for two pieces of information - the type of conversation, and the member count"
},
"GroupV2--join--requested": {
@ -7476,7 +7488,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-add--many--other": {
"messageformat": "{memberName} invited {count} people to the group.",
"messageformat": "{memberName} invited {count, number} people to the group.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-add--many--you": {
@ -7484,7 +7496,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-add--many--you": {
"messageformat": "You invited {count} people to the group.",
"messageformat": "You invited {count, number} people to the group.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-add--many--unknown": {
@ -7492,7 +7504,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-add--many--unknown": {
"messageformat": "{count} people were invited to the group.",
"messageformat": "{count, number} people were invited to the group.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--decline--other": {
@ -7572,7 +7584,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke--many--other": {
"messageformat": "{memberName} revoked invitations to the group for {count} people.",
"messageformat": "{memberName} revoked invitations to the group for {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke--many--you": {
@ -7580,7 +7592,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke--many--you": {
"messageformat": "You revoked invitations to the group for {count} people.",
"messageformat": "You revoked invitations to the group for {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke--many--unknown": {
@ -7588,7 +7600,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke--many--unknown": {
"messageformat": "An admin revoked invitations to the group for {count} people.",
"messageformat": "An admin revoked invitations to the group for {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from--one--other": {
@ -7644,7 +7656,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from--many--other": {
"messageformat": "{adminName} revoked invitations to the group for {count} people invited by {memberName}.",
"messageformat": "{adminName} revoked invitations to the group for {count, number} people invited by {memberName}.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from--many--you": {
@ -7652,7 +7664,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from--many--you": {
"messageformat": "You revoked invitations to the group for {count} people invited by {memberName}.",
"messageformat": "You revoked invitations to the group for {count, number} people invited by {memberName}.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from--many--unknown": {
@ -7660,7 +7672,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from--many--unknown": {
"messageformat": "An admin revoked invitations to the group for {count} people invited by {memberName}.",
"messageformat": "An admin revoked invitations to the group for {count, number} people invited by {memberName}.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from-you--many--other": {
@ -7668,7 +7680,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from-you--many--other": {
"messageformat": "{adminName} revoked the invitations to the group you sent to {count} people.",
"messageformat": "{adminName} revoked the invitations to the group you sent to {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from-you--many--you": {
@ -7676,7 +7688,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from-you--many--you": {
"messageformat": "You rescinded your invitation to {count} people.",
"messageformat": "You rescinded your invitation to {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--pending-remove--revoke-invite-from-you--many--unknown": {
@ -7684,7 +7696,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--pending-remove--revoke-invite-from-you--many--unknown": {
"messageformat": "An admin revoked the invitations to the group you sent to {count} people.",
"messageformat": "An admin revoked the invitations to the group you sent to {count, number} people.",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--admin-approval-add-one--you": {
@ -7756,7 +7768,7 @@
"description": "(deleted 03/29/2023) Shown in timeline or conversation preview when v2 group changes"
},
"icu:GroupV2--admin-approval-bounce": {
"messageformat": "{joinerName} requested and cancelled {numberOfRequests} requests to join via the group link",
"messageformat": "{joinerName} requested and cancelled {numberOfRequests, number} requests to join via the group link",
"description": "Shown in timeline or conversation preview when v2 group changes"
},
"GroupV2--group-link-add--disabled--you": {
@ -7961,6 +7973,10 @@
},
"icu:GroupV1--Migration--disabled": {
"messageformat": "Upgrade this group to activate new features like @mentions and admins. Members who have not shared their name or photo in this group will be invited to join. {learnMore}",
"description": "(deleted 03/29/2023) Shown instead of composition area when user is forced to migrate a legacy group (GV1)."
},
"icu:GroupV1--Migration--disabled--link": {
"messageformat": "Upgrade this group to activate new features like @mentions and admins. Members who have not shared their name or photo in this group will be invited to join. <learnMoreLink>Learn more.</learnMoreLink>",
"description": "Shown instead of composition area when user is forced to migrate a legacy group (GV1)."
},
"GroupV1--Migration--was-upgraded": {
@ -8104,7 +8120,7 @@
"description": "(deleted 03/29/2023) Shown in timeline when a group is upgraded and some people were invited, instead of added"
},
"icu:GroupV1--Migration--invited--many": {
"messageformat": "{count} members couldnt be added to the New Group and have been invited to join.",
"messageformat": "{count, number} members couldnt be added to the New Group and have been invited to join.",
"description": "Shown in timeline when a group is upgraded and some people were invited, instead of added"
},
"GroupV1--Migration--removed--one": {
@ -8120,7 +8136,7 @@
"description": "(deleted 03/29/2023) Shown in timeline when a group is upgraded and some people were removed entirely during the upgrade"
},
"icu:GroupV1--Migration--removed--many": {
"messageformat": "{count} members were removed from the group.",
"messageformat": "{count, number} members were removed from the group.",
"description": "Shown in timeline when a group is upgraded and some people were removed entirely during the upgrade"
},
"close": {
@ -8528,7 +8544,7 @@
"description": "(deleted 03/29/2023) This is the number of members in a group"
},
"icu:ConversationDetailsHeader--members": {
"messageformat": "{number} members",
"messageformat": "{number, plural, one {1 member} other {# members}}",
"description": "This is the number of members in a group"
},
"ConversationDetailsMediaList--shared-media": {
@ -8552,7 +8568,7 @@
"description": "(deleted 03/29/2023) The title of the membership list panel"
},
"icu:ConversationDetailsMembershipList--title": {
"messageformat": "{number} members",
"messageformat": "{number, plural, one {1 member} other {# members}}",
"description": "The title of the membership list panel"
},
"ConversationDetailsMembershipList--add-members": {
@ -8680,7 +8696,7 @@
"description": "(deleted 03/29/2023) Label for the tab to view pending requests"
},
"icu:PendingInvites--tab-requests": {
"messageformat": "Requests ({count})",
"messageformat": "Requests ({count, number})",
"description": "Label for the tab to view pending requests"
},
"PendingInvites--tab-invites": {
@ -8688,7 +8704,7 @@
"description": "(deleted 03/29/2023) Label for the tab to view pending invites"
},
"icu:PendingInvites--tab-invites": {
"messageformat": "Invites ({count})",
"messageformat": "Invites ({count, number})",
"description": "Label for the tab to view pending invites"
},
"PendingRequests--approve-for": {
@ -8744,7 +8760,7 @@
"description": "(deleted 03/29/2023) This is the label for the number of members someone has invited"
},
"icu:PendingInvites--invited-count": {
"messageformat": "Invited {number}",
"messageformat": "Invited {number, number}",
"description": "This is the label for the number of members someone has invited"
},
"PendingInvites--revoke-for-label": {
@ -8769,14 +8785,18 @@
},
"icu:PendingInvites--revoke-from-singular": {
"messageformat": "Revoke 1 invite sent by \"{name}\"?",
"description": "This is the modal content when confirming revoking a single invite"
"description": "(deleted 03/29/2023) This is the modal content when confirming revoking a single invite"
},
"PendingInvites--revoke-from-plural": {
"message": "Revoke $number$ invites sent by \"$name$\"?",
"description": "(deleted 03/29/2023) This is the modal content when confirming revoking multiple invites"
},
"icu:PendingInvites--revoke-from-plural": {
"messageformat": "Revoke {number} invites sent by \"{name}\"?",
"messageformat": "Revoke {number, number} invites sent by \"{name}\"?",
"description": "(deleted 03/29/2023) This is the modal content when confirming revoking multiple invites"
},
"icu:PendingInvites--revoke-from": {
"messageformat": "Revoke {number, plural, one {1 invite} other {# invites}} sent by \"{name}\"?",
"description": "This is the modal content when confirming revoking multiple invites"
},
"PendingInvites--revoke": {
@ -8856,7 +8876,7 @@
"description": "conversation > in select mode > composition area actions > exit select mode > accessibility label"
},
"icu:SelectModeActions--selectedMessages": {
"messageformat": "{count} selected",
"messageformat": "{count, number} selected",
"description": "conversation > in select mode > composition area actions > count of selected messsages"
},
"icu:SelectModeActions--deleteSelectedMessages": {
@ -8957,14 +8977,18 @@
},
"icu:NewlyCreatedGroupInvitedContactsDialog--title--one": {
"messageformat": "Invitation sent",
"description": "When creating a new group and inviting users, this is shown in the dialog"
"description": "(deleted 03/29/2023) When creating a new group and inviting users, this is shown in the dialog"
},
"NewlyCreatedGroupInvitedContactsDialog--title--many": {
"message": "$count$ invitations sent",
"description": "(deleted 03/29/2023) When creating a new group and inviting users, this is shown in the dialog"
},
"icu:NewlyCreatedGroupInvitedContactsDialog--title--many": {
"messageformat": "{count} invitations sent",
"messageformat": "{count, number} invitations sent",
"description": "(deleted 03/29/2023) When creating a new group and inviting users, this is shown in the dialog"
},
"icu:NewlyCreatedGroupInvitedContactsDialog--title": {
"messageformat": "{count, plural, one {Invitation sent} other {# invitations sent}}",
"description": "When creating a new group and inviting users, this is shown in the dialog"
},
"NewlyCreatedGroupInvitedContactsDialog--body--user-paragraph--one": {
@ -9028,7 +9052,7 @@
"description": "(deleted 03/29/2023) When adding new members to an existing group, this is shown in the confirmation dialog"
},
"icu:AddGroupMembersModal--confirm-title--many": {
"messageformat": "Add {count} members to \"{group}\"?",
"messageformat": "Add {count, number} members to \"{group}\"?",
"description": "When adding new members to an existing group, this is shown in the confirmation dialog"
},
"AddGroupMembersModal--confirm-button--one": {
@ -9225,6 +9249,10 @@
},
"icu:ContactSpoofing__same-name": {
"messageformat": "Review requests carefully. Signal found another contact with the same name. {link}",
"description": "(deleted 03/29/2023) Shown in the timeline warning when you have a message request from someone with the same name as someone else"
},
"icu:ContactSpoofing__same-name--link": {
"messageformat": "Review requests carefully. Signal found another contact with the same name. <reviewRequestLink>Review request</reviewRequestLink>",
"description": "Shown in the timeline warning when you have a message request from someone with the same name as someone else"
},
"ContactSpoofing__same-name-in-group": {
@ -9232,7 +9260,11 @@
"description": "(deleted 03/29/2023) Shown in the timeline warning when you multiple group members have the same name"
},
"icu:ContactSpoofing__same-name-in-group": {
"messageformat": "{count} group members have the same name. {link}",
"messageformat": "{count, plural, one {1 group member} other {# group members}} have the same name. {link}",
"description": "Shown in the timeline warning when you multiple group members have the same name"
},
"icu:ContactSpoofing__same-name-in-group--link": {
"messageformat": "{count, plural, one {1 group member} other {# group members}} have the same name. <reviewRequestLink>Review request</reviewRequestLink>",
"description": "Shown in the timeline warning when you multiple group members have the same name"
},
"ContactSpoofing__same-name__link": {
@ -9241,7 +9273,7 @@
},
"icu:ContactSpoofing__same-name__link": {
"messageformat": "Review request",
"description": "Shown in the timeline warning when you have a message request from someone with the same name as someone else"
"description": "(deleted 03/29/2023) Shown in the timeline warning when you have a message request from someone with the same name as someone else"
},
"ContactSpoofing__same-name-in-group__link": {
"message": "Click to review",
@ -9296,7 +9328,7 @@
"description": "(deleted 03/29/2023) Description for the group contact spoofing review dialog"
},
"icu:ContactSpoofingReviewDialog__group__description": {
"messageformat": "{count} group members have similar names. Review the members below or choose to take action.",
"messageformat": "{count, plural, one {1 group member} other {# group members}} have similar names. Review the members below or choose to take action.",
"description": "Description for the group contact spoofing review dialog"
},
"ContactSpoofingReviewDialog__group__members-header": {
@ -9424,7 +9456,7 @@
"description": "(deleted 03/29/2023) Confirm message for deleting custom color"
},
"icu:ChatColorPicker__delete--message": {
"messageformat": "This custom color is used in {num} chats. Do you want to delete it for all chats?",
"messageformat": "This custom color is used in {num, plural, one {1 chat} other {# chats}}. Do you want to delete it for all chats?",
"description": "Confirm message for deleting custom color"
},
"ChatColorPicker__global-chat-color": {
@ -9888,7 +9920,7 @@
"description": "(deleted 03/29/2023) Shown if user has attempted to enter a username with too few characters - currently min is 3"
},
"icu:ProfileEditor--username--check-character-min": {
"messageformat": "Usernames must have a least {min} characters.",
"messageformat": "Usernames must have a least {min, number} characters.",
"description": "Shown if user has attempted to enter a username with too few characters - currently min is 3"
},
"ProfileEditor--username--check-character-max": {
@ -9896,7 +9928,7 @@
"description": "(deleted 03/29/2023) Shown if user has attempted to enter a username with too many characters - currently min is 25"
},
"icu:ProfileEditor--username--check-character-max": {
"messageformat": "Usernames must have at most {max} characters.",
"messageformat": "Usernames must have at most {max, number} characters.",
"description": "Shown if user has attempted to enter a username with too many characters - currently min is 25"
},
"ProfileEditor--username--unavailable": {
@ -10049,6 +10081,10 @@
},
"icu:ProfileEditor--info": {
"messageformat": "Your profile is encrypted. Your profile and changes to it will be visible to your contacts and when you start or accept new chats. {learnMore}",
"description": "(deleted 03/29/2023) Information shown at the bottom of the profile editor section"
},
"icu:ProfileEditor--info--link": {
"messageformat": "Your profile is encrypted. Your profile and changes to it will be visible to your contacts and when you start or accept new chats. <learnMoreLink>{learnMore}</learnMoreLink>",
"description": "Information shown at the bottom of the profile editor section"
},
"ProfileEditor--learnMore": {
@ -10312,15 +10348,19 @@
"description": "(deleted 03/29/2023) Number of contacts blocked singular"
},
"icu:Preferences--blocked-count-singular": {
"messageformat": "{num} contact",
"description": "Number of contacts blocked singular"
"messageformat": "{num, number} contact",
"description": "(deleted 03/29/2023) Number of contacts blocked singular"
},
"Preferences--blocked-count-plural": {
"message": "$num$ contacts",
"description": "(deleted 03/29/2023) Number of contacts blocked plural"
},
"icu:Preferences--blocked-count-plural": {
"messageformat": "{num} contacts",
"messageformat": "{num, number} contacts",
"description": "(deleted 03/29/2023) Number of contacts blocked plural"
},
"icu:Preferences--blocked-count": {
"messageformat": "{num, plural, one {1 contact} other {# contacts}}",
"description": "Number of contacts blocked plural"
},
"Preferences__privacy--description": {
@ -10848,21 +10888,25 @@
"description": "(deleted 03/29/2023) Number of views your story has"
},
"icu:MyStories__views--singular": {
"messageformat": "{num} view",
"description": "Number of views your story has"
"messageformat": "<strong>{viewCount, number}</strong> view",
"description": "(deleted 03/29/2023) Number of views your story has"
},
"MyStories__views--plural": {
"message": "$num$ views",
"description": "(deleted 03/29/2023) Number of views your story has"
},
"icu:MyStories__views--plural": {
"messageformat": "{num} views",
"description": "Number of views your story has"
"messageformat": "<strong>{viewCount, number}</strong> views",
"description": "(deleted 03/29/2023) Number of views your story has"
},
"icu:MyStories__views": {
"messageformat": "{views, plural, one {1 view} other {# views}}",
"description": "Number of views your story has"
},
"icu:MyStories__views--strong": {
"messageformat": "{views, plural, one {<strong>1</strong> view} other {<strong>#</strong> views}}",
"description": "Number of views your story has"
},
"icu:MyStories__views-off": {
"messageformat": "Views off",
"description": "Shown next to the user's story when the user has read receipts turned off"
@ -10872,15 +10916,19 @@
"description": "(deleted 03/29/2023) Number of replies your story has"
},
"icu:MyStories__replies--singular": {
"messageformat": "{num} reply",
"description": "Number of replies your story has"
"messageformat": "{num, number} reply",
"description": "(deleted 03/29/2023) Number of replies your story has"
},
"MyStories__replies--plural": {
"message": "$num$ replies",
"description": "(deleted 03/29/2023) Number of replies your story has"
},
"icu:MyStories__replies--plural": {
"messageformat": "{num} replies",
"messageformat": "{num, number} replies",
"description": "(deleted 03/29/2023) Number of replies your story has"
},
"icu:MyStories__replies": {
"messageformat": "{replyCount, plural, one {<strong>1</strong> reply} other {<strong>#</strong> replies}}",
"description": "Number of replies your story has"
},
"MyStories__delete": {
@ -11300,7 +11348,7 @@
"description": "(deleted 03/29/2023) Description of how many people are excluded in a list"
},
"icu:StoriesSettings__mine__exclude--description": {
"messageformat": "{num} people excluded",
"messageformat": "{num, number} people excluded",
"description": "Description of how many people are excluded in a list"
},
"StoriesSettings__mine__only--label": {
@ -11324,7 +11372,7 @@
"description": "(deleted 03/29/2023) Description of how many people are in the exclusive allow list"
},
"icu:StoriesSettings__mine__only--description--people": {
"messageformat": "{num} people",
"messageformat": "{num, number} people",
"description": "Description of how many people are in the exclusive allow list"
},
"StoriesSettings__mine__disclaimer": {
@ -11333,6 +11381,10 @@
},
"icu:StoriesSettings__mine__disclaimer": {
"messageformat": "Choose who can view your story. Changes won't affect stories you've already sent. {learnMore}",
"description": "(deleted 03/29/2023) Disclaimer on how changes to story settings work"
},
"icu:StoriesSettings__mine__disclaimer--link": {
"messageformat": "Choose who can view your story. Changes won't affect stories you've already sent. <learnMoreLink>Learn more.</learnMoreLink>",
"description": "Disclaimer on how changes to story settings work"
},
"StoriesSettings__mine__disclaimer--learn-more": {
@ -11341,7 +11393,7 @@
},
"icu:StoriesSettings__mine__disclaimer--learn-more": {
"messageformat": "Learn more.",
"description": "Learn more link to learn about who can view your story"
"description": "(deleted 03/29/2023) Learn more link to learn about who can view your story"
},
"StoriesSettings__context-menu": {
"message": "Story privacy",
@ -11505,6 +11557,10 @@
},
"icu:SendStoryModal__privacy-disclaimer": {
"messageformat": "Choose which Signal connections can view your story. You can always change this in privacy settings. {learnMore}",
"description": "(deleted 03/29/2023) Disclaimer on how changes to story settings work"
},
"icu:SendStoryModal__privacy-disclaimer--link": {
"messageformat": "Choose which Signal connections can view your story. You can always change this in privacy settings. <learnMoreLink>Learn more.</learnMoreLink>",
"description": "Disclaimer on how changes to story settings work"
},
"SendStoryModal__delete-story": {
@ -11856,7 +11912,7 @@
"description": "Error string for when a video post to story fails because video's duration is too long"
},
"icu:StoryCreator__error--video-too-big": {
"messageformat": "Cannot post video to story because it is larger than {limit}{units}.",
"messageformat": "Cannot post video to story because it is larger than {limit, number}{units}.",
"description": "Error string for when a video post to story fails because video's file size is too big"
},
"StoryCreator__error--video-error": {

View file

@ -38,7 +38,7 @@ export function AddGroupMemberErrorDialog(props: PropsType): JSX.Element {
const { maximumNumberOfContacts } = props;
title = i18n('icu:chooseGroupMembers__maximum-group-size__title');
body = i18n('icu:chooseGroupMembers__maximum-group-size__body', {
max: maximumNumberOfContacts.toString(),
max: maximumNumberOfContacts,
});
break;
}
@ -50,7 +50,7 @@ export function AddGroupMemberErrorDialog(props: PropsType): JSX.Element {
body = i18n(
'icu:chooseGroupMembers__maximum-recommended-group-size__body',
{
max: recommendedMaximumNumberOfContacts.toString(),
max: recommendedMaximumNumberOfContacts,
}
);
break;

View file

@ -349,7 +349,7 @@ function CustomColorBubble({
title={i18n('icu:ChatColorPicker__delete--title')}
>
{i18n('icu:ChatColorPicker__delete--message', {
num: String(confirmDeleteCount),
num: confirmDeleteCount,
})}
</ConfirmationDialog>
) : null}

View file

@ -360,7 +360,7 @@ export function ConversationList({
get(lastMessage, 'text') ||
i18n('icu:ConversationList__last-message-undefined'),
title,
unreadCount: String(unreadCount),
unreadCount,
})}
>
<ConversationListItem

View file

@ -49,12 +49,6 @@ export const GroupV2JoinDialog = React.memo(function GroupV2JoinDialogInner(
const joinString = approvalRequired
? i18n('icu:GroupV2--join--request-to-join-button')
: i18n('icu:GroupV2--join--join-button');
const memberString =
memberCount === 1
? i18n('icu:GroupV2--join--member-count--single')
: i18n('icu:GroupV2--join--member-count--multiple', {
count: memberCount.toString(),
});
const wrappedJoin = React.useCallback(() => {
setIsWorking(true);
@ -93,9 +87,7 @@ export const GroupV2JoinDialog = React.memo(function GroupV2JoinDialogInner(
</div>
<div className="module-group-v2-join-dialog__title">{title}</div>
<div className="module-group-v2-join-dialog__metadata">
{i18n('icu:GroupV2--join--group-metadata', {
memberCount: memberString,
})}
{i18n('icu:GroupV2--join--group-metadata--full', { memberCount })}
</div>
{groupDescription && (
<div className="module-group-v2-join-dialog__description">

View file

@ -150,7 +150,7 @@ function GroupCallMessage({
ringer: ringerNode,
first,
second,
remaining: String(otherMembersRung.length - 2),
remaining: otherMembersRung.length - 2,
}}
/>
);

View file

@ -27,12 +27,10 @@ export function NewlyCreatedGroupInvitedContactsDialog({
onClose,
theme,
}: PropsType): JSX.Element {
let title: string;
let body: ReactNode;
if (contacts.length === 1) {
const contact = contacts[0];
title = i18n('icu:NewlyCreatedGroupInvitedContactsDialog--title--one');
body = (
<>
<GroupDialog.Paragraph>
@ -50,9 +48,6 @@ export function NewlyCreatedGroupInvitedContactsDialog({
</>
);
} else {
title = i18n('icu:NewlyCreatedGroupInvitedContactsDialog--title--many', {
count: contacts.length.toString(),
});
body = (
<>
<GroupDialog.Paragraph>
@ -89,7 +84,9 @@ export function NewlyCreatedGroupInvitedContactsDialog({
);
}}
onClose={onClose}
title={title}
title={i18n('icu:NewlyCreatedGroupInvitedContactsDialog--title', {
count: contacts.length,
})}
>
{body}
</GroupDialog>

View file

@ -883,15 +883,9 @@ export function Preferences({
<SettingsRow>
<Control
left={i18n('icu:Preferences--blocked')}
right={
blockedCount === 1
? i18n('icu:Preferences--blocked-count-singular', {
num: String(blockedCount),
})
: i18n('icu:Preferences--blocked-count-plural', {
num: String(blockedCount || 0),
})
}
right={i18n('icu:Preferences--blocked-count', {
num: blockedCount,
})}
/>
</SettingsRow>
<SettingsRow title={i18n('icu:Preferences--messaging')}>

View file

@ -643,15 +643,17 @@ export function ProfileEditor({
<div className="ProfileEditor__info">
<Intl
i18n={i18n}
id="icu:ProfileEditor--info"
id="icu:ProfileEditor--info--link"
components={{
learnMore: (
// This is a render prop, not a component
// eslint-disable-next-line react/no-unstable-nested-components
learnMoreLink: parts => (
<a
href="https://support.signal.org/hc/en-us/articles/360007459591"
target="_blank"
rel="noreferrer"
>
{i18n('icu:ProfileEditor--learnMore')}
{parts}
</a>
),
}}

View file

@ -37,7 +37,7 @@ export function SharedGroupNames({
group1: firstThreeGroups[0],
group2: firstThreeGroups[1],
group3: firstThreeGroups[2],
remainingCount: remainingCount.toString(),
remainingCount,
}}
/>
);

View file

@ -816,28 +816,28 @@ export function EditMyStoryPrivacy({
toggleSignalConnectionsModal,
signalConnectionsCount,
}: EditMyStoryPrivacyPropsType): JSX.Element {
const learnMore = (
const learnMoreLink = (parts: Array<JSX.Element | string>) => (
<button
className="StoriesSettingsModal__disclaimer__learn-more"
onClick={toggleSignalConnectionsModal}
type="button"
>
{i18n('icu:StoriesSettings__mine__disclaimer--learn-more')}
{parts}
</button>
);
const disclaimerElement = (
<div className="StoriesSettingsModal__disclaimer">
{kind === 'mine' ? (
<Intl
components={{ learnMore }}
components={{ learnMoreLink }}
i18n={i18n}
id="icu:StoriesSettings__mine__disclaimer"
id="icu:StoriesSettings__mine__disclaimer--link"
/>
) : (
<Intl
components={{ learnMore }}
components={{ learnMoreLink }}
i18n={i18n}
id="icu:SendStoryModal__privacy-disclaimer"
id="icu:SendStoryModal__privacy-disclaimer--link"
/>
)}
</div>

View file

@ -54,6 +54,10 @@ import { useRetryStorySend } from '../hooks/useRetryStorySend';
import { resolveStorySendStatus } from '../util/resolveStorySendStatus';
import { strictAssert } from '../util/assert';
function renderStrong(parts: Array<JSX.Element | string>) {
return <strong>{parts}</strong>;
}
export type PropsType = {
currentIndex: number;
deleteGroupStoryReply: (id: string) => void;
@ -851,36 +855,21 @@ export function StoryViewer({
{isSent && !hasViewReceiptSetting && !replyCount && (
<>{i18n('icu:StoryViewer__views-off')}</>
)}
{isSent &&
hasViewReceiptSetting &&
(viewCount === 1 ? (
{isSent && hasViewReceiptSetting && (
<Intl
i18n={i18n}
id="icu:MyStories__views--singular"
components={{ num: <strong>{viewCount}</strong> }}
id="icu:MyStories__views--strong"
components={{ viewCount, strong: renderStrong }}
/>
) : (
<Intl
i18n={i18n}
id="icu:MyStories__views--plural"
components={{ num: <strong>{viewCount}</strong> }}
/>
))}
)}
{(isSent || viewCount > 0) && replyCount > 0 && ' '}
{replyCount > 0 &&
(replyCount === 1 ? (
{replyCount > 0 && (
<Intl
i18n={i18n}
id="icu:MyStories__replies--singular"
components={{ num: <strong>{replyCount}</strong> }}
id="icu:MyStories__replies"
components={{ replyCount, strong: renderStrong }}
/>
) : (
<Intl
i18n={i18n}
id="icu:MyStories__replies--plural"
components={{ num: <strong>{replyCount}</strong> }}
/>
))}
)}
</span>
) : null}
{!isSent && !replyCount && (

View file

@ -20,7 +20,7 @@ export default {
};
export const _ToastFileSize = (): JSX.Element => (
<ToastFileSize {...defaultProps} limit="100" units="MB" />
<ToastFileSize {...defaultProps} limit={100} units="MB" />
);
_ToastFileSize.story = {

View file

@ -6,7 +6,7 @@ import type { LocalizerType } from '../types/Util';
import { Toast } from './Toast';
export type ToastPropsType = {
limit: string;
limit: number;
units: string;
};

View file

@ -141,7 +141,7 @@ function renderCallingNotificationButton(
disabledTooltipText = i18n(
'icu:calling__call-notification__button__call-full-tooltip',
{
max: String(deviceCount),
max: deviceCount,
}
);
onClick = noop;

View file

@ -253,7 +253,7 @@ export function ContactSpoofingReviewDialog(props: PropsType): JSX.Element {
<>
<p>
{i18n('icu:ContactSpoofingReviewDialog__group__description', {
count: conversationInfos.length.toString(),
count: conversationInfos.length,
})}
</p>
<h2>

View file

@ -21,18 +21,22 @@ export function GroupV1DisabledActions({
<p className="module-group-v1-disabled-actions__message">
<Intl
i18n={i18n}
id="icu:GroupV1--Migration--disabled"
id="icu:GroupV1--Migration--disabled--link"
components={{
learnMore: (
// This is a render prop, not a component
// eslint-disable-next-line react/no-unstable-nested-components
learnMoreLink: (...parts) => {
return (
<a
href="https://support.signal.org/hc/articles/360007319331"
target="_blank"
rel="noreferrer"
className="module-group-v1-disabled-actions__message__learn-more"
>
{i18n('icu:MessageRequests--learn-more')}
{parts}
</a>
),
);
},
}}
/>
</p>

View file

@ -15,9 +15,7 @@ export const LastSeenIndicator = forwardRef<HTMLDivElement, Props>(
const message =
count === 1
? i18n('icu:unreadMessage')
: i18n('icu:unreadMessages', {
count: String(count),
});
: i18n('icu:unreadMessages', { count });
return (
<div className="module-last-seen-indicator" ref={ref}>

View file

@ -27,6 +27,17 @@ export type Props = {
| 'deleteConversation'
>;
const learnMoreLink = (parts: Array<JSX.Element | string>) => (
<a
href="https://support.signal.org/hc/articles/360007459591"
target="_blank"
rel="noreferrer"
className="module-message-request-actions__message__learn-more"
>
{parts}
</a>
);
export function MandatoryProfileSharingActions({
acceptConversation,
blockAndReportSpam,
@ -49,17 +60,6 @@ export function MandatoryProfileSharingActions({
</strong>
);
const learnMore = (
<a
href="https://support.signal.org/hc/articles/360007459591"
target="_blank"
rel="noreferrer"
className="module-message-request-actions__message__learn-more"
>
{i18n('icu:MessageRequests--learn-more')}
</a>
);
return (
<>
{mrState !== MessageRequestState.default ? (
@ -85,14 +85,14 @@ export function MandatoryProfileSharingActions({
{conversationType === 'direct' ? (
<Intl
i18n={i18n}
id="icu:MessageRequests--profile-sharing--direct"
components={{ firstName: firstNameContact, learnMore }}
id="icu:MessageRequests--profile-sharing--direct--link"
components={{ firstName: firstNameContact, learnMoreLink }}
/>
) : (
<Intl
i18n={i18n}
id="icu:MessageRequests--profile-sharing--group"
components={{ firstName: firstNameContact, learnMore }}
id="icu:MessageRequests--profile-sharing--group--link"
components={{ firstName: firstNameContact, learnMoreLink }}
/>
)}
</p>

View file

@ -905,9 +905,11 @@ export class Timeline extends React.Component<
text = (
<Intl
i18n={i18n}
id="icu:ContactSpoofing__same-name"
id="icu:ContactSpoofing__same-name--link"
components={{
link: (
// This is a render props, not a component
// eslint-disable-next-line react/no-unstable-nested-components
reviewRequestLink: parts => (
<TimelineWarning.Link
onClick={() => {
reviewMessageRequestNameCollision({
@ -915,7 +917,7 @@ export class Timeline extends React.Component<
});
}}
>
{i18n('icu:ContactSpoofing__same-name__link')}
{parts}
</TimelineWarning.Link>
),
}}
@ -932,21 +934,21 @@ export class Timeline extends React.Component<
text = (
<Intl
i18n={i18n}
id="icu:ContactSpoofing__same-name-in-group"
id="icu:ContactSpoofing__same-name-in-group--link"
components={{
count: Object.values(groupNameCollisions)
.reduce(
count: Object.values(groupNameCollisions).reduce(
(result, conversations) => result + conversations.length,
0
)
.toString(),
link: (
),
// This is a render props, not a component
// eslint-disable-next-line react/no-unstable-nested-components
reviewRequestLink: parts => (
<TimelineWarning.Link
onClick={() => {
reviewGroupMemberNameCollision(id);
}}
>
{i18n('icu:ContactSpoofing__same-name-in-group__link')}
{parts}
</TimelineWarning.Link>
),
}}

View file

@ -60,7 +60,7 @@ export function ConfirmAdditionsModal({
i18n={i18n}
id="icu:AddGroupMembersModal--confirm-title--many"
components={{
count: selectedContacts.length.toString(),
count: selectedContacts.length,
group: groupTitleNode,
}}
/>

View file

@ -67,7 +67,7 @@ export function ConversationDetailsHeader({
subtitle = i18n('icu:ConversationDetailsHeader--add-group-description');
} else {
subtitle = i18n('icu:ConversationDetailsHeader--members', {
number: memberships.length.toString(),
number: memberships.length,
});
}
} else if (!isMe) {

View file

@ -94,7 +94,7 @@ export function ConversationDetailsMembershipList({
return (
<PanelSection
title={i18n('icu:ConversationDetailsMembershipList--title', {
number: sortedMemberships.length.toString(),
number: sortedMemberships.length,
})}
>
{canAddNewMembers && (

View file

@ -108,7 +108,7 @@ export function PendingInvites({
tabIndex={0}
>
{i18n('icu:PendingInvites--tab-requests', {
count: String(pendingApprovalMemberships.length),
count: pendingApprovalMemberships.length,
})}
</div>
@ -129,7 +129,7 @@ export function PendingInvites({
tabIndex={0}
>
{i18n('icu:PendingInvites--tab-invites', {
count: String(pendingMemberships.length),
count: pendingMemberships.length,
})}
</div>
</div>
@ -325,12 +325,8 @@ function getConfirmationMessage({
const name = inviter.title;
if (stagedMemberships.length === 1) {
return i18n('icu:PendingInvites--revoke-from-singular', { name });
}
return i18n('icu:PendingInvites--revoke-from-plural', {
number: stagedMemberships.length.toString(),
return i18n('icu:PendingInvites--revoke-from', {
number: stagedMemberships.length,
name,
});
}
@ -505,7 +501,7 @@ function MembersPendingProfileKey({
}
label={member.title}
right={i18n('icu:PendingInvites--invited-count', {
number: pendingMemberships.length.toString(),
number: pendingMemberships.length,
})}
actions={
conversation.areWeAdmin ? (

View file

@ -14,7 +14,7 @@ export type SmartContactRendererType<T> = (uuid: UUIDStringType) => T | string;
export type StringRendererType<T> = (
id: string,
i18n: LocalizerType,
components?: ReplacementValuesType<T | string>
components?: ReplacementValuesType<T | string | number>
) => T | string;
export type RenderOptionsType<T> = {
@ -76,7 +76,10 @@ export function renderChangeDetail<T>(
renderString,
} = options;
function i18n(id: string, components?: ReplacementValuesType<T | string>) {
function i18n(
id: string,
components?: ReplacementValuesType<T | number | string>
) {
return renderString(id, localizer, components);
}
@ -530,17 +533,17 @@ export function renderChangeDetail<T>(
if (fromYou) {
return i18n('icu:GroupV2--pending-add--many--you', {
count: count.toString(),
count,
});
}
if (from) {
return i18n('icu:GroupV2--pending-add--many--other', {
memberName: renderContact(from),
count: count.toString(),
count,
});
}
return i18n('icu:GroupV2--pending-add--many--unknown', {
count: count.toString(),
count,
});
}
if (detail.type === 'pending-remove-one') {
@ -647,7 +650,7 @@ export function renderChangeDetail<T>(
return i18n(
'icu:GroupV2--pending-remove--revoke-invite-from-you--many--you',
{ count: count.toString() }
{ count }
);
}
if (from) {
@ -656,14 +659,14 @@ export function renderChangeDetail<T>(
{
adminName: renderContact(from),
count: count.toString(),
count,
}
);
}
return i18n(
'icu:GroupV2--pending-remove--revoke-invite-from-you--many--unknown',
{ count: count.toString() }
{ count }
);
}
if (inviter) {
@ -672,7 +675,7 @@ export function renderChangeDetail<T>(
'icu:GroupV2--pending-remove--revoke-invite-from--many--you',
{
count: count.toString(),
count,
memberName: renderContact(inviter),
}
);
@ -683,7 +686,7 @@ export function renderChangeDetail<T>(
{
adminName: renderContact(from),
count: count.toString(),
count,
memberName: renderContact(inviter),
}
);
@ -692,14 +695,14 @@ export function renderChangeDetail<T>(
'icu:GroupV2--pending-remove--revoke-invite-from--many--unknown',
{
count: count.toString(),
count,
memberName: renderContact(inviter),
}
);
}
if (fromYou) {
return i18n('icu:GroupV2--pending-remove--revoke--many--you', {
count: count.toString(),
count,
});
}
if (from) {
@ -708,14 +711,14 @@ export function renderChangeDetail<T>(
{
memberName: renderContact(from),
count: count.toString(),
count,
}
);
}
return i18n(
'icu:GroupV2--pending-remove--revoke--many--unknown',
{ count: count.toString() }
{ count }
);
}
if (detail.type === 'admin-approval-add-one') {
@ -784,7 +787,7 @@ export function renderChangeDetail<T>(
} else {
firstMessage = i18n('icu:GroupV2--admin-approval-bounce', {
joinerName: renderContact(uuid),
numberOfRequests: String(times),
numberOfRequests: times,
});
}

View file

@ -510,7 +510,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
renderString: (
key: string,
_i18n: unknown,
components: ReplacementValuesType<string> | undefined
components: ReplacementValuesType<string | number> | undefined
) => {
// eslint-disable-next-line local-rules/valid-i18n-keys
return window.i18n(key, components);

View file

@ -518,11 +518,8 @@ async function getGroupPreview(
const title =
window.Signal.Groups.decryptGroupTitle(result.title, secretParams) ||
window.i18n('icu:unknownGroup');
const description =
result.memberCount === 1 || result.memberCount === undefined
? window.i18n('icu:GroupV2--join--member-count--single')
: window.i18n('icu:GroupV2--join--member-count--multiple', {
count: result.memberCount.toString(),
const description = window.i18n('icu:GroupV2--join--group-metadata--full', {
count: result?.memberCount ?? 0,
});
let image: undefined | LinkPreviewImage;

View file

@ -38,13 +38,11 @@ describe('setupI18n', () => {
);
});
it('returns a modern icu message formatted', () => {
const actual = i18n('icu:ProfileEditor--info', {
learnMore: 'LEARN MORE',
});
assert.equal(
actual,
'Your profile is encrypted. Your profile and changes to it will be visible to your contacts and when you start or accept new chats. LEARN MORE'
const actual = i18n(
'icu:AddUserToAnotherGroupModal__toast--adding-user-to-group',
{ contact: 'CONTACT' }
);
assert.equal(actual, 'Adding CONTACT...');
});
});
@ -72,7 +70,11 @@ describe('setupI18n', () => {
describe('isLegacyFormat', () => {
it('returns false for new format', () => {
assert.isFalse(i18n.isLegacyFormat('icu:ProfileEditor--info'));
assert.isFalse(
i18n.isLegacyFormat(
'icu:AddUserToAnotherGroupModal__toast--adding-user-to-group'
)
);
assert.isTrue(i18n.isLegacyFormat('softwareAcknowledgments'));
});
});

View file

@ -28,7 +28,7 @@ export const getMaximumAttachmentSizeInKb = (
};
export function getRenderDetailsForLimit(limitKb: number): {
limit: string;
limit: number;
units: string;
} {
const units = ['kB', 'MB', 'GB'];
@ -40,7 +40,7 @@ export function getRenderDetailsForLimit(limitKb: number): {
} while (limit >= KIBIBYTE && u < units.length - 1);
return {
limit: limit.toFixed(0),
limit: Math.trunc(limit),
units: units[u],
};
}

View file

@ -166,13 +166,13 @@ export function formatTime(
if (diff < HOUR) {
return i18n('icu:minutesAgo', {
minutes: Math.floor(diff / MINUTE).toString(),
minutes: Math.floor(diff / MINUTE),
});
}
if (isRelativeTime) {
return i18n('icu:hoursAgo', {
hours: Math.floor(diff / HOUR).toString(),
hours: Math.floor(diff / HOUR),
});
}