Fixed plural strings text

This commit is contained in:
Jay 2020-01-12 13:17:06 -08:00
parent b1ae3629fd
commit cbd2118b3e
6 changed files with 17 additions and 9 deletions

View File

@ -380,7 +380,8 @@ class BackupRestoreService : Service() {
.toString(), errors.size.toString()))
val sourceMissingCount = sourcesMissing.distinct().size
if (sourceMissingCount > 0)
content.add(resources.getQuantityString(R.plurals.sources_missing, sourceMissingCount))
content.add(resources.getQuantityString(R.plurals.sources_missing,
sourceMissingCount, sourceMissingCount))
if (lincensedManga > 0)
content.add(getString(R.string.x_licensed_manga, lincensedManga))
val trackingErrors = trackingErrors.distinct()

View File

@ -533,8 +533,9 @@ class LibraryUpdateService(
setContentTitle(getString(R.string.notification_new_chapters))
color = ContextCompat.getColor(applicationContext, R.color.colorAccentLight)
if (updates.size > 1) {
setContentText(resources.getQuantityText(R.plurals.notification_new_chapters_text,
updates.size))
setContentText(resources.getQuantityString(R.plurals
.notification_new_chapters_text,
updates.size, updates.size))
setStyle(NotificationCompat.BigTextStyle().bigText(updates.joinToString("\n") {
it.first.title.chop(45)
}))

View File

@ -33,8 +33,9 @@ class ExtensionUpdateJob : Job() {
notify(Notifications.ID_UPDATES_TO_EXTS,
context.notification(Notifications.CHANNEL_UPDATES_TO_EXTS) {
setContentTitle(
context.resources.getQuantityText(
R.plurals.update_check_notification_ext_updates, names.size
context.resources.getQuantityString(
R.plurals.update_check_notification_ext_updates, names
.size, names.size
)
)
val extNames = if (names.size > 5) {

View File

@ -96,7 +96,8 @@ class SettingsAdvancedController : SettingsController() {
}, {
activity?.toast(R.string.cache_delete_error)
}, {
activity?.toast(resources?.getQuantityString(R.plurals.cache_deleted, deletedFiles))
activity?.toast(resources?.getQuantityString(R.plurals.cache_deleted,
deletedFiles, deletedFiles))
findPreference(CLEAR_CACHE_KEY)?.summary =
resources?.getString(R.string.used_cache, chapterCache.readableSize)
})

View File

@ -121,7 +121,8 @@ class SettingsGeneralController : SettingsController() {
when (it) {
"0" -> context.getString(R.string.lock_always)
"-1" -> context.getString(R.string.lock_never)
else -> context.getString(R.string.lock_after_mins, it)
else -> resources?.getQuantityString(R.plurals.lock_after_mins, it.toInt(),
it)
}
}.toTypedArray()
entryValues = values

View File

@ -188,7 +188,10 @@
<string name="lock_when_idle">Lock when idle</string>
<string name="lock_always">Always</string>
<string name="lock_never">Never</string>
<string name="lock_after_mins">After %1$s minutes</string>
<plurals name="lock_after_mins">
<item quantity="one">After %1$s minutes</item>
<item quantity="other">After %1$s minutes</item>
</plurals>
<string name="search_hint">Search title, tags, source</string>
<string name="pref_refresh_covers_too">Automatically refresh covers</string>
<string name="pref_refresh_covers_too_summary">Refresh covers in library as well
@ -578,7 +581,7 @@
<string name="update_check_notification_download_error">Download error</string>
<string name="update_check_notification_update_available">Update available</string>
<plurals name="update_check_notification_ext_updates">
<item quantity="one">%d extension update available</item>
<item quantity="one">Extension update available</item>
<item quantity="other">%d extension updates available</item>
</plurals>