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:
Humdinger 2019-07-15 10:15:30 +02:00 committed by waddlesplash
parent c383ef3240
commit 729709ba87

View File

@ -161,11 +161,12 @@ WorkStatusView::_SetTextDownloading(const BString& title)
text.ReplaceFirst("%name%", title); text.ReplaceFirst("%name%", title);
if (!fPendingPackages.empty()) { if (!fPendingPackages.empty()) {
BString count; BString more;
count << fPendingPackages.size(); static BStringFormat format(B_TRANSLATE("{0, plural,"
BString more(" "); "one{(1 more to download)}"
more += B_TRANSLATE("(%count% more to download)"); "other{(# more to download)}}"));
more.ReplaceFirst("%count%", count); format.Format(more, fPendingPackages.size());
text += " ";
text += more; text += more;
} }
SetText(text); SetText(text);