[haiku-commits] r40558 - haiku/trunk/src/apps/processcontroller

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 19 Feb 2011 14:32:39 +0100 (CET)

Author: siarzhuk
Date: 2011-02-19 14:32:39 +0100 (Sat, 19 Feb 2011)
New Revision: 40558
Changeset: http://dev.haiku-os.org/changeset/40558
Ticket: http://dev.haiku-os.org/ticket/7238

Modified:
   haiku/trunk/src/apps/processcontroller/Preferences.cpp
   haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp
   haiku/trunk/src/apps/processcontroller/ProcessController.cpp
Log:
Yet another localization patch made by Jorma Karvonen.
Fixes #7238

Notes on patch:
1) Localization of internal Deskbar item name and kClassName rejected;

Additional fixes by S.Zharski:
1) BLocker's internal name localization removed;
2) A bit more safe snprintf used instead of sprintf;
3) Localization of field names in 'PrTh' message removed;
4) Localization of calling "db" debugger removed. The thread debugging command
"db %d" replaced with "gdb -pid=%d".



Modified: haiku/trunk/src/apps/processcontroller/Preferences.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/Preferences.cpp      2011-02-19 
11:42:58 UTC (rev 40557)
+++ haiku/trunk/src/apps/processcontroller/Preferences.cpp      2011-02-19 
13:32:39 UTC (rev 40558)
@@ -38,7 +38,7 @@
 #define B_TRANSLATE_CONTEXT "ProcessController"
 
 Preferences::Preferences(const char* name, const char* signature, bool doSave)
-       : BMessage('Pref'), BLocker(B_TRANSLATE("Preferences"), true),
+       : BMessage('Pref'), BLocker("Preferences", true),
        fSavePreferences(doSave)
 {
        fNewPreferences = false;
@@ -65,7 +65,7 @@
 
 
 Preferences::Preferences(const entry_ref &ref, const char* signature, bool 
doSave)
-       : BMessage('Pref'), BLocker(B_TRANSLATE("Preferences"), true),
+       : BMessage('Pref'), BLocker("Preferences", true),
        fSavePreferences(doSave)
 {
        fSettingsFile = new entry_ref(ref);
@@ -108,13 +108,14 @@
                        }
                } else {
                        // implement saving somewhere else!
-                       char error[1024];
-                       sprintf(error, B_TRANSLATE("Your setting file"
-                       "could not be saved!\n(%s)"),
+                       BString error;
+                       snprintf(error.LockBuffer(256), 256,
+                               B_TRANSLATE("Your setting file could not be 
saved!\n(%s)"),
                                strerror(file.InitCheck()));
-                       BAlert *alert = new BAlert(B_TRANSLATE("Error saving 
file"), error,
-                               B_TRANSLATE("Damned!"), NULL, NULL, 
B_WIDTH_AS_USUAL,
-                               B_STOP_ALERT);
+                       error.UnlockBuffer();
+                       BAlert *alert = new BAlert(B_TRANSLATE("Error saving 
file"),
+                               error.String(), B_TRANSLATE("Damned!"), NULL, 
NULL,
+                               B_WIDTH_AS_USUAL, B_STOP_ALERT);
                        alert->Go();
                }
        }

Modified: haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp     2011-02-19 
11:42:58 UTC (rev 40557)
+++ haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp     2011-02-19 
13:32:39 UTC (rev 40558)
@@ -89,8 +89,8 @@
                        index--;
                }
                message = new BMessage('PrTh');
-               message->AddInt32(B_TRANSLATE("thread"), fThreadID);
-               message->AddInt32(B_TRANSLATE("priority"), priority->priority);
+               message->AddInt32("thread", fThreadID);
+               message->AddInt32("priority", priority->priority);
                sprintf(name, B_TRANSLATE("%s priority [%d]"), priority->name, 
(int)priority->priority);
                item = new BMenuItem(name, message);
                item->SetTarget(gPCView);

Modified: haiku/trunk/src/apps/processcontroller/ProcessController.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/ProcessController.cpp        
2011-02-19 11:42:58 UTC (rev 40557)
+++ haiku/trunk/src/apps/processcontroller/ProcessController.cpp        
2011-02-19 13:32:39 UTC (rev 40558)
@@ -398,7 +398,7 @@
 void
 ProcessController::AboutRequested()
 {
-       BAlert *alert = new BAlert(B_TRANSLATE("about"),
+       BAlert *alert = new BAlert(B_TRANSLATE("About"),
                B_TRANSLATE("ProcessController\n\n"
                                        "Copyright 1997-2001,\n"
                                        "Georges-Edouard Berenger.\n\n"
@@ -412,7 +412,7 @@
        view->GetFont(&font);
        font.SetSize(font.Size() * 1.5);
        font.SetFace(B_BOLD_FACE);
-       view->SetFontAndColor(0, 17, &font);
+       view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController"))-1, 
&font);
 
        alert->Go();
 }
@@ -803,7 +803,7 @@
        thread_info     thinfo;
        get_thread_info(param->thread, &thinfo);
        char text[4096];
-       sprintf(text, B_TRANSLATE("db %d"), int(param->thread));
+       sprintf(text, "gdb -pid=%d", int(param->thread));
        system(text);
        if (param->sem >= 0 && thinfo.state == B_THREAD_WAITING && param->sem
                        == thinfo.sem) {


Other related posts: