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".



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40558 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski 2011-02-19 13:32:39 +00:00
parent dc15e113e4
commit 3440db0cce
3 changed files with 14 additions and 13 deletions

View File

@ -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 char* name, const char* signature, bool doSave)
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 @@ Preferences::~Preferences()
}
} 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();
}
}

View File

@ -89,8 +89,8 @@ PriorityMenu::BuildMenu()
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);

View File

@ -398,7 +398,7 @@ ProcessController::MessageReceived(BMessage *message)
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 @@ ProcessController::AboutRequested()
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_debug_thread(void *arg)
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) {