Further localization. Making use of B_TRANSLATE_APP_NAME, AboutWindow. Cleanups. Please review/test changes in Terminal.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40973 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2011-03-16 18:48:41 +00:00
parent 7b3cdb9657
commit 71302e7c6d
28 changed files with 108 additions and 93 deletions

View File

@ -12,6 +12,7 @@
#include "OpenWindow.h"
#include "FindWindow.h"
#include <AboutWindow.h>
#include <Alert.h>
#include <Application.h>
#include <Autolock.h>
@ -485,21 +486,14 @@ DiskProbe::MessageReceived(BMessage *message)
void
DiskProbe::AboutRequested()
{
BAlert *alert = new BAlert("about", B_TRANSLATE("DiskProbe\n"
"\twritten by Axel Dörfler\n"
"\tCopyright 2004-2007, Haiku.\n\n"
"Original Be version by Robert Polic\n"), B_TRANSLATE("OK"));
BTextView *view = alert->TextView();
BFont font;
view->SetStylable(true);
view->GetFont(&font);
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, 9, &font);
alert->Go();
const char* authors[] = {
"Axel Dörfler",
NULL
};
BAboutWindow about(B_TRANSLATE_APP_NAME("DiskProbe"), 2004, authors,
"Original Be version by Robert Polic.");
about.Show();
}

View File

@ -16,7 +16,7 @@ Application DiskProbe :
OpenWindow.cpp
FindWindow.cpp
: be $(HAIKU_LOCALE_LIBS) tracker translation libexpression_parser.a
libmapm.a $(TARGET_LIBSUPC++)
libmapm.a libshared.a $(TARGET_LIBSUPC++)
: DiskProbe.rdef
;

View File

@ -219,17 +219,17 @@ PairsWindow::MessageReceived(BMessage* message)
// game end and results
if (fFinishPairs == fPairsView->fNumOfCards / 2) {
BString strAbout;
BString score;
score << fButtonClicks;
strAbout
<< B_TRANSLATE("Pairs\n"
BString strAbout = B_TRANSLATE("%app%\n"
"\twritten by Ralf Schülke\n"
"\tCopyright 2008-2010, Haiku Inc.\n"
"\n"
"You completed the game in %s clicks.\n");
strAbout.Replace("%s", score.String(), 1);
"You completed the game in %num% clicks.\n");
strAbout.ReplaceFirst("%app%",
B_TRANSLATE_APP_NAME("Pairs"));
strAbout.ReplaceFirst("%num%", score);
BAlert* alert = new BAlert("about",
strAbout.String(),
@ -244,7 +244,8 @@ PairsWindow::MessageReceived(BMessage* message)
view->GetFont(&font);
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, 6, &font);
view->SetFontAndColor(0,
strlen(B_TRANSLATE_APP_NAME("Pairs")), &font);
view->ResizeToPreferred();
if (alert->Go() == 0) {

View File

@ -23,4 +23,5 @@ DoCatalogs PowerStatus :
ExtendedInfoWindow.cpp
PowerStatus.cpp
PowerStatusView.cpp
PowerStatusWindow.cpp
;

View File

@ -11,11 +11,13 @@
#include "PowerStatusView.h"
#include <Application.h>
#include <Catalog.h>
PowerStatusWindow::PowerStatusWindow()
: BWindow(BRect(100, 150, 281, 299), "PowerStatus", B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
:
BWindow(BRect(100, 150, 281, 299), B_TRANSLATE_APP_NAME("PowerStatus"),
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

View File

@ -30,6 +30,7 @@ DoCatalogs ProcessController :
:
KernelMemoryBarMenuItem.cpp
NoiseBarMenuItem.cpp
PCWindow.cpp
PCWorld.cpp
Preferences.cpp
PriorityMenu.cpp

View File

@ -26,6 +26,7 @@
#include <Alert.h>
#include <Application.h>
#include <Catalog.h>
#include <Deskbar.h>
#include <Dragger.h>
#include <Roster.h>
@ -33,7 +34,9 @@
PCWindow::PCWindow()
: BWindow(BRect(100, 150, 131, 181), "ProcessController", B_TITLED_WINDOW,
:
BWindow(BRect(100, 150, 131, 181),
B_TRANSLATE_APP_NAME("ProcessController"), B_TITLED_WINDOW,
B_NOT_H_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
Preferences preferences(kPreferencesFileName);

View File

@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <AboutWindow.h>
#include <Alert.h>
#include <Bitmap.h>
#include <Catalog.h>
@ -405,24 +406,15 @@ ProcessController::MessageReceived(BMessage *message)
void
ProcessController::AboutRequested()
{
BAlert *alert = new BAlert(B_TRANSLATE("About"),
B_TRANSLATE("ProcessController\n\n"
"Copyright 1997-2001,\n"
"Georges-Edouard Berenger.\n\n"
"Copyright "B_UTF8_COPYRIGHT" 2007 Haiku, Inc.\n"),
B_TRANSLATE("OK"));
BTextView *view = alert->TextView();
BFont font;
const char* authors[] = {
"Georges-Edouard Berenger",
NULL
};
view->SetStylable(true);
view->GetFont(&font);
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();
BAboutWindow about(B_TRANSLATE_APP_NAME("ProcessController"), 2007, authors,
"Copyright 1997-2001\n"
"Georges-Edouard Berenger.");
about.Show();
}

View File

@ -277,7 +277,7 @@ CPUButton::MessageReceived(BMessage *message)
{
switch (message->what) {
case B_ABOUT_REQUESTED: {
PulseApp::ShowAbout();
PulseApp::ShowAbout(false);
break;
}
case PV_REPLICANT_PULSE: {

View File

@ -128,7 +128,7 @@ void DeskbarPulseView::MessageReceived(BMessage *message) {
prefswindow->Show();
break;
case PV_ABOUT: {
PulseApp::ShowAbout();
PulseApp::ShowAbout(false);
break;
}
case PV_QUIT:

View File

@ -163,21 +163,24 @@ PulseApp::~PulseApp()
void
PulseApp::AboutRequested()
{
PulseApp::ShowAbout();
PulseApp::ShowAbout(true);
}
void
PulseApp::ShowAbout()
PulseApp::ShowAbout(bool asApplication)
{
// static version to be used in replicant mode
BString name(B_TRANSLATE("Pulse"));
BString message;
snprintf(message.LockBuffer(512), 512,
B_TRANSLATE("%s\n\nBy David Ramsey and Arve Hjønnevåg\n"
"Revised by Daniel Switkin\n"), name.String());
message.UnlockBuffer();
BString name;
if (asApplication)
name = B_TRANSLATE_APP_NAME("Pulse");
else
name = B_TRANSLATE("Pulse");
BString message = B_TRANSLATE(
"%s\n\nBy David Ramsey and Arve Hjønnevåg\n"
"Revised by Daniel Switkin\n");
message.ReplaceFirst("%s", name);
BAlert *alert = new BAlert(B_TRANSLATE("Info"),
message.String(), B_TRANSLATE("OK"));

View File

@ -24,7 +24,7 @@ public:
~PulseApp();
virtual void AboutRequested();
static void ShowAbout();
static void ShowAbout(bool asApplication);
Prefs* prefs;

View File

@ -27,12 +27,12 @@
#define B_TRANSLATE_CONTEXT "PulseWindow"
PulseWindow::PulseWindow(BRect rect) :
BWindow(rect, "Pulse", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
PulseWindow::PulseWindow(BRect rect)
:
BWindow(rect, B_TRANSLATE_APP_NAME("Pulse"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
{
SetPulseRate(200000);
SetTitle(B_TRANSLATE("Pulse"));
PulseApp *pulseapp = (PulseApp *)be_app;
BRect bounds = Bounds();
@ -103,7 +103,7 @@ PulseWindow::MessageReceived(BMessage *message)
break;
}
case PV_ABOUT: {
PulseApp::ShowAbout();
PulseApp::ShowAbout(true);
break;
}
case PV_QUIT:

View File

@ -8,6 +8,7 @@
#include <stdlib.h>
#include <AboutWindow.h>
#include <Catalog.h>
#include <Locale.h>
#include "BootPromptWindow.h"
@ -65,8 +66,8 @@ BootPromptApp::AboutRequested()
NULL
};
BAboutWindow* aboutWindow = new BAboutWindow("ReadOnlyBootPrompt", 2010,
kAuthors);
BAboutWindow* aboutWindow = new BAboutWindow(
B_TRANSLATE_APP_NAME("ReadOnlyBootPrompt"), 2010, kAuthors);
aboutWindow->Show();
delete aboutWindow;

View File

@ -108,7 +108,7 @@ public:
ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
bool clipboard)
:
BWindow(BRect(0, 0, 200.0, 100.0), B_TRANSLATE("Screenshot"),
BWindow(BRect(0, 0, 200.0, 100.0), B_TRANSLATE_APP_NAME("Screenshot"),
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AVOID_FRONT
| B_QUIT_ON_WINDOW_CLOSE | B_AUTO_UPDATE_SIZE_LIMITS
| B_CLOSE_ON_ESCAPE),

View File

@ -153,7 +153,7 @@ ShowImageApp::AboutRequested()
"Axel Dörfler",
NULL
};
BAboutWindow about(B_TRANSLATE("ShowImage"), 2003, authors);
BAboutWindow about(B_TRANSLATE_APP_NAME("ShowImage"), 2003, authors);
about.Show();
}

View File

@ -955,7 +955,7 @@ void
ShowImageWindow::_LoadError(const entry_ref& ref)
{
// TODO: give a better error message!
BAlert* alert = new BAlert(B_TRANSLATE("ShowImage"),
BAlert* alert = new BAlert(B_TRANSLATE_APP_NAME("ShowImage"),
B_TRANSLATE_WITH_CONTEXT("Could not load image! Either the "
"file or an image translator for it does not exist.",
"LoadAlerts"),

View File

@ -102,17 +102,19 @@ struct wave_struct
};
RecorderWindow::RecorderWindow() :
BWindow(BRect(XPOS,YPOS,XPOS+MIN_WIDTH,YPOS+MIN_HEIGHT), "SoundRecorder",
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE),
fPlayer(NULL),
fSoundList(NULL),
fPlayFile(NULL),
fPlayTrack(NULL),
fPlayFrames(0),
fLooping(false),
fSavePanel(NULL),
fInitCheck(B_OK)
RecorderWindow::RecorderWindow()
:
BWindow(BRect(XPOS, YPOS, XPOS + MIN_WIDTH, YPOS + MIN_HEIGHT),
B_TRANSLATE_APP_NAME("SoundRecorder"), B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE),
fPlayer(NULL),
fSoundList(NULL),
fPlayFile(NULL),
fPlayTrack(NULL),
fPlayFrames(0),
fLooping(false),
fSavePanel(NULL),
fInitCheck(B_OK)
{
fRoster = NULL;
fRecordButton = NULL;
@ -128,8 +130,6 @@ RecorderWindow::RecorderWindow() :
CalcSizes(MIN_WIDTH, MIN_HEIGHT);
SetTitle(B_TRANSLATE("SoundRecorder"));
fInitCheck = InitWindow();
if (fInitCheck != B_OK) {
if (fInitCheck == B_NAME_NOT_FOUND)

View File

@ -89,8 +89,9 @@ StyledEditApp::StyledEditApp()
BApplication(APP_SIGNATURE),
fOpenPanel(NULL)
{
B_TRANSLATE_MARK_APP_NAME("StyledEdit");
fOpenPanel = new BFilePanel();
fOpenAsEncoding = 0;
BMenuBar* menuBar

View File

@ -143,7 +143,7 @@ GenerateSudoku::_GenerateThread(void* _self)
SudokuWindow::SudokuWindow()
:
BWindow(BRect(100, 100, 500, 520), B_TRANSLATE("Sudoku"),
BWindow(BRect(100, 100, 500, 520), B_TRANSLATE_APP_NAME("Sudoku"),
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE),
fGenerator(NULL),
fStoredState(NULL),

View File

@ -27,14 +27,20 @@
#define B_TRANSLATE_CONTEXT "Terminal PrefWindow"
PrefWindow::PrefWindow(const BMessenger& messenger)
: BWindow(BRect(0, 0, 375, 185), B_TRANSLATE("Terminal settings"),
:
BWindow(BRect(0, 0, 375, 185), "Terminal settings",
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS),
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fPreviousPref(new PrefHandler(PrefHandler::Default())),
fSavePanel(NULL),
fDirty(false),
fTerminalMessenger(messenger)
{
BString app = B_TRANSLATE_APP_NAME("Terminal");
BString title = B_TRANSLATE_COMMENT("%app% settings", "window title");
title.ReplaceFirst("%app%", app);
SetTitle(title);
BLayoutBuilder::Group<>(this, B_VERTICAL)
.AddGroup(B_VERTICAL)
.SetInsets(10, 10, 10, 10)

View File

@ -188,7 +188,7 @@ TermWindow::TermWindow(const BString& title, Arguments* args)
// apply the title settings
fTitle.pattern = title;
if (fTitle.pattern.Length() == 0) {
fTitle.pattern = B_TRANSLATE("Terminal");
fTitle.pattern = B_TRANSLATE_APP_NAME("Terminal");
if (id >= 0)
fTitle.pattern << " " << id + 1;
@ -426,7 +426,7 @@ TermWindow::_SetupMenu()
{
BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
// Terminal
.AddMenu(B_TRANSLATE("Terminal"))
.AddMenu(B_TRANSLATE_APP_NAME("Terminal"))
.AddItem(B_TRANSLATE("Switch Terminals"), MENU_SWITCH_TERM, B_TAB)
.GetItem(fSwitchTerminalsMenuItem)
.AddItem(B_TRANSLATE("New Terminal"), MENU_NEW_TERM, 'N')

View File

@ -9,10 +9,16 @@ SubDirHdrs $(HAIKU_TOP) src kits tracker ;
Application Tracker :
main.cpp
: be tracker
: be tracker $(HAIKU_LOCALE_LIBS)
: Tracker.rdef
;
DoCatalogs Tracker :
x-vnd.Be-TRAK
:
main.cpp
;
if $(TARGET_PLATFORM) = libbe_test {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Tracker
: tests!apps ;

View File

@ -32,8 +32,12 @@ names are registered trademarks or trademarks of their respective holders.
All rights reserved.
*/
#include "Tracker.h"
#include <Catalog.h>
#if DEBUG
//#define LEAK_CHECKING
@ -56,6 +60,7 @@ int main(int , char **)
SetNewLeakChecking(true);
SetMallocLeakChecking(true);
#endif
B_TRANSLATE_MARK_APP_NAME("Tracker");
TTracker tracker;
tracker.Run();

View File

@ -2,11 +2,6 @@ SubDir HAIKU_TOP src apps webwatch ;
SetSubDirSupportedPlatformsBeOSCompatible ;
#UsePrivateHeaders app ;
#UsePrivateHeaders shared ;
#UsePrivateHeaders tracker ;
#SubDirHdrs $(HAIKU_TOP) src kits tracker ;
Application WebWatch :
WatchApp.cpp
WatchView.cpp
@ -17,5 +12,6 @@ Application WebWatch :
DoCatalogs WebWatch :
x-vnd.mahlzeit.webwatch
:
WatchApp.cpp
WatchView.cpp
;

View File

@ -37,6 +37,8 @@ BView* instantiate_deskbar_item()
WatchApp::WatchApp() : BApplication(APP_SIGNATURE)
{
B_TRANSLATE_MARK_APP_NAME("WebWatch");
// Here we tell the Deskbar that we want to add a new replicant, and
// where it can find this replicant (in our app). Because we only run
// less than a second, there is no need for our title to appear inside

View File

@ -123,7 +123,7 @@ void WatchView::MouseDown(BPoint point)
BPopUpMenu* menu = new BPopUpMenu(B_TRANSLATE("WatchView"), false, false);
menu->AddItem(new BMenuItem(
B_TRANSLATE("About" B_UTF8_ELLIPSIS),
B_TRANSLATE("About"),
new BMessage(B_ABOUT_REQUESTED)));
menu->AddItem(new BMenuItem(

View File

@ -595,9 +595,10 @@ WorkspacesView::MouseDown(BPoint where)
WorkspacesWindow::WorkspacesWindow(WorkspacesSettings *settings)
: BWindow(settings->WindowFrame(), B_TRANSLATE("Workspaces"),
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_AVOID_FRONT
| B_WILL_ACCEPT_FIRST_CLICK, B_ALL_WORKSPACES),
:
BWindow(settings->WindowFrame(), B_TRANSLATE_APP_NAME("Workspaces"),
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_AVOID_FRONT | B_WILL_ACCEPT_FIRST_CLICK, B_ALL_WORKSPACES),
fSettings(settings),
fAutoRaising(false)
{