[haiku-commits] r40557 - haiku/trunk/src/apps/powerstatus

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 19 Feb 2011 12:42:58 +0100 (CET)

Author: siarzhuk
Date: 2011-02-19 12:42:58 +0100 (Sat, 19 Feb 2011)
New Revision: 40557
Changeset: http://dev.haiku-os.org/changeset/40557
Ticket: http://dev.haiku-os.org/ticket/7237

Modified:
   haiku/trunk/src/apps/powerstatus/ACPIDriverInterface.cpp
   haiku/trunk/src/apps/powerstatus/PowerStatusView.cpp
Log:
Yet another localization patch made by Jorma Karvonen.
Fixes #7237.

Notes: 
1) proposed in original patch localization of the 
Deskbar item name I found a bad idea so it is rejected;
2) I have additionally removed translation for console
messages visible only in terminal. They are purposed 
mainly for debugging and are not visible to the user
in usual usage conditions;
3) Translation of the name of settings file also was 
removed as common localization practice.



Modified: haiku/trunk/src/apps/powerstatus/ACPIDriverInterface.cpp
===================================================================
--- haiku/trunk/src/apps/powerstatus/ACPIDriverInterface.cpp    2011-02-19 
11:28:07 UTC (rev 40556)
+++ haiku/trunk/src/apps/powerstatus/ACPIDriverInterface.cpp    2011-02-19 
11:42:58 UTC (rev 40557)
@@ -12,16 +12,11 @@
 #include <stdio.h>
 
 #include <Autolock.h>
-#include <Catalog.h>
 #include <Directory.h>
 #include <Entry.h>
 #include <Path.h>
 
 
-#undef B_TRANSLATE_CONTEXT
-#define B_TRANSLATE_CONTEXT "PowerStatus"
-
-
 RateBuffer::RateBuffer()
        :
        fPosition(0),
@@ -143,7 +138,7 @@
        if (fInitStatus != B_OK)
                return;
 
-       printf(B_TRANSLATE("ACPI driver found\n"));
+       printf("ACPI driver found\n");
 
 }
 
@@ -162,7 +157,7 @@
 status_t
 ACPIDriverInterface::Connect()
 {
-       printf(B_TRANSLATE("ACPI connect\n"));
+       printf("ACPI connect\n");
        return _FindDrivers(kDriverDir);
 }
 
@@ -245,7 +240,7 @@
                else {
                        int32 handler = open(path.Path(), O_RDWR);
                        if (handler >= 0) {
-                               printf(B_TRANSLATE("try %s\n"), path.Path());
+                               printf("try %s\n", path.Path());
                                Battery* battery = new Battery(handler);
                                if (battery->InitCheck() == B_OK) {
                                        fDriverList.AddItem(battery);

Modified: haiku/trunk/src/apps/powerstatus/PowerStatusView.cpp
===================================================================
--- haiku/trunk/src/apps/powerstatus/PowerStatusView.cpp        2011-02-19 
11:28:07 UTC (rev 40556)
+++ haiku/trunk/src/apps/powerstatus/PowerStatusView.cpp        2011-02-19 
11:42:58 UTC (rev 40557)
@@ -42,6 +42,7 @@
 
 
 extern "C" _EXPORT BView *instantiate_deskbar_item(void);
+extern const char* kDeskbarItemName;
 
 const uint32 kMsgToggleLabel = 'tglb';
 const uint32 kMsgToggleTime = 'tgtm';
@@ -51,7 +52,6 @@
 const uint32 kMinIconWidth = 16;
 const uint32 kMinIconHeight = 16;
 
-
 PowerStatusView::PowerStatusView(PowerStatusDriverInterface* interface,
                BRect frame, int32 resizingMode,  int batteryID, bool inDeskbar)
        :
@@ -609,7 +609,7 @@
 void
 PowerStatusReplicant::_AboutRequested()
 {
-       BAlert* alert = new BAlert(B_TRANSLATE("about"),
+       BAlert* alert = new BAlert(B_TRANSLATE("About"),
                B_TRANSLATE("PowerStatus\n"
                        "written by Axel Dörfler, Clemens Zeidler\n"
                        "Copyright 2006, Haiku, Inc.\n"), B_TRANSLATE("OK"));
@@ -621,7 +621,7 @@
        view->GetFont(&font);
        font.SetSize(18);
        font.SetFace(B_BOLD_FACE);
-       view->SetFontAndColor(0, 11, &font);
+       view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus"))-1, &font);
 
        alert->Go();
 }
@@ -635,7 +635,7 @@
                delete fDriverInterface;
                fDriverInterface = new APMDriverInterface;
                if (fDriverInterface->Connect() != B_OK) {
-                       fprintf(stderr, B_TRANSLATE("No power interface 
found.\n"));
+                       fprintf(stderr, "No power interface found.\n");
                        _Quit();
                }
        }
@@ -668,7 +668,7 @@
        if (status != B_OK)
                return status;
 
-       path.Append(B_TRANSLATE("PowerStatus settings"));
+       path.Append("PowerStatus settings");
 
        return file.SetTo(path.Path(), mode);
 }


Other related posts:

  • » [haiku-commits] r40557 - haiku/trunk/src/apps/powerstatus - zharik