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
+5 -2
View File
@@ -29,11 +29,14 @@ DoCatalogs ProcessController :
x-vnd.Haiku-ProcessController x-vnd.Haiku-ProcessController
: :
KernelMemoryBarMenuItem.cpp KernelMemoryBarMenuItem.cpp
MemoryBarMenu.cpp
MemoryBarMenuItem.cpp
NoiseBarMenuItem.cpp NoiseBarMenuItem.cpp
PCWorld.cpp PCWorld.cpp
Preferences.cpp Preferences.cpp
PriorityMenu.cpp PriorityMenu.cpp
ProcessController.cpp ProcessController.cpp
; ;
AddCatalogEntryAttribute ProcessController
:
x-vnd.Haiku-ProcessController:PCWindow:ProcessController
;
@@ -24,7 +24,6 @@
#include "ProcessController.h" #include "ProcessController.h"
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h>
#include <Roster.h> #include <Roster.h>
#include <StringForSize.h> #include <StringForSize.h>
#include <Window.h> #include <Window.h>
@@ -36,9 +35,6 @@
float gMemoryTextWidth; float gMemoryTextWidth;
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo) MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo)
: BMenu(name), : BMenu(name),
@@ -25,14 +25,10 @@
#include "ProcessController.h" #include "ProcessController.h"
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h>
#include <StringForSize.h> #include <StringForSize.h>
#include <stdio.h> #include <stdio.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team, MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team,
BBitmap* icon, bool deleteIcon, BMessage* message) BBitmap* icon, bool deleteIcon, BMessage* message)
+2 -2
View File
@@ -86,7 +86,7 @@ PCApplication::ReadyToRun()
BDeskbar deskbar; BDeskbar deskbar;
if (!deskbar.HasItem(kDeskbarItemName)) { if (!deskbar.HasItem(kDeskbarItemName)) {
// We're not yet installed in the Deskbar, ask if we should // 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" B_TRANSLATE("You can run ProcessController in a window"
" or install it in the Deskbar."), B_TRANSLATE("Run in window"), " or install it in the Deskbar."), B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"), B_TRANSLATE("Install in Deskbar"),
@@ -101,7 +101,7 @@ PCApplication::ReadyToRun()
return; return;
} }
} else { } else {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("ProcessController is already installed in Deskbar."), B_TRANSLATE("ProcessController is already installed in Deskbar."),
B_TRANSLATE("OK"), NULL, B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
@@ -116,6 +116,8 @@ Preferences::~Preferences()
BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"), BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"),
error.String(), B_TRANSLATE("Damned!"), NULL, NULL, error.String(), B_TRANSLATE("Damned!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
} }
} }
+1 -1
View File
@@ -93,7 +93,7 @@ PriorityMenu::BuildMenu()
BString name; BString name;
const size_t size = B_OS_NAME_LENGTH * 4; const size_t size = B_OS_NAME_LENGTH * 4;
snprintf(name.LockBuffer(size), size, snprintf(name.LockBuffer(size), size,
B_TRANSLATE("%s [%d]"), priority->name, (int)priority->priority); "%s [%d]", priority->name, (int)priority->priority);
name.UnlockBuffer(); name.UnlockBuffer();
item = new BMenuItem(name.String(), message); item = new BMenuItem(name.String(), message);
item->SetTarget(gPCView); item->SetTarget(gPCView);
@@ -268,17 +268,18 @@ ProcessController::MessageReceived(BMessage *message)
snprintf(question, sizeof(question), snprintf(question, sizeof(question),
B_TRANSLATE("Do you really want to kill the team \"%s\"?"), B_TRANSLATE("Do you really want to kill the team \"%s\"?"),
infos.team_name); infos.team_name);
alert = new BAlert("", question, alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Cancel"), B_TRANSLATE("Yes, kill this team!"), B_TRANSLATE("Cancel"), B_TRANSLATE("Yes, kill this team!"),
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
if (alert->Go()) if (alert->Go())
kill_team(team); kill_team(team);
} else { } else {
alert = new BAlert("", B_TRANSLATE("This team is already " alert = new BAlert(B_TRANSLATE("Info"),
"gone"B_UTF8_ELLIPSIS), B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT); B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -292,18 +293,18 @@ ProcessController::MessageReceived(BMessage *message)
snprintf(question, sizeof(question), snprintf(question, sizeof(question),
B_TRANSLATE("What do you want to do " B_TRANSLATE("What do you want to do "
"with the thread \"%s\"?"), thinfo.name); "with the thread \"%s\"?"), thinfo.name);
alert = new BAlert("", question, B_TRANSLATE("Cancel"), alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Debug this thread!"), B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"),
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
B_STOP_ALERT); B_STOP_ALERT);
#define KILL 2 #define KILL 2
#else #else
snprintf(question, sizeof(question), snprintf(question, sizeof(question),
B_TRANSLATE("Are you sure you want " B_TRANSLATE("Are you sure you want "
"to kill the thread \"%s\"?"), thinfo.name); "to kill the thread \"%s\"?"), thinfo.name);
alert = new BAlert("", question, B_TRANSLATE("Cancel"), alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"),
B_STOP_ALERT); NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
#define KILL 1 #define KILL 1
#endif #endif
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
@@ -324,9 +325,11 @@ ProcessController::MessageReceived(BMessage *message)
} }
#endif #endif
} else { } else {
alert = new BAlert("", B_TRANSLATE("This thread is " alert = new BAlert(B_TRANSLATE("Info"),
"already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"), B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS),
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("Ok!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -376,10 +379,12 @@ ProcessController::MessageReceived(BMessage *message)
} }
} }
if (last) { if (last) {
alert = new BAlert("", B_TRANSLATE("This is the last " alert = new BAlert(B_TRANSLATE("Info"),
"active processor...\nYou can't turn it off!"), B_TRANSLATE("This is the last active processor...\n"
"You can't turn it off!"),
B_TRANSLATE("That's no Fun!"), NULL, NULL, B_TRANSLATE("That's no Fun!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
} else } else
_kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu)); _kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu));
@@ -415,6 +420,7 @@ ProcessController::AboutRequested()
font.SetSize(font.Size() * 1.5); font.SetSize(font.Size() * 1.5);
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController")), &font); view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController")), &font);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
} }
+9 -4
View File
@@ -29,7 +29,8 @@
class QuitMenuItem : public IconMenuItem { class QuitMenuItem : public IconMenuItem {
public: 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; } team_id Team() { return fTeam; }
private: 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) IconMenuItem(icon, title, m, true, purge), fTeam(team)
{ {
} }
@@ -112,12 +115,14 @@ QuitMenu::AddTeam(team_id tmid)
message->AddInt32 ("team", tmid); message->AddInt32 ("team", tmid);
item = NULL; item = NULL;
if (t < fInfosCount) 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 { else {
info_pack infos; info_pack infos;
if (get_team_info(tmid, &infos.team_info) == B_OK if (get_team_info(tmid, &infos.team_info) == B_OK
&& get_team_name_and_icon(infos, true)) && 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) { if (item) {
item->SetTarget(gPCView); item->SetTarget(gPCView);