Another use of BMessageFormat for plural support.
Spotted by Diver. Thanks!
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <Autolock.h>
|
#include <Autolock.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <MessageFormat.h>
|
||||||
#include <ScrollBar.h>
|
#include <ScrollBar.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
@@ -396,7 +397,6 @@ PackageColumn::CompareFields(BField* field1, BField* field2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float
|
float
|
||||||
PackageColumn::GetPreferredWidth(BField *_field, BView* parent) const
|
PackageColumn::GetPreferredWidth(BField *_field, BView* parent) const
|
||||||
{
|
{
|
||||||
@@ -610,10 +610,8 @@ private:
|
|||||||
BString _GetLabel() const
|
BString _GetLabel() const
|
||||||
{
|
{
|
||||||
BString label;
|
BString label;
|
||||||
if (fItemCount == 1)
|
BMessageFormat().Format(label, B_TRANSLATE("{0, plural, one{# item} "
|
||||||
label = B_TRANSLATE("1 item");
|
"other{# items}}"), fItemCount);
|
||||||
else
|
|
||||||
label.SetToFormat(B_TRANSLATE("%ld items"), fItemCount);
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user