HaikuDepot: Improved translatability using BStringFormat
The string "(%count% more to download)" is sensitive to different plural forms in other languages. For example, in German one could have: "1 weiterer Download" and "12 weitere Downloads" Change-Id: I3ab98cca6ae5066f7558e9ce22c97b6c37ec4a9c Reviewed-on: https://review.haiku-os.org/c/1593 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
c383ef3240
commit
729709ba87
@ -146,7 +146,7 @@ WorkStatusView::_SetTextPendingDownloads()
|
||||
{
|
||||
BString text;
|
||||
static BStringFormat format(B_TRANSLATE("{0, plural,"
|
||||
"one{1 package to download}"
|
||||
"one{1 package to download}"
|
||||
"other{# packages to download}}"));
|
||||
format.Format(text, fPendingPackages.size());
|
||||
|
||||
@ -161,11 +161,12 @@ WorkStatusView::_SetTextDownloading(const BString& title)
|
||||
text.ReplaceFirst("%name%", title);
|
||||
|
||||
if (!fPendingPackages.empty()) {
|
||||
BString count;
|
||||
count << fPendingPackages.size();
|
||||
BString more(" ");
|
||||
more += B_TRANSLATE("(%count% more to download)");
|
||||
more.ReplaceFirst("%count%", count);
|
||||
BString more;
|
||||
static BStringFormat format(B_TRANSLATE("{0, plural,"
|
||||
"one{(1 more to download)}"
|
||||
"other{(# more to download)}}"));
|
||||
format.Format(more, fPendingPackages.size());
|
||||
text += " ";
|
||||
text += more;
|
||||
}
|
||||
SetText(text);
|
||||
|
Loading…
Reference in New Issue
Block a user