[haiku-commits] haiku: hrev53573 - src/add-ons/screen_savers/glife

  • From: humdinger <humdingerb@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 4 Nov 2019 11:47:54 -0500 (EST)

hrev53573 adds 1 changeset to branch 'master'
old head: 8fd4412d889b3a58525b0ade6b572ee04f1c2366
new head: 715a29f47d9365b5aaf388a8723876521171dc59
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=715a29f47d93+%5E8fd4412d889b

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

715a29f47d93: GLife: fix 'Grid life delay' slider label
  
  Also, sentence case all labels.
  
  Change-Id: I5c7869581eec220f5d4fb67073d914245e9b5ffd
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1928
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

                                        [ Humdinger <humdingerb@xxxxxxxxx> ]

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

Revision:    hrev53573
Commit:      715a29f47d9365b5aaf388a8723876521171dc59
URL:         https://git.haiku-os.org/haiku/commit/?id=715a29f47d93
Author:      Humdinger <humdingerb@xxxxxxxxx>
Date:        Thu Oct 31 07:11:28 2019 UTC
Committer:   humdinger <humdingerb@xxxxxxxxx>
Commit-Date: Mon Nov  4 16:47:49 2019 UTC

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

1 file changed, 15 insertions(+), 16 deletions(-)
src/add-ons/screen_savers/glife/GLifeConfig.cpp | 31 ++++++++++-----------

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

diff --git a/src/add-ons/screen_savers/glife/GLifeConfig.cpp 
b/src/add-ons/screen_savers/glife/GLifeConfig.cpp
index 7dcf4701af..3e4654cd6c 100644
--- a/src/add-ons/screen_savers/glife/GLifeConfig.cpp
+++ b/src/add-ons/screen_savers/glife/GLifeConfig.cpp
@@ -42,7 +42,7 @@ GLifeConfig::GLifeConfig(BRect frame, GLifeState* pglsState)
 
        // Sliders
        fGridDelay = new BSlider(frame, "GridDelay",
-               B_TRANSLATE("Grid Life Delay: "),
+               B_TRANSLATE("Grid life delay: "),
                new BMessage(kGridDelay),
                0, 4, B_BLOCK_THUMB);
 
@@ -53,7 +53,7 @@ GLifeConfig::GLifeConfig(BRect frame, GLifeState* pglsState)
        fGridDelay->SetHashMarkCount(5);
 
        fGridBorder = new BSlider(frame, "GridBorder",
-               B_TRANSLATE("Grid Border: "),
+               B_TRANSLATE("Grid border: "),
                new BMessage(kGridBorder),
                0, 10, B_BLOCK_THUMB);
 
@@ -63,7 +63,7 @@ GLifeConfig::GLifeConfig(BRect frame, GLifeState* pglsState)
        fGridBorder->SetHashMarkCount(11);
 
        fGridWidth = new BSlider(frame, "GridWidth",
-               B_TRANSLATE("Grid Width: "),
+               B_TRANSLATE("Grid width: "),
                new BMessage(kGridWidth),
                10, 100, B_BLOCK_THUMB);
 
@@ -73,7 +73,7 @@ GLifeConfig::GLifeConfig(BRect frame, GLifeState* pglsState)
        fGridWidth->SetHashMarkCount(10);
 
        fGridHeight = new BSlider(frame, "GridHeight",
-               B_TRANSLATE("Grid Height: "),
+               B_TRANSLATE("Grid height: "),
                new BMessage(kGridHeight),
                10, 100, B_BLOCK_THUMB);
 
@@ -126,25 +126,24 @@ void
 GLifeConfig::_UpdateLabels()
 {
        BString newLabel;
-       newLabel.SetToFormat(B_TRANSLATE("Grid Width: %li"), 
fGridWidth->Value());
+       newLabel.SetToFormat(B_TRANSLATE("Grid width: %li"), 
fGridWidth->Value());
        fGridWidth->SetLabel(newLabel);
 
-       newLabel.SetToFormat(B_TRANSLATE("Grid Height: %li"), 
fGridHeight->Value());
+       newLabel.SetToFormat(B_TRANSLATE("Grid height: %li"), 
fGridHeight->Value());
        fGridHeight->SetLabel(newLabel);
 
-       newLabel.SetToFormat(B_TRANSLATE("Grid Border: %li"), 
fGridBorder->Value());
+       newLabel.SetToFormat(B_TRANSLATE("Grid border: %li"), 
fGridBorder->Value());
        fGridBorder->SetLabel(newLabel);
-
-       BString delay;
-       if (fGridDelay->Value() <= 0)
-               delay = B_TRANSLATE("none");
+
+       int32 delay = fGridDelay->Value();
+       if (delay <= 0)
+               newLabel = B_TRANSLATE("Grid life delay: none");
        else {
-               BString format = (B_TRANSLATE_CONTEXT("Grid Life Delay: 
<number>x",
-                       "This is a factor: the x represents 'times'"));
-               format.ReplaceAll("<number>", B_PRId32);
-               format.SetToFormat(format.String(), fGridDelay->Value());
+               newLabel.SetToFormat(B_TRANSLATE_CONTEXT("Grid life delay: "
+                       "%" B_PRId32 "x", "This is a factor: the x represents 
'times', "
+                       "don't translate '%" B_PRId32"'"), delay);
        }
-       fGridDelay->SetLabel(delay);
+       fGridDelay->SetLabel(newLabel);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev53573 - src/add-ons/screen_savers/glife - humdinger