Skip to content

Commit

Permalink
handle plurals correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan676 committed May 12, 2015
1 parent bf51693 commit 49995f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@
<string name="notification_download_started_title">Downloading files&#8230;</string>
<string name="notification_upload_completed">Upload completed</string>
<plurals name="notification_upload_info">
<item quantity="one">Uploading %1$d file (%2$d%%)</item>
<item quantity="other">Uploading %1$d files (%2$d%%)</item>
<item quantity="one">Uploading <xliff:g id="uploading_file">%1$d</xliff:g> file (%2$d%%)</item>
<item quantity="other">Uploading <xliff:g id="uploading_file">%1$d</xliff:g> files (%2$d%%)</item>
</plurals>
<plurals name="notification_download_info">
<item quantity="one">Downloading %1$d file (%2$d%%)</item>
<item quantity="other">Downloading %1$d files (%2$d%%)</item>
<item quantity="one">Downloading <xliff:g id="downloading_file">%1$d</xliff:g> file (%2$d%%)</item>
<item quantity="other">Downloading <xliff:g id="downloading_file">%1$d</xliff:g> files (%2$d%%)</item>
</plurals>
<string name="notification_download_completed">Download completed</string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ else if (getState().equals(NotificationState.NOTIFICATION_STATE_PROGRESS)) {
downloadingCount++;
}
if (downloadingCount != 0)
progressStatus = String.format(SeadroidApplication.getAppContext().getResources().
getQuantityString(R.plurals.notification_download_info, downloadingCount),
downloadingCount,
getFinishedSize() * 100 / totalSize);
progressStatus = SeadroidApplication.getAppContext().getResources().
getQuantityString(R.plurals.notification_download_info,
downloadingCount,
downloadingCount,
getFinishedSize() * 100 / totalSize);
}
return progressStatus;
}
Expand Down

0 comments on commit 49995f9

Please sign in to comment.