mirror of
https://github.com/gitnex-org/gitnex.git
synced 2026-07-16 01:50:11 -05:00
Improve string by adding plurals
This commit is contained in:
@@ -163,7 +163,8 @@ public class UserAccountsAdapter extends RecyclerView.Adapter<UserAccountsAdapte
|
||||
|
||||
assert notificationCount != null;
|
||||
if(notificationCount.getNew() > 0) {
|
||||
new Handler().postDelayed(() -> Toasty.info(context, context.getString(R.string.youHaveNewNotifications, String.valueOf(notificationCount.getNew()))), 5000);
|
||||
String toastMsg = context.getResources().getQuantityString(R.plurals.youHaveNewNotifications, Math.toIntExact(notificationCount.getNew()), Math.toIntExact(notificationCount.getNew()));
|
||||
new Handler().postDelayed(() -> Toasty.info(context, toastMsg), 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,7 +653,10 @@
|
||||
<string name="mainNotificationChannelName">Notifications</string>
|
||||
<string name="mainNotificationChannelDescription">This is the main notification channel of GitNex.</string>
|
||||
<string name="notificationExtraInfo" translatable="false">- %s (%s)</string>
|
||||
<string name="youHaveNewNotifications">You have %s notification(s).</string>
|
||||
<plurals name="youHaveNewNotifications">
|
||||
<item quantity="one">You have %s new notification.</item>
|
||||
<item quantity="other">You have %s new notifications.</item>
|
||||
</plurals>
|
||||
|
||||
<string name="isRead">Read</string>
|
||||
<string name="isUnread">Unread</string>
|
||||
|
||||
Reference in New Issue
Block a user