diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt index eab1969d50df..35ecfdd3d9de 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt @@ -2385,7 +2385,7 @@ open class DeckPicker : } val count = databaseResult.cardsWithFixedHomeDeckCount if (count != 0) { - val message = resources.getString(R.string.integrity_check_fixed_no_home_deck, count) + val message = resources.getQuantityString(R.plurals.integrity_check_fixed_no_home_deck_new, count, count) showThemedToast(this@DeckPicker, message, false) } val msg: String diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/Sync.kt b/AnkiDroid/src/main/java/com/ichi2/anki/Sync.kt index 8c41a06cab86..60438b4e5fae 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/Sync.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/Sync.kt @@ -554,8 +554,9 @@ fun DeckPicker.createSyncListener(isFetchingMedia: Boolean) = object : Connectio dialogMessage = when { diff >= 86100 -> { // The difference if more than a day minus 5 minutes acceptable by ankiweb error - res.getString( - R.string.sync_log_clocks_unsynchronized, + res.getQuantityString( + R.plurals.sync_log_clocks_unsynchronized_new, + diff.toInt(), diff, res.getString(R.string.sync_log_clocks_unsynchronized_date) ) @@ -563,14 +564,15 @@ fun DeckPicker.createSyncListener(isFetchingMedia: Boolean) = object : Connectio abs(diff % 3600.0 - 1800.0) >= 1500.0 -> { // The difference would be within limit if we adjusted the time by few hours // It doesn't work for all timezones, but it covers most and it's a guess anyway - res.getString( - R.string.sync_log_clocks_unsynchronized, + res.getQuantityString( + R.plurals.sync_log_clocks_unsynchronized_new, + diff.toInt(), diff, res.getString(R.string.sync_log_clocks_unsynchronized_tz) ) } else -> { - res.getString(R.string.sync_log_clocks_unsynchronized, diff, "") + res.getQuantityString(R.plurals.sync_log_clocks_unsynchronized_new, diff.toInt(), diff, "") } } showSyncErrorMessage( diff --git a/AnkiDroid/src/main/java/com/ichi2/async/Connection.kt b/AnkiDroid/src/main/java/com/ichi2/async/Connection.kt index 2b227df5ef38..c40e65604ac0 100644 --- a/AnkiDroid/src/main/java/com/ichi2/async/Connection.kt +++ b/AnkiDroid/src/main/java/com/ichi2/async/Connection.kt @@ -407,7 +407,9 @@ class Connection : BaseAsyncTask() mediaError = if (downloadedCount == 0 && uploadedCount == 0) { "${AnkiDroidApp.appResources.getString(R.string.sync_media_error)}\n\n${e.localizedMessage}" } else { - "${AnkiDroidApp.appResources.getString(R.string.sync_media_partial_updated,downloadedCount,uploadedCount)}\n\n${e.localizedMessage}" + "${AnkiDroidApp.appResources.getQuantityString(R.plurals.sync_media_partial_downloaded_files,downloadedCount, downloadedCount)}\n" + + "${AnkiDroidApp.appResources.getQuantityString(R.plurals.sync_media_partial_uploaded_files,uploadedCount, uploadedCount)}\n" + + "\n${e.localizedMessage}" } } } diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/sync/MediaSyncer.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/sync/MediaSyncer.kt index 9abf3a6ab001..aebc5cdeec9f 100644 --- a/AnkiDroid/src/main/java/com/ichi2/libanki/sync/MediaSyncer.kt +++ b/AnkiDroid/src/main/java/com/ichi2/libanki/sync/MediaSyncer.kt @@ -178,8 +178,11 @@ class MediaSyncer( } con.publishProgress( String.format( - AnkiDroidApp.appResources.getString(R.string.sync_media_changes_count), - toSend + AnkiDroidApp.appResources.getQuantityString( + R.plurals.sync_media_changes_count_new, + toSend, + toSend + ) ) ) val changes = server.uploadChanges(zip) @@ -246,8 +249,11 @@ class MediaSyncer( } con.publishProgress( String.format( - AnkiDroidApp.appResources.getString(R.string.sync_media_downloaded_count), - mDownloadCount + AnkiDroidApp.appResources.getQuantityString( + R.plurals.sync_media_downloaded_count_new, + mDownloadCount, + mDownloadCount + ) ) ) } catch (e: IOException) { diff --git a/AnkiDroid/src/main/res/values/03-dialogs.xml b/AnkiDroid/src/main/res/values/03-dialogs.xml index d793b704f30a..7ef578855bc8 100644 --- a/AnkiDroid/src/main/res/values/03-dialogs.xml +++ b/AnkiDroid/src/main/res/values/03-dialogs.xml @@ -173,7 +173,10 @@ Continue Anyway Check Database uses a large amount of temporary storage.\n\nIt is strongly recommended that you have at least %s free space on your device before continuing. \n\nYou currently have %s free. - %d cards with incorrect home decks were recovered. Please see the manual for more information. + + %d card with incorrect home deck was recovered. Please see the manual for more information. + %d cards with incorrect home decks were recovered. Please see the manual for more information. + Could not play video diff --git a/AnkiDroid/src/main/res/values/04-network.xml b/AnkiDroid/src/main/res/values/04-network.xml index 79d1b99e41da..813b1549abd8 100644 --- a/AnkiDroid/src/main/res/values/04-network.xml +++ b/AnkiDroid/src/main/res/values/04-network.xml @@ -53,7 +53,10 @@ Downloading… Synchronization Full sync from local - Your clock’s off by %1$d seconds%2$s. Make sure that the date, time, and timezone on your phone are set correctly, then sync again. + + Your clock is off by %1$d second%2$s. Make sure that the date, time, and timezone on your phone are set correctly, then sync again. + Your clock is off by %1$d seconds%2$s. Make sure that the date, time, and timezone on your phone are set correctly, then sync again. + , the time zone’s possibly wrong , the date’s possibly wrong No changes found @@ -80,9 +83,22 @@ Finding changed media… No changes to media files Media synced - Media sync partially completed:\n%1$d media files downloaded.\n%2$d media files uploaded. - %d media changes to upload - %d media files downloaded + + Media sync partially completed:\n%d media file downloaded. + Media sync partially completed:\n%d media files downloaded. + + + %d media file uploaded. + %d media files uploaded. + + + %d media change to upload + %d media changes to upload + + + %d media file downloaded + %d media files downloaded + After syncing, the collection was in an inconsistent state. To fix this problem, AnkiDroid will force a full sync. Choose which side you would like to keep. Media sync completed, but the media count doesn’t agree with the server. The next media sync will be full to correct any error. Media sync failed because current database is corrupt. A media check is recommended.