Skip to content

Commit

Permalink
Use string quantities
Browse files Browse the repository at this point in the history
Signed-off-by: ZetaTom <[email protected]>
  • Loading branch information
ZetaTom committed Jan 15, 2025
1 parent a8c1ee5 commit 2874746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void bind(OCShare publicShare, ShareeListAdapterListener listener) {

if (downloadLimit.getLimit() > 0) {
int remaining = downloadLimit.getLimit() - downloadLimit.getCount();
String text = String.format(context.getString(R.string.share_download_limit_description), remaining);
String text = context.getResources().getQuantityString(R.plurals.share_download_limit_description, remaining, remaining);

binding.subline.setText(text);
binding.subline.setVisibility(View.VISIBLE);
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1305,5 +1305,8 @@
<string name="click_to_learn_how_to_re_enable_auto_uploads">Manual intervention required to re-enable auto-upload</string>
<string name="share_download_limit">Set download limit</string>
<string name="download_limit">Download limit</string>
<string name="share_download_limit_description">%1$d downloads remaining</string>
<plurals name="share_download_limit_description">
<item quantity="one">%1$d download remaining</item>
<item quantity="other">%1$d downloads remaining</item>
</plurals>
</resources>

0 comments on commit 2874746

Please sign in to comment.