Apps & Prefs: Use B_TRANSLATE_SYSTEM_NAME() where appropriate

The application name should never appear in a translatable string.
Otherwise it will always show translated in the app, even if the
user configured the Locale prefs to not "Translate app and folder
names".
Always concatenate the B_TRANSLATE_SYSTEM_NAME'ed string.

Use a regular BAboutWindow in the Sounds prefs.

Change-Id: I85f02a3aa6c76b22266d495cf7514cc499bc31e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10234
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Humdinger
2026-01-19 11:41:50 +00:00
committed by Adrien Destugues
parent 439cbbfff1
commit c273dc9f64
49 changed files with 210 additions and 153 deletions
@@ -301,21 +301,22 @@ BootManagerController::_CreateErrorEntryPage()
description << B_TRANSLATE_COMMENT("Partition table not compatible",
"Title") << "\n\n"
<< B_TRANSLATE("The partition table of the first hard disk is not "
"compatible with Boot Manager.\n"
"Boot Manager only works with IBM PC MBR partitions.");
"compatible.\n"
"%appname% only works with IBM PC MBR partitions.");
} else if (fCollectPartitionsStatus == B_PARTITION_TOO_SMALL) {
description << B_TRANSLATE_COMMENT("First partition starts too early",
"Title") << "\n\n"
<< B_TRANSLATE("The first partition on the disk starts too early "
"and does not leave enough space free for a boot menu.\n"
"Boot Manager needs 2 KiB available space before the first "
"%appname% needs 2 KiB available space before the first "
"partition.");
} else {
description << B_TRANSLATE_COMMENT("Error reading partition table",
"Title") << "\n\n"
<< B_TRANSLATE("Boot Manager is unable to read the partition "
<< B_TRANSLATE("%appname% is unable to read the partition "
"table!");
}
description.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("BootManager"));
return new DescriptionPage("errorEntry", description.String(), true);
}
+4 -2
View File
@@ -233,8 +233,10 @@ CodyCam::_SetUpNodes()
INFO("CodyCam acquiring VideoInput node\n");
status = fMediaRoster->GetVideoInput(&fProducerNode);
if (status != B_OK) {
fWindow->ErrorAlert(B_TRANSLATE("Cannot find a video source.\n"
"You need a webcam to use CodyCam."), status);
BString text(B_TRANSLATE("Cannot find a video source.\n"
"You need a webcam to use %appname%."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("CodyCam"));
fWindow->ErrorAlert(text, status);
return status;
}
+3 -2
View File
@@ -285,8 +285,9 @@ B_TRANSLATE_MARK_VOID("About this system")
AddItem(mountMenu);
#endif
item = new BMenuItem(B_TRANSLATE("Deskbar preferences" B_UTF8_ELLIPSIS),
new BMessage(kConfigShow));
BString menuLabel(B_TRANSLATE("%appname% preferences" B_UTF8_ELLIPSIS));
menuLabel.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Deskbar"));
item = new BMenuItem(menuLabel, new BMessage(kConfigShow));
item->SetTarget(be_app);
AddItem(item);
+5 -1
View File
@@ -46,9 +46,13 @@ static const char* kSettingsFileName = "prefs_window_settings";
PreferencesWindow::PreferencesWindow(BRect frame)
:
BWindow(frame, B_TRANSLATE("Deskbar preferences"), B_TITLED_WINDOW,
BWindow(frame, "", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE)
{
BString title(B_TRANSLATE("%appname% preferences"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Deskbar"));
SetTitle(title);
// Initial settings (used by revert button)
fSettings = *static_cast<TBarApp*>(be_app)->Settings();
+4 -1
View File
@@ -90,7 +90,10 @@ DirectoryFilePanel::Show()
fCurrentButton->SetTarget(Messenger());
SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Select"));
Window()->SetTitle(B_TRANSLATE("Expander: Choose destination"));
BString title(B_TRANSLATE("%appname%: Choose destination"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Expander"));
Window()->SetTitle(title);
Window()->Unlock();
+5 -1
View File
@@ -43,13 +43,17 @@ static const uint32 MSG_DESTSELECT = 'mDes';
ExpanderPreferences::ExpanderPreferences(BMessage* settings)
:
BWindow(BRect(0, 0, 325, 305), B_TRANSLATE("Expander settings"),
BWindow(BRect(0, 0, 325, 305), "",
B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS),
fSettings(settings),
fUsePanel(NULL)
{
BString title(B_TRANSLATE("%appname% settings"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Expander"));
SetTitle(title);
const float kSpacing = be_control_look->DefaultItemSpacing();
BStringView* expansionLabel = new BStringView("stringViewExpansion",
+3 -2
View File
@@ -256,8 +256,9 @@ ExpanderWindow::MessageReceived(BMessage* message)
BMessenger messenger(this);
fSourcePanel = new BFilePanel(B_OPEN_PANEL, &messenger, &srcRef,
B_FILE_NODE, false, NULL, new RuleRefFilter(fRules), true);
(fSourcePanel->Window())->SetTitle(
B_TRANSLATE("Expander: Open"));
BString title(B_TRANSLATE("%appname%: Open"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Expander"));
(fSourcePanel->Window())->SetTitle(title);
} else
fSourcePanel->SetPanelDirectory(&srcRef);
fSourcePanel->Show();
+6 -5
View File
@@ -456,11 +456,12 @@ void
App::_CheckPackageDaemonRuns()
{
while (!be_roster->IsRunning(kPackageDaemonSignature)) {
BAlert* alert = new BAlert(B_TRANSLATE("Start package daemon"),
B_TRANSLATE("HaikuDepot needs the package daemon to function, "
BString text(B_TRANSLATE("%appname% needs the package daemon to function, "
"and it appears to be not running.\n"
"Would you like to start it now?"),
B_TRANSLATE("No, quit HaikuDepot"), B_TRANSLATE("Start package daemon"), NULL,
"Would you like to start it now?"));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("HaikuDepot"));
BAlert* alert = new BAlert(B_TRANSLATE("Start package daemon"), text,
B_TRANSLATE("No, quit"), B_TRANSLATE("Start package daemon"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
@@ -482,7 +483,7 @@ App::_LaunchPackageDaemon()
errorMessage.ReplaceAll("%Error%", strerror(ret));
BAlert* alert = new BAlert(B_TRANSLATE("Package daemon problem"), errorMessage,
B_TRANSLATE("Quit HaikuDepot"), B_TRANSLATE("Try again"), NULL, B_WIDTH_AS_USUAL,
B_TRANSLATE("Quit"), B_TRANSLATE("Try again"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
+4 -3
View File
@@ -2004,9 +2004,10 @@ MainWindow::_WindowTitleForPackage(const PackageInfoRef& pkg)
if (version.IsSet())
versionString = version->ToString();
BString title = B_TRANSLATE("HaikuDepot - %PackageName% %PackageVersion%");
title.ReplaceAll("%PackageName%", pkg->Name());
title.ReplaceAll("%PackageVersion%", versionString);
BString title("%AppName% - %PackageName% %PackageVersion%");
title.ReplaceFirst("%AppName%", B_TRANSLATE_SYSTEM_NAME("HaikuDepot"));
title.ReplaceFirst("%PackageName%", pkg->Name());
title.ReplaceFirst("%PackageVersion%", versionString);
return title;
}
@@ -28,8 +28,10 @@ ShuttingDownWindow::ShuttingDownWindow(BWindow* parent)
textView->AdoptSystemColors();
textView->MakeEditable(false);
textView->MakeSelectable(false);
textView->SetText(B_TRANSLATE("HaikuDepot is stopping or completing "
BString text(B_TRANSLATE("%appname% is stopping or completing "
"running operations before quitting."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("HaikuDepot"));
textView->SetText(text);
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
@@ -33,12 +33,12 @@
#define PLACEHOLDER_TEXT "..."
#define INTRODUCTION_TEXT_LATEST \
"HaikuDepot communicates with a " \
"%Appname% communicates with a " \
"server component called HaikuDepotServer. These are the latest " \
"usage conditions for use of the HaikuDepotServer service."
#define INTRODUCTION_TEXT_USER \
"HaikuDepot communicates with a " \
"%Appname% communicates with a " \
"server component called HaikuDepotServer. These are the usage " \
"conditions that the user '%Nickname%' agreed to at %AgreedToTimestamp% "\
"in relation to the use of the HaikuDepotServer service."
@@ -436,7 +436,11 @@ UserUsageConditionsWindow::_IntroductionTextForMode(UserUsageConditionsSelection
{
switch (mode) {
case LATEST:
return B_TRANSLATE(INTRODUCTION_TEXT_LATEST);
{
BString text(B_TRANSLATE(INTRODUCTION_TEXT_LATEST));
text.ReplaceFirst("%Appname%", B_TRANSLATE_SYSTEM_NAME("HaikuDepot"));
return text;
}
case USER:
{
BString nicknamePresentation = PLACEHOLDER_TEXT;
@@ -453,6 +457,7 @@ UserUsageConditionsWindow::_IntroductionTextForMode(UserUsageConditionsSelection
}
BString text = B_TRANSLATE(INTRODUCTION_TEXT_USER);
text.ReplaceFirst("%Appname%", B_TRANSLATE_SYSTEM_NAME("HaikuDepot"));
text.ReplaceAll("%Nickname%", nicknamePresentation);
text.ReplaceAll("%AgreedToTimestamp%", agreedToTimestampPresentation);
return text;
@@ -144,13 +144,14 @@ SVGExporter::SetOriginalEntry(const entry_ref* ref)
bool
SVGExporter::_DisplayWarning() const
{
BAlert* alert = new BAlert(B_TRANSLATE("warning"),
B_TRANSLATE("Icon-O-Matic might not have "
BString text(B_TRANSLATE("%appname% might not have "
"interpreted all data from the SVG "
"when it was loaded. "
"By overwriting the original "
"file, this information would now "
"be lost."),
"be lost."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Icon-O-Matic"));
BAlert* alert = new BAlert(B_TRANSLATE("warning"), text,
B_TRANSLATE("Cancel"),
B_TRANSLATE("Overwrite"));
alert->SetShortcut(0, B_ESCAPE);
+6 -4
View File
@@ -509,11 +509,13 @@ InstallerWindow::MessageReceived(BMessage *msg)
BString status;
if (be_roster->IsRunning(kDeskbarSignature)) {
fBeginButton->SetLabel(B_TRANSLATE("Quit"));
status.SetToFormat(B_TRANSLATE("Installation "
BString text(B_TRANSLATE("Installation "
"completed. Boot sector has been written to '%s'. Press "
"'Quit' to leave the Installer or choose a new target "
"volume to perform another installation."),
dstItem ? dstItem->Name() : B_TRANSLATE_COMMENT("???",
"'Quit' to leave the %appname% or choose a new target "
"volume to perform another installation."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Installer"));
status.SetToFormat(text, dstItem ? dstItem->Name() : B_TRANSLATE_COMMENT("???",
"Unknown partition name"));
} else {
fBeginButton->SetLabel(B_TRANSLATE("Restart"));
+5 -3
View File
@@ -527,9 +527,11 @@ WorkerThread::_PerformInstall(partition_id sourcePartitionID,
// check not installing on boot volume
if (strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0) {
BAlert* alert = new BAlert("", B_TRANSLATE("Are you sure you want to "
"install onto the current boot disk? The Installer will have to "
"reboot your machine if you proceed."), B_TRANSLATE("OK"),
BString text(B_TRANSLATE("Are you sure you want to "
"install onto the current boot disk? The %appname% will have to "
"reboot your machine if you proceed."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Installer"));
BAlert* alert = new BAlert("", text, B_TRANSLATE("OK"),
B_TRANSLATE("Cancel"), 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() != 0) {
+5 -4
View File
@@ -53,11 +53,12 @@ LoginApp::ReadyToRun()
BScreen screen;
if (fEditShelfMode) {
BAlert* alert = new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can "
"customize the desktop shown behind the Login application by "
BString text(B_TRANSLATE("You can "
"customize the desktop shown behind the %appname% application by "
"dropping replicants onto it.\n\n"
"When you are finished just quit the application (Cmd-Q)."),
B_TRANSLATE("OK"));
"When you are finished just quit the application (Cmd-Q)."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Login"));
BAlert* alert = new BAlert(B_TRANSLATE("Info"), text, B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} else {
+3 -2
View File
@@ -1702,8 +1702,9 @@ TMailWindow::MessageReceived(BMessage* msg)
snooze (1500000);
if (!gDictCount) {
beep();
BAlert* alert = new BAlert("",
B_TRANSLATE("Mail couldn't find its dictionary."),
BString text(B_TRANSLATE("%appname% couldn't find its dictionary."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Mail"));
BAlert* alert = new BAlert("", text,
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_OFFSET_SPACING, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
+5 -2
View File
@@ -93,8 +93,7 @@ TPrefsWindow::TPrefsWindow(BPoint leftTop, BFont* font, int32* level,
bool* warnUnencodable, bool* spellCheckStartOn, bool* autoMarkRead,
uint8* buttonBar)
:
BWindow(BRect(leftTop.x, leftTop.y, leftTop.x + 100, leftTop.y + 100),
B_TRANSLATE("Mail settings"),
BWindow(BRect(leftTop.x, leftTop.y, leftTop.x + 100, leftTop.y + 100), "",
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS),
@@ -136,6 +135,10 @@ TPrefsWindow::TPrefsWindow(BPoint leftTop, BFont* font, int32* level,
fNewAutoMarkRead(autoMarkRead),
fAutoMarkRead(*autoMarkRead)
{
BString title(B_TRANSLATE("%appname% settings"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Mail"));
SetTitle(title);
strcpy(fSignature, *fNewSignature);
BMenuField* menu;
+1 -1
View File
@@ -701,7 +701,7 @@ MandelbrotWindow::MessageReceived(BMessage* msg)
break;
case B_ABOUT_REQUESTED: {
BAboutWindow* wind = new BAboutWindow("Mandelbrot",
BAboutWindow* wind = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME("Mandelbrot"),
"application/x-vnd.Haiku-Mandelbrot");
const char* authors[] = {
+3 -2
View File
@@ -419,8 +419,9 @@ MainApp::_ShowFilePanel(BFilePanel* panel, uint32 command,
if (message->FindString("title", &panelTitle) != B_OK)
panelTitle = defaultTitle;
{
BString finalPanelTitle = "MediaPlayer: ";
finalPanelTitle << panelTitle;
BString finalPanelTitle(B_TRANSLATE("%appname%: %title%"));
finalPanelTitle.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("MediaPlayer"));
finalPanelTitle.ReplaceFirst("%title%", panelTitle);
BAutolock lock(panel->Window());
panel->Window()->SetTitle(finalPanelTitle.String());
}
@@ -42,11 +42,14 @@ enum {
SettingsWindow::SettingsWindow(BRect frame)
:
BWindow(frame, B_TRANSLATE("MediaPlayer settings"), B_FLOATING_WINDOW_LOOK,
B_FLOATING_ALL_WINDOW_FEEL,
BWindow(frame, "", B_FLOATING_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS)
{
BString title(B_TRANSLATE("%appname% settings"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("MediaPlayer"));
SetTitle(title);
const float kSpacing = be_control_look->DefaultItemSpacing();
BBox* settingsBox = new BBox(B_PLAIN_BORDER, NULL);
+1 -1
View File
@@ -58,7 +58,7 @@ MidiPlayerApp::ReadyToRun()
void
MidiPlayerApp::AboutRequested()
{
BAboutWindow* window = new BAboutWindow("MidiPlayer",
BAboutWindow* window = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME("MidiPlayer"),
MIDI_PLAYER_SIGNATURE);
const char* extraCopyrights[] = {
+3 -2
View File
@@ -87,10 +87,11 @@ NetworkStatus::ArgvReceived(int32 argc, char** argv)
if (strcmp(argv[1], "--help") == 0
|| strcmp(argv[1], "-h") == 0) {
const char* str = B_TRANSLATE("NetworkStatus options:\n"
BString str = B_TRANSLATE("%appname% options:\n"
"\t--deskbar\tautomatically add replicant to Deskbar\n"
"\t--help\t\tprint this info and exit");
puts(str);
str.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("NetworkStatus"));
puts(str.String());
fQuitImmediately = true;
return;
}
+3 -3
View File
@@ -145,10 +145,10 @@ Pairs::_GetVectorIcons()
if (fIconMap.size() < kMinIconCount) {
char buffer[512];
snprintf(buffer, sizeof(buffer),
B_TRANSLATE_COMMENT("Pairs did not find enough vector icons "
B_TRANSLATE_COMMENT("%s did not find enough vector icons "
"to start; it needs at least %zu, found %zu.\n",
"Don't translate \"%zu\", but make sure to keep them."),
kMinIconCount, fIconMap.size());
"Don't translate \"%s\" and \"%zu\", but make sure to keep them."),
B_TRANSLATE_SYSTEM_NAME("Pairs"), kMinIconCount, fIconMap.size());
BString messageString(buffer);
BAlert* alert = new BAlert("Fatal", messageString.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_WIDEST,
@@ -24,12 +24,16 @@
#define B_TRANSLATION_CONTEXT "PoorMan"
PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame, char * name)
: BWindow(frame, name, B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE
PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame)
: BWindow(frame, "", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE
| B_CLOSE_ON_ESCAPE | B_AUTO_UPDATE_SIZE_LIMITS),
fWebDirFilePanel(NULL),
fLogFilePanel(NULL)
{
BString title(B_TRANSLATE("%appname% settings"));
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("PoorMan"));
SetTitle(title);
fCancelButton = new BButton("Cancel Button", B_TRANSLATE("Cancel"),
new BMessage(MSG_PREF_BTN_CANCEL));
fDoneButton = new BButton("Done Button", B_TRANSLATE("Done"),
@@ -75,8 +79,9 @@ PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame, char * name)
B_FILE_NODE, false, &message);
fLogFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Create"));
change_title = fLogFilePanel->Window();
change_title->SetTitle(STR_FILEPANEL_CREATE_LOG_FILE);
title = B_TRANSLATE("Create %appname% log");
title.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("PoorMan"));
change_title->SetTitle(title);
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
+1 -1
View File
@@ -24,7 +24,7 @@
class PoorManPreferencesWindow: public BWindow {
public:
PoorManPreferencesWindow(BRect frame, char* name);
PoorManPreferencesWindow(BRect frame);
~PoorManPreferencesWindow();
virtual void MessageReceived(BMessage* message);
+12 -8
View File
@@ -186,8 +186,7 @@ PoorManWindow::MessageReceived(BMessage* message)
fPrefWindow->MessageReceived(message);
break;
case MSG_MENU_EDIT_PREF:
fPrefWindow = new PoorManPreferencesWindow(fSetwindowFrame,
STR_WIN_NAME_PREF);
fPrefWindow = new PoorManPreferencesWindow(fSetwindowFrame);
fPrefWindow->Show();
break;
case MSG_MENU_CTRL_RUN:
@@ -535,11 +534,18 @@ PoorManWindow::SaveConsole(BMessage* message, bool selection)
void
PoorManWindow::DefaultSettings()
{
BAlert* serverAlert = new BAlert(B_TRANSLATE("Error Server"),
BAlert* serverAlert = new BAlert(B_TRANSLATE("Error server"),
STR_ERR_CANT_START, B_TRANSLATE("OK"));
serverAlert->SetFlags(serverAlert->Flags() | B_CLOSE_ON_ESCAPE);
BAlert* dirAlert = new BAlert(B_TRANSLATE("Error Dir"),
STR_ERR_WEB_DIR, B_TRANSLATE("Cancel"), B_TRANSLATE("Select"),
BString text(B_TRANSLATE(
"Please choose the folder to publish on the web.\n\n"
"You can have %appname% create a default \"public_html\" "
"in your home folder.\n"
"Or you select one of your own folders instead."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("PoorMan"));
BAlert* dirAlert = new BAlert(B_TRANSLATE("Error folder"),
text, B_TRANSLATE("Cancel"), B_TRANSLATE("Select"),
B_TRANSLATE("Create public_html"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING);
dirAlert->SetShortcut(0, B_ESCAPE);
int32 buttonIndex = dirAlert->Go();
@@ -552,9 +558,7 @@ PoorManWindow::DefaultSettings()
break;
case 1:
fPrefWindow = new PoorManPreferencesWindow(
fSetwindowFrame,
STR_WIN_NAME_PREF);
fPrefWindow = new PoorManPreferencesWindow(fSetwindowFrame);
fPrefWindow->ShowWebDirFilePanel();
break;
-11
View File
@@ -15,12 +15,6 @@ const char* STR_APP_SIG
= "application/x-vnd.Haiku-PoorMan";
const char* STR_APP_NAME
= B_TRANSLATE_SYSTEM_NAME("PoorMan");
const char* STR_ERR_WEB_DIR
= B_TRANSLATE(
"Please choose the folder to publish on the web.\n\n"
"You can have PoorMan create a default \"public_html\" "
"in your home folder.\n"
"Or you select one of your own folders instead.");
const char* STR_ERR_CANT_START
= B_TRANSLATE(
"Cannot start the server");
@@ -66,9 +60,6 @@ const char* STR_TXT_VIEW
// ------------------------------------------------------
// Preferences Window
char* STR_WIN_NAME_PREF
= (char*)B_TRANSLATE("PoorMan settings");
const char* STR_SETTINGS_FILE_NAME
= "PoorMan settings";
const char* STR_DEFAULT_WEB_DIRECTORY
@@ -106,8 +97,6 @@ const char* STR_TXT_LOG_FILE_NAME
= B_TRANSLATE("Log file name:");
const char* STR_BTN_CREATE_LOG_FILE
= B_TRANSLATE("Create log file");
const char* STR_FILEPANEL_CREATE_LOG_FILE
= B_TRANSLATE("Create PoorMan log");
const char* STR_TAB_ADVANCED
= B_TRANSLATE("Advanced");
+1 -4
View File
@@ -44,8 +44,7 @@ const int32 MSG_LOG = 'logg';
// PoorMan Window
extern const char* STR_APP_SIG;
extern const char* STR_APP_NAME;
extern const char* STR_ERR_WEB_DIR; // Alert Box
extern const char* STR_ERR_CANT_START;
extern const char* STR_ERR_CANT_START; // Alert Box
extern const char* STR_DIR_CREATED;
extern const char* STR_MNU_FILE;
@@ -68,7 +67,6 @@ extern const char* STR_TXT_VIEW;
// ------------------------------------------------------
// Preferences Window
extern char* STR_WIN_NAME_PREF;
extern const char* STR_SETTINGS_FILE_NAME;
extern const char* STR_DEFAULT_WEB_DIRECTORY;
@@ -89,7 +87,6 @@ extern const char* STR_BBX_FILE_LOGGING;
extern const char* STR_CBX_LOG_FILE;
extern const char* STR_TXT_LOG_FILE_NAME;
extern const char* STR_BTN_CREATE_LOG_FILE;
extern const char* STR_FILEPANEL_CREATE_LOG_FILE;
extern const char* STR_TAB_ADVANCED;
extern const char* STR_BBX_CONNECTION;
+8 -6
View File
@@ -106,9 +106,10 @@ PowerStatus::ReadyToRun()
if (ACPIDriverInterface().Connect() != B_OK) {
if (APMDriverInterface().Connect() != B_OK) {
BAlert* alert = new BAlert("",
B_TRANSLATE("No supported battery detected. PowerStatus "
"cannot be used on your system."), B_TRANSLATE("Too bad!"),
BString text(B_TRANSLATE("No supported battery detected. %appname% "
"cannot be used on your system."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("PowerStatus"));
BAlert* alert = new BAlert("", text, B_TRANSLATE("Too bad!"),
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
if (!fAutoInstallInDeskbar)
alert->Go();
@@ -131,9 +132,10 @@ PowerStatus::ReadyToRun()
}
if (isDeskbarRunning && !isInstalled) {
BAlert* alert = new BAlert("",
B_TRANSLATE("You can run PowerStatus in a window "
"or install it in the Deskbar."), B_TRANSLATE("Run in window"),
BString text(B_TRANSLATE("You can run %appname% in a window "
"or install it in the Deskbar."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("PowerStatus"));
BAlert* alert = new BAlert("", text, B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
+7 -5
View File
@@ -72,9 +72,10 @@ PCApplication::ReadyToRun()
BDeskbar deskbar;
if (!deskbar.HasItem(kDeskbarItemName)) {
// We're not yet installed in the Deskbar, ask if we should
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"),
BString text(B_TRANSLATE("You can run %appname% in a window"
" or install it in the Deskbar."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("ProcessController"));
BAlert* alert = new BAlert(B_TRANSLATE("Info"), text, B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
@@ -86,8 +87,9 @@ PCApplication::ReadyToRun()
return;
}
} else {
BAlert* alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("ProcessController is already installed in Deskbar."),
BString text(B_TRANSLATE("%appname% is already installed in Deskbar."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("ProcessController"));
BAlert* alert = new BAlert(B_TRANSLATE("Info"), text,
B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
@@ -915,10 +915,9 @@ thread_popup(void *arg)
addtopbottom(new BSeparatorItem ());
}
item = new IconMenuItem(gPCView->fProcessControllerIcon,
B_TRANSLATE("About ProcessController" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED));
BString text(B_TRANSLATE("About %appname%" B_UTF8_ELLIPSIS));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("ProcessController"));
item = new IconMenuItem(gPCView->fProcessControllerIcon, text, new BMessage(B_ABOUT_REQUESTED));
item->SetTarget(gPCView);
addtopbottom(item);
+3 -2
View File
@@ -199,8 +199,9 @@ CPUButton::MouseDown(BPoint point)
} else if ((B_SECONDARY_MOUSE_BUTTON & mouseButtons) != 0
&& fReplicantInDeskbar) {
BPopUpMenu *menu = new BPopUpMenu(B_TRANSLATE("Deskbar menu"));
menu->AddItem(new BMenuItem(B_TRANSLATE("About Pulse" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED)));
BString menuLabel(B_TRANSLATE("About %appname%" B_UTF8_ELLIPSIS));
menuLabel.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Pulse"));
menu->AddItem(new BMenuItem(menuLabel, new BMessage(B_ABOUT_REQUESTED)));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Remove replicant"),
new BMessage(kDeleteReplicant)));
+1 -1
View File
@@ -75,7 +75,7 @@ NormalPulseView::NormalPulseView(BRect rect)
CPUBUTTON_MTOP + ITEM_OFFSET * x + CPUBUTTON_HEIGHT + 7);
char temp[4];
snprintf(temp, sizeof(temp), "%hhd", int8(x + 1));
fCpuButtons[x] = new CPUButton(r, B_TRANSLATE("Pulse"), temp, NULL);
fCpuButtons[x] = new CPUButton(r, B_TRANSLATE_SYSTEM_NAME("Pulse"), temp, NULL);
AddChild(fCpuButtons[x]);
}
+1 -2
View File
@@ -219,8 +219,7 @@ PulseApp::MessageReceived(BMessage* message)
void
PulseApp::AboutRequested()
{
BString name = B_TRANSLATE("Pulse");
BString name = B_TRANSLATE_SYSTEM_NAME("Pulse");
BString message = B_TRANSLATE(
"%s\n\nBy David Ramsey and Arve Hjønnevåg\n"
"Revised by Daniel Switkin\n");
+3 -2
View File
@@ -71,8 +71,9 @@ void PulseView::Init() {
mode2 = new BMenuItem("", NULL, 0, 0);
preferences = new BMenuItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS),
new BMessage(PV_PREFERENCES), 0, 0);
about = new BMenuItem(B_TRANSLATE("About Pulse" B_UTF8_ELLIPSIS),
new BMessage(PV_ABOUT), 0, 0);
BString menuLabel(B_TRANSLATE("About %appname%" B_UTF8_ELLIPSIS));
menuLabel.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Pulse"));
about = new BMenuItem(menuLabel, new BMessage(PV_ABOUT), 0, 0);
popupmenu->AddItem(mode1);
popupmenu->AddItem(mode2);
+2 -1
View File
@@ -129,8 +129,9 @@ CheckManager::HandleProblems()
}
BString title(B_TRANSLATE("Available updates found"));
BString text(B_TRANSLATE("Click here to run SoftwareUpdater. Some updates "
BString text(B_TRANSLATE("Click here to run %appname%. Some updates "
"will require a problem solution to be selected."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("SoftwareUpdater"));
_SendNotification(title, text);
throw BAbortedByUserException();
+3 -2
View File
@@ -125,8 +125,9 @@ TermApp::ReadyToRun()
// failed spawn, print stdout and open alert panel
if (status < B_OK) {
BAlert* alert = new BAlert("alert",
B_TRANSLATE("Terminal couldn't start the shell. Sorry."),
BString text(B_TRANSLATE("%appname% couldn't start the shell. Sorry."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Terminal"));
BAlert* alert = new BAlert("alert", text,
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
+10 -7
View File
@@ -377,7 +377,7 @@ TermWindow::_CanClose(int32 index)
// the terminal will be closed.
alertMessage = index == -1 || fSessions.CountItems() == 1
? B_TRANSLATE("The process \"%1\" is still running.\n"
"If you close the Terminal, the process will be killed.")
"If you close %appname%, the process will be killed.")
: B_TRANSLATE("The process \"%1\" is still running.\n"
"If you close the tab, the process will be killed.");
} else {
@@ -385,9 +385,9 @@ TermWindow::_CanClose(int32 index)
alertMessage = B_TRANSLATE(
"The following processes are still running:\n\n"
"\t%1\n\n"
"If you close the Terminal, the processes will be killed.");
"If you close %appname%, the processes will be killed.");
}
alertMessage.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Terminal"));
alertMessage.ReplaceFirst("%1", busyProcessNames);
BAlert* alert = new BAlert(B_TRANSLATE("Really close?"),
@@ -498,13 +498,16 @@ TermWindow::_SetupMenu()
if (fEncodingMenu != NULL)
MakeEncodingMenu(fEncodingMenu);
BString newTerminal(B_TRANSLATE("New %appname%"));
newTerminal.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("Terminal"));
BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
// Terminal
.AddMenu(B_TRANSLATE_COMMENT("Terminal", "The title for the main window"
" menubar entry related to terminal sessions"))
.AddItem(B_TRANSLATE("Switch Terminals"), MENU_SWITCH_TERM, B_TAB)
.AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal"))
.AddItem(B_TRANSLATE_COMMENT("Switch Terminals", "'Terminals' being this application's "
"name"), MENU_SWITCH_TERM, B_TAB)
.GetItem(fSwitchTerminalsMenuItem)
.AddItem(B_TRANSLATE("New Terminal"), MENU_NEW_TERM, 'N')
.AddItem(newTerminal, MENU_NEW_TERM, 'N')
.AddItem(B_TRANSLATE("New tab"), kNewTab, 'T')
.AddSeparator()
.AddItem(B_TRANSLATE("Page setup" B_UTF8_ELLIPSIS), MENU_PAGE_SETUP)
+9 -7
View File
@@ -88,10 +88,11 @@ BrowserApp::BrowserApp()
get_cpuid(&info, 1, 0);
if ((info.eax_1.features & (1 << 26)) == 0) {
BAlert alert(B_TRANSLATE("No SSE2 support"), B_TRANSLATE("Your CPU is "
BString text(B_TRANSLATE("Your CPU is "
"too old and does not support the SSE2 extensions, without which "
"WebPositive cannot run. We recommend installing NetSurf instead."),
B_TRANSLATE("Darn!"));
"%appname% cannot run. We recommend installing NetSurf instead."));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("WebPositive"));
BAlert alert(B_TRANSLATE("No SSE2 support"), text, B_TRANSLATE("Darn!"));
alert.Go();
exit(-1);
}
@@ -388,10 +389,11 @@ bool
BrowserApp::QuitRequested()
{
if (fDownloadWindow->DownloadsInProgress()) {
BAlert* alert = new BAlert(B_TRANSLATE("Downloads in progress"),
B_TRANSLATE("There are still downloads in progress, do you really "
"want to quit WebPositive now?"), B_TRANSLATE("Quit"),
B_TRANSLATE("Continue downloads"));
BString text(B_TRANSLATE("There are still downloads in progress, do you really "
"want to quit %appname% now?"));
text.ReplaceFirst("%appname%", B_TRANSLATE_SYSTEM_NAME("WebPositive"));
BAlert* alert = new BAlert(B_TRANSLATE("Downloads in progress"), text,
B_TRANSLATE("Quit"), B_TRANSLATE("Continue downloads"));
int32 choice = alert->Go();
if (choice == 1) {
if (fWindowCount == 0) {
@@ -631,7 +631,7 @@ DownloadProgressView::DownloadFinished()
fStatusBar->SetBarColor(ui_color(B_SUCCESS_COLOR));
BNotification success(B_INFORMATION_NOTIFICATION);
success.SetGroup(B_TRANSLATE("WebPositive"));
success.SetGroup(B_TRANSLATE_SYSTEM_NAME("WebPositive"));
success.SetTitle(B_TRANSLATE("Download finished"));
success.SetContent(fPath.Leaf());
BEntry entry(fPath.Path());
@@ -654,7 +654,7 @@ DownloadProgressView::CancelDownload()
// Also cancel the download
fDownload->Cancel();
BNotification success(B_ERROR_NOTIFICATION);
success.SetGroup(B_TRANSLATE("WebPositive"));
success.SetGroup(B_TRANSLATE_SYSTEM_NAME("WebPositive"));
success.SetTitle(B_TRANSLATE("Download aborted"));
success.SetContent(fPath.Leaf());
// Don't make a click on the notification open the file: it is not
+2 -1
View File
@@ -94,7 +94,8 @@ BluetoothApplication::MessageReceived(BMessage* message)
void
BluetoothApplication::AboutRequested()
{
BAboutWindow* about = new BAboutWindow("Bluetooth", BLUETOOTH_APP_SIGNATURE);
BAboutWindow* about = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME("Bluetooth"),
BLUETOOTH_APP_SIGNATURE);
about->AddCopyright(2010, "Oliver Ruiz Dorantes");
about->AddText(B_TRANSLATE(
"With support of:\n"
+1 -1
View File
@@ -393,7 +393,7 @@ FileTypes::MessageReceived(BMessage* message)
if (message->FindMessenger("target", &target) != B_OK)
target = be_app_messenger;
BString title = B_TRANSLATE("FileTypes");
BString title = B_TRANSLATE_SYSTEM_NAME("FileTypes");
if (subTitle != NULL && subTitle[0]) {
title.Append(": ");
title.Append(subTitle);
+1 -1
View File
@@ -21,7 +21,7 @@
#define B_TRANSLATION_CONTEXT "Locale Preflet"
const char* kAppName = B_TRANSLATE("Locale");
const char* kAppName = B_TRANSLATE_SYSTEM_NAME("Locale");
const char* kSignature = "application/x-vnd.Haiku-Locale";
+1 -1
View File
@@ -440,7 +440,7 @@ LocaleWindow::MessageReceived(BMessage* message)
MutableLocaleRoster::Default()->SetFilesystemTranslationPreferred(
value == B_CONTROL_ON);
BAlert* alert = new BAlert(B_TRANSLATE("Locale"),
BAlert* alert = new BAlert(B_TRANSLATE_SYSTEM_NAME("Locale"),
B_TRANSLATE("Deskbar and Tracker need to be restarted for this "
"change to take effect. Would you like to restart them now?"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Restart"), NULL,
+2 -1
View File
@@ -308,9 +308,10 @@ bool
MediaWindow::QuitRequested()
{
if (fRestartThread > 0) {
BString text(B_TRANSLATE("Quitting Media now will stop the "
BString text(B_TRANSLATE("Quitting %prefname% now will stop the "
"restarting of the media services. Flaky or unavailable media "
"functionality is the likely result."));
text.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Media"));
fRestartAlert = new BAlert(B_TRANSLATE("Warning!"), text,
B_TRANSLATE("Quit anyway"), NULL, NULL,
+5 -2
View File
@@ -253,10 +253,13 @@ PrefletWin::_DefaultsPossible()
void
PrefletWin::_SendExampleNotification()
{
BString title(B_TRANSLATE("%prefname% preflet sample"));
title.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Notifications"));
BNotification notification(B_INFORMATION_NOTIFICATION);
notification.SetMessageID(kSampleMessageID);
notification.SetGroup(B_TRANSLATE("Notifications"));
notification.SetTitle(B_TRANSLATE("Notifications preflet sample"));
notification.SetGroup(B_TRANSLATE_SYSTEM_NAME("Notifications"));
notification.SetTitle(title);
notification.SetContent(B_TRANSLATE("This is a test notification message"));
notification.Send();
}
@@ -592,9 +592,10 @@ RepositoriesView::_UpdateListFromRoster()
BPackageKit::BPackageRoster pRoster;
status_t result = pRoster.GetRepositoryNames(repositoryNames);
if (result != B_OK) {
(new BAlert("error",
B_TRANSLATE_COMMENT("Repositories could not retrieve the names of "
"the currently enabled repositories.", "Alert error message"),
BString text(B_TRANSLATE_COMMENT("%prefname% could not retrieve the names of "
"the currently enabled repositories.", "Alert error message"));
text.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Repositories"));
(new BAlert("error", text,
kOKLabel, NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
return;
}
+11 -10
View File
@@ -284,10 +284,10 @@ ShortcutsWindow::QuitRequested()
// up the file requester
if (fLastSaved.InitCheck() == B_OK) {
if (_SaveKeySet(fLastSaved) == false) {
BAlert* alert = new BAlert(ERROR,
B_TRANSLATE("Shortcuts was unable to save your "
"KeySet file!"),
B_TRANSLATE("Oh no"));
BString text(B_TRANSLATE("%prefname% was unable to save your "
"KeySet file!"));
text.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Shortcuts"));
BAlert* alert = new BAlert(ERROR, text,B_TRANSLATE("Oh no"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
result = true; // quit anyway
@@ -569,9 +569,10 @@ ShortcutsWindow::MessageReceived(BMessage* message)
_GetSettingsFile(&eref);
if (ref == eref) fKeySetModified = false;
} else {
BAlert* alert = new BAlert(ERROR,
B_TRANSLATE("Shortcuts was unable to parse your "
"KeySet file!"), B_TRANSLATE("OK"));
BString text(B_TRANSLATE("%prefname% was unable to parse your "
"KeySet file!"));
text.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Shortcuts"));
BAlert* alert = new BAlert(ERROR, text, B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
break;
@@ -623,9 +624,9 @@ ShortcutsWindow::MessageReceived(BMessage* message)
// open the save requester...
if (showSaveError) {
BAlert* alert = new BAlert(ERROR,
B_TRANSLATE("Shortcuts wasn't able to save your keyset."),
B_TRANSLATE("OK"));
BString text(B_TRANSLATE("%prefname% wasn't able to save your keyset."));
text.ReplaceFirst("%prefname%", B_TRANSLATE_SYSTEM_NAME("Shortcuts"));
BAlert* alert = new BAlert(ERROR, text, B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
}
+14 -10
View File
@@ -12,6 +12,7 @@
#include "HApp.h"
#include "HWindow.h"
#include <AboutWindow.h>
#include <Alert.h>
#include <Catalog.h>
#include <Locale.h>
@@ -39,16 +40,19 @@ HApp::~HApp()
void
HApp::AboutRequested()
{
BAlert* alert = new BAlert(B_TRANSLATE("About Sounds"),
B_TRANSLATE("Sounds\n"
" Brought to you by :\n"
"\tOliver Ruiz Dorantes\n"
"\tJérôme DUVAL.\n"
" Original work from Atsushi Takamatsu.\n"
"Copyright ©2003-2006 Haiku"),
B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
BAboutWindow* window = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME("Sounds"),
"application/x-vnd.Haiku-Sounds");
const char* authors[] = {
"Atsushi Takamatsu",
"Oliver Ruiz Dorantes",
"Jérôme DUVAL",
NULL
};
window->AddCopyright(2003, "Haiku, Inc.");
window->AddAuthors(authors);
window->Show();
}