mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 12:15:50 +01:00
Fix pluralization of strings.
This commit is contained in:
@@ -891,12 +891,12 @@ public final class ConversationUpdateItem extends FrameLayout
|
|||||||
|
|
||||||
private @NonNull String getCollapsibleString(CollapsibleEvents.CollapsibleType type) {
|
private @NonNull String getCollapsibleString(CollapsibleEvents.CollapsibleType type) {
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case CALL_EVENT -> getContext().getString(R.string.CollapsedEvent__call_event, conversationMessage.getCollapsedSize());
|
case CALL_EVENT -> getContext().getResources().getQuantityString(R.plurals.CollapsedEvent__call_event, conversationMessage.getCollapsedSize(), conversationMessage.getCollapsedSize());
|
||||||
case DISAPPEARING_TIMER -> {
|
case DISAPPEARING_TIMER -> {
|
||||||
String time = ExpirationUtil.getExpirationAbbreviatedDisplayValue(getContext(), (int) (conversationMessage.getCollapsedExpirationInMs() / 1000));
|
String time = ExpirationUtil.getExpirationAbbreviatedDisplayValue(getContext(), (int) (conversationMessage.getCollapsedExpirationInMs() / 1000));
|
||||||
yield getContext().getString(R.string.CollapsedEvent__disappearing_timer, conversationMessage.getCollapsedSize(), time) ;
|
yield getContext().getResources().getQuantityString(R.plurals.CollapsedEvent__disappearing_timer, conversationMessage.getCollapsedSize(), conversationMessage.getCollapsedSize(), time) ;
|
||||||
}
|
}
|
||||||
case CHAT_UPDATE -> getContext().getString(conversationRecipient.isGroup() ? R.string.CollapsedEvent__group_update : R.string.CollapsedEvent__chat_update, conversationMessage.getCollapsedSize());
|
case CHAT_UPDATE -> getContext().getResources().getQuantityString(conversationRecipient.isGroup() ? R.plurals.CollapsedEvent__group_update : R.plurals.CollapsedEvent__chat_update, conversationMessage.getCollapsedSize(), conversationMessage.getCollapsedSize());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class ConversationBannerView @JvmOverloads constructor(
|
|||||||
setBannerRecipients(requestReviewState.individualReviewState.target, requestReviewState.individualReviewState.firstDuplicate)
|
setBannerRecipients(requestReviewState.individualReviewState.target, requestReviewState.individualReviewState.firstDuplicate)
|
||||||
setOnClickListener { listener?.onRequestReviewIndividual(requestReviewState.individualReviewState.target.id) }
|
setOnClickListener { listener?.onRequestReviewIndividual(requestReviewState.individualReviewState.target.id) }
|
||||||
} else if (requestReviewState.groupReviewState != null) {
|
} else if (requestReviewState.groupReviewState != null) {
|
||||||
setBannerMessage(context.getString(R.string.ConversationFragment__d_group_members_have_the_same_name, requestReviewState.groupReviewState.count))
|
setBannerMessage(context.resources.getQuantityString(R.plurals.ConversationFragment__d_group_members_have_the_same_name, requestReviewState.groupReviewState.count, requestReviewState.groupReviewState.count))
|
||||||
setBannerRecipients(requestReviewState.groupReviewState.target, requestReviewState.groupReviewState.firstDuplicate)
|
setBannerRecipients(requestReviewState.groupReviewState.target, requestReviewState.groupReviewState.firstDuplicate)
|
||||||
setOnClickListener { listener?.onReviewGroupMembers(requestReviewState.groupReviewState.groupId) }
|
setOnClickListener { listener?.onReviewGroupMembers(requestReviewState.groupReviewState.groupId) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -659,7 +659,11 @@
|
|||||||
<string name="ConversationFragment_view_once_media_is_deleted_after_sending">View-once media is deleted after sending</string>
|
<string name="ConversationFragment_view_once_media_is_deleted_after_sending">View-once media is deleted after sending</string>
|
||||||
<string name="ConversationFragment_you_already_viewed_this_message">You already viewed this message</string>
|
<string name="ConversationFragment_you_already_viewed_this_message">You already viewed this message</string>
|
||||||
<string name="ConversationFragment__you_can_add_notes_for_yourself_in_this_conversation">You can add notes for yourself in this chat. If your account has any linked devices, new notes will be synced.</string>
|
<string name="ConversationFragment__you_can_add_notes_for_yourself_in_this_conversation">You can add notes for yourself in this chat. If your account has any linked devices, new notes will be synced.</string>
|
||||||
<string name="ConversationFragment__d_group_members_have_the_same_name">%1$d group members have the same name.</string>
|
<!-- Text in banner to show how many people have the same name. -->
|
||||||
|
<plurals name="ConversationFragment__d_group_members_have_the_same_name">
|
||||||
|
<item quantity="one">%1$d group member have the same name.</item>
|
||||||
|
<item quantity="other">%1$d group members have the same name.</item>
|
||||||
|
</plurals>
|
||||||
<string name="ConversationFragment__tap_to_review">Tap to review</string>
|
<string name="ConversationFragment__tap_to_review">Tap to review</string>
|
||||||
<!-- The body of a banner that can show up at the top of a chat, letting the user know that you have two contacts with the same name -->
|
<!-- The body of a banner that can show up at the top of a chat, letting the user know that you have two contacts with the same name -->
|
||||||
<string name="ConversationFragment__review_banner_body">This person has the same name as another contact</string>
|
<string name="ConversationFragment__review_banner_body">This person has the same name as another contact</string>
|
||||||
@@ -3695,13 +3699,25 @@
|
|||||||
<!-- Update item button text shown for a profile name change. -->
|
<!-- Update item button text shown for a profile name change. -->
|
||||||
<string name="ConversationUpdateItem_update">Update</string>
|
<string name="ConversationUpdateItem_update">Update</string>
|
||||||
<!-- Update item button text to show how many group updates there are. -->
|
<!-- Update item button text to show how many group updates there are. -->
|
||||||
<string name="CollapsedEvent__group_update">%1$d group updates</string>
|
<plurals name="CollapsedEvent__group_update">
|
||||||
|
<item quantity="one">%1$d group update</item>
|
||||||
|
<item quantity="other">%1$d group updates</item>
|
||||||
|
</plurals>
|
||||||
<!-- Update item button text to show how many group updates there are. -->
|
<!-- Update item button text to show how many group updates there are. -->
|
||||||
<string name="CollapsedEvent__chat_update">%1$d chat updates</string>
|
<plurals name="CollapsedEvent__chat_update">
|
||||||
|
<item quantity="one">%1$d chat update</item>
|
||||||
|
<item quantity="other">%1$d chat updates</item>
|
||||||
|
</plurals>
|
||||||
<!-- Update item button text to show how many disappearing message timer changes are. %2$s is what the timer was ultimately set to.-->
|
<!-- Update item button text to show how many disappearing message timer changes are. %2$s is what the timer was ultimately set to.-->
|
||||||
<string name="CollapsedEvent__disappearing_timer">%1$d disappearing message timer changes · %2$s</string>
|
<plurals name="CollapsedEvent__disappearing_timer">
|
||||||
|
<item quantity="one">%1$d disappearing message timer change · %2$s</item>
|
||||||
|
<item quantity="other">%1$d disappearing message timer changes · %2$s</item>
|
||||||
|
</plurals>
|
||||||
<!-- Update item button text to show how many call events are. -->
|
<!-- Update item button text to show how many call events are. -->
|
||||||
<string name="CollapsedEvent__call_event">%1$d call events</string>
|
<plurals name="CollapsedEvent__call_event">
|
||||||
|
<item quantity="one">%1$d call event</item>
|
||||||
|
<item quantity="other">%1$d call events</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
<!-- audio_view -->
|
<!-- audio_view -->
|
||||||
<string name="audio_view__play_pause_accessibility_description">Play … Pause</string>
|
<string name="audio_view__play_pause_accessibility_description">Play … Pause</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user