Partially applying localization patch prepared by Jorma Karvonen.

Fixes #7350. Thanks.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40909 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski 2011-03-10 22:25:29 +00:00
parent a0a9cb5c21
commit 80cdaa81fd
8 changed files with 41 additions and 33 deletions

View File

@ -29,11 +29,14 @@ DoCatalogs ProcessController :
x-vnd.Haiku-ProcessController
:
KernelMemoryBarMenuItem.cpp
MemoryBarMenu.cpp
MemoryBarMenuItem.cpp
NoiseBarMenuItem.cpp
PCWorld.cpp
Preferences.cpp
PriorityMenu.cpp
ProcessController.cpp
;
AddCatalogEntryAttribute ProcessController
:
x-vnd.Haiku-ProcessController:PCWindow:ProcessController
;

View File

@ -24,7 +24,6 @@
#include "ProcessController.h"
#include <Bitmap.h>
#include <Catalog.h>
#include <Roster.h>
#include <StringForSize.h>
#include <Window.h>
@ -36,9 +35,6 @@
float gMemoryTextWidth;
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo)
: BMenu(name),

View File

@ -25,14 +25,10 @@
#include "ProcessController.h"
#include <Bitmap.h>
#include <Catalog.h>
#include <StringForSize.h>
#include <stdio.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team,
BBitmap* icon, bool deleteIcon, BMessage* message)

View File

@ -86,7 +86,7 @@ PCApplication::ReadyToRun()
BDeskbar deskbar;
if (!deskbar.HasItem(kDeskbarItemName)) {
// We're not yet installed in the Deskbar, ask if we should
BAlert* alert = new BAlert("",
BAlert* alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("You can run ProcessController in a window"
" or install it in the Deskbar."), B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"),
@ -101,7 +101,7 @@ PCApplication::ReadyToRun()
return;
}
} else {
BAlert* alert = new BAlert("",
BAlert* alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("ProcessController is already installed in Deskbar."),
B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);

View File

@ -116,6 +116,8 @@ Preferences::~Preferences()
BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"),
error.String(), B_TRANSLATE("Damned!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
}

View File

@ -93,7 +93,7 @@ PriorityMenu::BuildMenu()
BString name;
const size_t size = B_OS_NAME_LENGTH * 4;
snprintf(name.LockBuffer(size), size,
B_TRANSLATE("%s [%d]"), priority->name, (int)priority->priority);
"%s [%d]", priority->name, (int)priority->priority);
name.UnlockBuffer();
item = new BMenuItem(name.String(), message);
item->SetTarget(gPCView);

View File

@ -268,17 +268,18 @@ ProcessController::MessageReceived(BMessage *message)
snprintf(question, sizeof(question),
B_TRANSLATE("Do you really want to kill the team \"%s\"?"),
infos.team_name);
alert = new BAlert("", question,
alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Cancel"), B_TRANSLATE("Yes, kill this team!"),
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go())
kill_team(team);
} else {
alert = new BAlert("", B_TRANSLATE("This team is already "
"gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL,
alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
}
@ -292,18 +293,18 @@ ProcessController::MessageReceived(BMessage *message)
snprintf(question, sizeof(question),
B_TRANSLATE("What do you want to do "
"with the thread \"%s\"?"), thinfo.name);
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
B_TRANSLATE("Debug this thread!"),
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
B_STOP_ALERT);
alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"),
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
B_STOP_ALERT);
#define KILL 2
#else
snprintf(question, sizeof(question),
B_TRANSLATE("Are you sure you want "
"to kill the thread \"%s\"?"), thinfo.name);
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT);
alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"),
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
#define KILL 1
#endif
alert->SetShortcut(0, B_ESCAPE);
@ -324,9 +325,11 @@ ProcessController::MessageReceived(BMessage *message)
}
#endif
} else {
alert = new BAlert("", B_TRANSLATE("This thread is "
"already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"),
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
}
@ -376,10 +379,12 @@ ProcessController::MessageReceived(BMessage *message)
}
}
if (last) {
alert = new BAlert("", B_TRANSLATE("This is the last "
"active processor...\nYou can't turn it off!"),
alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("This is the last active processor...\n"
"You can't turn it off!"),
B_TRANSLATE("That's no Fun!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
} else
_kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu));
@ -415,6 +420,7 @@ ProcessController::AboutRequested()
font.SetSize(font.Size() * 1.5);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController")), &font);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}

View File

@ -29,7 +29,8 @@
class QuitMenuItem : public IconMenuItem {
public:
QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge = false);
QuitMenuItem(team_id team, BBitmap* icon, const char* title,
BMessage* m, bool purge = false);
team_id Team() { return fTeam; }
private:
@ -37,7 +38,9 @@ class QuitMenuItem : public IconMenuItem {
};
QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge) :
QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title,
BMessage* m, bool purge)
:
IconMenuItem(icon, title, m, true, purge), fTeam(team)
{
}
@ -112,12 +115,14 @@ QuitMenu::AddTeam(team_id tmid)
message->AddInt32 ("team", tmid);
item = NULL;
if (t < fInfosCount)
item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name, message);
item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name,
message);
else {
info_pack infos;
if (get_team_info(tmid, &infos.team_info) == B_OK
&& get_team_name_and_icon(infos, true))
item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, message, true);
item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name,
message, true);
}
if (item) {
item->SetTarget(gPCView);