Made app name localizable, as it seems that it should be possible after all.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39877 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2010-12-17 11:20:49 +00:00
parent 7186aecb57
commit 5b6139e398
3 changed files with 15 additions and 6 deletions

View File

@ -64,10 +64,13 @@ ActivityMonitor::AboutRequested()
/*static*/ void
ActivityMonitor::ShowAbout()
{
BAlert *alert = new BAlert(B_TRANSLATE("about"),
B_TRANSLATE("ActivityMonitor\n"
"\twritten by Axel Dörfler\n"
"\tCopyright 2008, Haiku Inc.\n"), B_TRANSLATE("OK"));
BString text;
text << kAppName << "\n"
<< B_TRANSLATE("\twritten by Axel Dörfler\n"
"\tCopyright 2008, Haiku Inc.\n");
BAlert *alert = new BAlert(B_TRANSLATE("About"),
text.String(), B_TRANSLATE("OK"));
BTextView *view = alert->TextView();
BFont font;
@ -76,7 +79,7 @@ ActivityMonitor::ShowAbout()
view->GetFont(&font);
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, 15, &font);
view->SetFontAndColor(0, strlen(kAppName), &font);
alert->Go();
}

View File

@ -7,10 +7,16 @@
#include <Application.h>
#include <Catalog.h>
class BMessage;
class ActivityWindow;
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "ActivityWindow"
static const char* kAppName = B_TRANSLATE_MARK("ActivityMonitor");
class ActivityMonitor : public BApplication {
public:

View File

@ -34,7 +34,7 @@ static const uint32 kMsgShowSettings = 'shst';
ActivityWindow::ActivityWindow()
: BWindow(BRect(100, 100, 500, 350), "ActivityMonitor", B_TITLED_WINDOW,
: BWindow(BRect(100, 100, 500, 350), kAppName, B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE)
{
BMessage settings;