mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-01 22:31:51 -04:00
Be more explicit in quantity
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]
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -->
|
||||
<string name="deleteTitle">Delete Card</string>
|
||||
<string name="deleteTitle">Delete card</string>
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="one">Delete Card</item>
|
||||
<item quantity="other">Delete Cards</item>
|
||||
<item quantity="one">Delete <xliff:g>%d</xliff:g> card</item>
|
||||
<item quantity="other">Delete <xliff:g>%d</xliff:g> cards</item>
|
||||
</plurals>
|
||||
<string name="deleteConfirmation">Delete this card permanently?</string>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
|
||||
Reference in New Issue
Block a user