From aa515b119279d67979472a4ec62f5762a5e67b9b Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 1 Aug 2021 12:50:56 +0200 Subject: [PATCH] Be more explicit in quantity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translators still keep triggering the linter with errors such as the following: Error: The quantity 'one' matches more than one specific number in this locale (1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …), but the message did not include a formatting argument (such as %d). This is usually an internationalization error. See full issue explanation for more. [ImpliedQuantity] --- app/src/main/java/protect/card_locker/MainActivity.java | 2 +- app/src/main/res/values/strings.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/protect/card_locker/MainActivity.java b/app/src/main/java/protect/card_locker/MainActivity.java index a23469dcd..5c5c4f5cc 100644 --- a/app/src/main/java/protect/card_locker/MainActivity.java +++ b/app/src/main/java/protect/card_locker/MainActivity.java @@ -125,7 +125,7 @@ public class MainActivity extends AppCompatActivity implements LoyaltyCardCursor builder.setTitle(R.string.deleteTitle); builder.setMessage(R.string.deleteConfirmation); } else { - builder.setTitle(getResources().getQuantityString(R.plurals.deleteCardsTitle, mAdapter.getSelectedItemCount())); + builder.setTitle(getResources().getQuantityString(R.plurals.deleteCardsTitle, mAdapter.getSelectedItemCount(), mAdapter.getSelectedItemCount())); builder.setMessage(getResources().getQuantityString(R.plurals.deleteCardsConfirmation, mAdapter.getSelectedItemCount(), mAdapter.getSelectedItemCount())); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 632f34212..9978506fc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,10 +34,10 @@ For example, in Russian, Android's plural quantity "one" actually refers to "any number ending on 1 but not ending in 11". So while in English the extra non-plural form seems unnecessary duplication, it is necessary to give translators enough flexibility. In Catima, we use the plain string when meaning exactly 1, and otherwise use the plural forms --> - Delete Card + Delete card - Delete Card - Delete Cards + Delete %d card + Delete %d cards Delete this card permanently?