[haiku-commits] haiku: hrev53258 - src/apps/haikudepot/ui

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 15 Jul 2019 20:25:57 -0400 (EDT)

hrev53258 adds 1 changeset to branch 'master'
old head: c383ef32402d4460cec146de3a9995862ef1a9d9
new head: 729709ba879d1ab77d756f5b2a219d405e6a7053
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=729709ba879d+%5Ec383ef32402d

----------------------------------------------------------------------------

729709ba879d: 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@xxxxxxxxx>

                                        [ Humdinger <humdingerb@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53258
Commit:      729709ba879d1ab77d756f5b2a219d405e6a7053
URL:         https://git.haiku-os.org/haiku/commit/?id=729709ba879d
Author:      Humdinger <humdingerb@xxxxxxxxx>
Date:        Mon Jul 15 08:15:30 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Jul 16 00:25:53 2019 UTC

----------------------------------------------------------------------------

1 file changed, 7 insertions(+), 6 deletions(-)
src/apps/haikudepot/ui/WorkStatusView.cpp | 13 +++++++------

----------------------------------------------------------------------------

diff --git a/src/apps/haikudepot/ui/WorkStatusView.cpp 
b/src/apps/haikudepot/ui/WorkStatusView.cpp
index 87b0376f3e..7e5ade2039 100644
--- a/src/apps/haikudepot/ui/WorkStatusView.cpp
+++ b/src/apps/haikudepot/ui/WorkStatusView.cpp
@@ -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);


Other related posts:

  • » [haiku-commits] haiku: hrev53258 - src/apps/haikudepot/ui - waddlesplash