Cleanup plurals format

Change <one> to <1> in string res file
Test: Update, existing tests still pass
bug: 199230342

Change-Id: Ic3a5259570cb52cd1664638f3b1058c87a631c04
This commit is contained in:
xinghailu
2022-12-27 12:12:11 +08:00
parent 6f77562412
commit 1637a3a10a
30 changed files with 235 additions and 210 deletions

View File

@@ -177,12 +177,14 @@ class AppNotificationRepository(
fun calculateFrequencySummary(sentCount: Int): String {
val dailyFrequency = (sentCount.toFloat() / DAYS_TO_CHECK).roundToInt()
return if (dailyFrequency > 0) {
context.resources.getQuantityString(
R.plurals.notifications_sent_daily, dailyFrequency, dailyFrequency
context.formatString(
R.string.notifications_sent_daily,
"count" to dailyFrequency,
)
} else {
context.resources.getQuantityString(
R.plurals.notifications_sent_weekly, sentCount, sentCount
context.formatString(
R.string.notifications_sent_weekly,
"count" to sentCount,
)
}
}