Patch by Mike Roll as part of GCI: localize Screen.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40027 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-12-29 10:43:12 +00:00
parent 2813f49667
commit c9e8f97a95
7 changed files with 129 additions and 73 deletions

View File

@ -15,6 +15,7 @@
#include <Window.h>
#include <Bitmap.h>
#include <Button.h>
#include <Catalog.h>
#include <StringView.h>
#include <String.h>
@ -25,6 +26,10 @@
#include <Path.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
AlertView::AlertView(BRect frame, const char *name)
: BView(frame, name, B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED),
// we will wait 12 seconds until we send a message
@ -35,7 +40,7 @@ AlertView::AlertView(BRect frame, const char *name)
BRect rect(60, 8, 400, 36);
BStringView *stringView = new BStringView(rect, NULL,
"Do you wish to keep these settings?");
B_TRANSLATE("Do you wish to keep these settings?"));
stringView->SetFont(be_bold_font);
stringView->ResizeToPreferred();
AddChild(stringView);
@ -47,12 +52,12 @@ AlertView::AlertView(BRect frame, const char *name)
fCountdownView->ResizeToPreferred();
AddChild(fCountdownView);
BButton* keepButton = new BButton(rect, "keep", "Keep",
BButton* keepButton = new BButton(rect, "keep", B_TRANSLATE("Keep"),
new BMessage(BUTTON_KEEP_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
keepButton->ResizeToPreferred();
AddChild(keepButton);
BButton* button = new BButton(rect, "undo", "Undo",
BButton* button = new BButton(rect, "undo", B_TRANSLATE("Undo"),
new BMessage(BUTTON_UNDO_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
button->ResizeToPreferred();
AddChild(button);
@ -129,7 +134,8 @@ void
AlertView::UpdateCountdownView()
{
BString string;
string << "Settings will revert in " << fSeconds << " seconds.";
string << B_TRANSLATE("Settings will revert in %fSeconds seconds.");
string.ReplaceAll(%fSeconds, fSeconds);
fCountdownView->SetText(string.String());
}

View File

@ -12,12 +12,17 @@
#include "AlertView.h"
#include "Constants.h"
#include <Catalog.h>
#include <Window.h>
#include <Screen.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
AlertWindow::AlertWindow(BMessenger target)
: BWindow(BRect(100.0, 100.0, 400.0, 193.0), "Undo",
: BWindow(BRect(100.0, 100.0, 400.0, 193.0), B_TRANSLATE("Undo"),
B_MODAL_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES),
fTarget(target)

View File

@ -20,7 +20,7 @@ Preference Screen :
ScreenSettings.cpp
ScreenWindow.cpp
Utility.cpp
: be $(TARGET_LIBSUPC++)
: be $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: Screen.rdef
;
@ -28,3 +28,14 @@ if $(TARGET_PLATFORM) = libbe_test {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Screen
: tests!apps ;
}
DoCatalogs Screen :
x-vnd.Haiku-Screen
:
AlertView.cpp
AlertWindow.cpp
RefreshSlider.cpp
RefreshWindow.cpp
ScreenApplication.cpp
ScreenWindow.cpp
;

View File

@ -12,6 +12,7 @@
#include "RefreshSlider.h"
#include "Constants.h"
#include <Catalog.h>
#include <String.h>
#include <Window.h>
@ -19,8 +20,12 @@
#include <stdio.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
RefreshSlider::RefreshSlider(BRect frame, float min, float max, uint32 resizingMode)
: BSlider(frame, "Screen", "Refresh Rate:",
: BSlider(frame, B_TRANSLATE("Screen"), B_TRANSLATE("Refresh Rate:"),
new BMessage(SLIDER_INVOKE_MSG), (int32)rintf(min * 10), (int32)rintf(max * 10),
B_BLOCK_THUMB, resizingMode),
fStatus(new (std::nothrow) char[32])
@ -91,7 +96,7 @@ const char*
RefreshSlider::UpdateText() const
{
if (fStatus != NULL)
snprintf(fStatus, 32, "%.1f Hz", (float)Value() / 10);
snprintf(fStatus, 32, B_TRANSLATE("%.1f Hz"), (float)Value() / 10);
return fStatus;
}

View File

@ -17,13 +17,18 @@
#include <Alert.h>
#include <Application.h>
#include <Button.h>
#include <Catalog.h>
#include <String.h>
#include <StringView.h>
#include <Window.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
RefreshWindow::RefreshWindow(BPoint position, float current, float min, float max)
: BWindow(BRect(0, 0, 300, 200), "Refresh Rate", B_MODAL_WINDOW,
: BWindow(BRect(0, 0, 300, 200), B_TRANSLATE("Refresh Rate"), B_MODAL_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
{
min = ceilf(min);
@ -35,7 +40,7 @@ RefreshWindow::RefreshWindow(BPoint position, float current, float min, float ma
BRect rect = Bounds().InsetByCopy(8, 8);
BStringView* stringView = new BStringView(rect, "info",
"Type or use the left and right arrow keys.");
B_TRANSLATE("Type or use the left and right arrow keys."));
stringView->ResizeToPreferred();
topView->AddChild(stringView);
@ -48,15 +53,16 @@ RefreshWindow::RefreshWindow(BPoint position, float current, float min, float ma
fRefreshSlider->ResizeTo(rect.Width(), height);
topView->AddChild(fRefreshSlider);
BButton* doneButton = new BButton(rect, "DoneButton", "Done",
BButton* doneButton = new BButton(rect, "DoneButton", B_TRANSLATE("Done"),
new BMessage(BUTTON_DONE_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
doneButton->ResizeToPreferred();
doneButton->MoveTo(Bounds().Width() - doneButton->Bounds().Width() - 8,
Bounds().Height() - doneButton->Bounds().Height() - 8);
topView->AddChild(doneButton);
BButton* button = new BButton(doneButton->Frame(), "CancelButton", "Cancel",
new BMessage(B_QUIT_REQUESTED), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
BButton* button = new BButton(doneButton->Frame(), "CancelButton",
B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
button->ResizeToPreferred();
button->MoveBy(-button->Bounds().Width() - 10, 0);
topView->AddChild(button);

View File

@ -16,6 +16,11 @@
#include "Constants.h"
#include <Alert.h>
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
static const char* kAppSignature = "application/x-vnd.Be-SCRN";
@ -32,8 +37,9 @@ ScreenApplication::ScreenApplication()
void
ScreenApplication::AboutRequested()
{
BAlert *aboutAlert = new BAlert("About", "Screen preferences by the Haiku team",
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
BAlert *aboutAlert = new BAlert(B_TRANSLATE("About"),
B_TRANSLATE("Screen preferences by the Haiku team"), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
aboutAlert->SetShortcut(0, B_OK);
aboutAlert->Go();
}

View File

@ -23,6 +23,7 @@
#include <Application.h>
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <Directory.h>
#include <File.h>
#include <FindDirectory.h>
@ -61,6 +62,10 @@
#include "multimon.h" // the usual: DANGER WILL, ROBINSON!
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Screen"
const char* kBackgroundsSignature = "application/x-vnd.Haiku-Backgrounds";
// list of officially supported colour spaces
@ -69,11 +74,11 @@ static const struct {
int32 bits_per_pixel;
const char* label;
} kColorSpaces[] = {
{ B_CMAP8, 8, "8 bits/pixel, 256 colors" },
{ B_RGB15, 15, "15 bits/pixel, 32768 colors" },
{ B_RGB16, 16, "16 bits/pixel, 65536 colors" },
{ B_RGB24, 24, "24 bits/pixel, 16 Million colors" },
{ B_RGB32, 32, "32 bits/pixel, 16 Million colors" }
{ B_CMAP8, 8, B_TRANSATE("8 bits/pixel, 256 colors") },
{ B_RGB15, 15, B_TRANSLATE("15 bits/pixel, 32768 colors") },
{ B_RGB16, 16, B_TRANSLATE("16 bits/pixel, 65536 colors") },
{ B_RGB24, 24, B_TRANSLATE("24 bits/pixel, 16 Million colors") },
{ B_RGB32, 32, B_TRANSLATE("32 bits/pixel, 16 Million colors") }
};
static const int32 kColorSpaceCount
= sizeof(kColorSpaces) / sizeof(kColorSpaces[0]);
@ -88,9 +93,9 @@ static const struct {
combine_mode mode;
const char *name;
} kCombineModes[] = {
{ kCombineDisable, "disable" },
{ kCombineHorizontally, "horizontally" },
{ kCombineVertically, "vertically" }
{ kCombineDisable, B_TRANSLATE("disable") },
{ kCombineHorizontally, B_TRANSLATE("horizontally") },
{ kCombineVertically, B_TRANSLATE("vertically") }
};
static const int32 kCombineModeCount
= sizeof(kCombineModes) / sizeof(kCombineModes[0]);
@ -137,7 +142,7 @@ refresh_rate_to_string(float refresh, BString &string,
string.UnlockBuffer();
if (appendUnit)
string << " Hz";
string << B_TRANSLATE(" Hz");
}
@ -146,7 +151,7 @@ screen_errors(status_t status)
{
switch (status) {
case B_ENTRY_NOT_FOUND:
return "Unknown mode";
return B_TRANSLATE("Unknown mode");
// TODO: add more?
default:
@ -160,7 +165,7 @@ screen_errors(status_t status)
ScreenWindow::ScreenWindow(ScreenSettings* settings)
:
BWindow(settings->WindowFrame(), "Screen", B_TITLED_WINDOW,
BWindow(settings->WindowFrame(), B_TRANSLATE("Screen"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
B_ALL_WORKSPACES),
fBootWorkspaceApplied(false),
@ -183,11 +188,12 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
// we need the "Current Workspace" first to get its height
BPopUpMenu *popUpMenu = new BPopUpMenu("Current workspace", true, true);
fAllWorkspacesItem = new BMenuItem("All workspaces",
BPopUpMenu *popUpMenu = new BPopUpMenu(B_TRANSLATE("Current workspace"),
true, true);
fAllWorkspacesItem = new BMenuItem(B_TRANSLATE("All workspaces"),
new BMessage(WORKSPACE_CHECK_MSG));
popUpMenu->AddItem(fAllWorkspacesItem);
BMenuItem *item = new BMenuItem("Current workspace",
BMenuItem *item = new BMenuItem(B_TRANSLATE("Current workspace"),
new BMessage(WORKSPACE_CHECK_MSG));
popUpMenu->AddItem(item);
@ -207,17 +213,18 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
fMonitorInfo = new BStringView("monitor info", "");
screenBox->AddChild(fMonitorInfo);
fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0), "monitor",
screen.Frame().IntegerWidth() + 1, screen.Frame().IntegerHeight() + 1);
fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0),
B_TRANSLATE("monitor"), screen.Frame().IntegerWidth() + 1,
screen.Frame().IntegerHeight() + 1);
screenBox->AddChild(fMonitorView);
fColumnsControl = new BTextControl("Columns:", "0",
fColumnsControl = new BTextControl(B_TRANSLATE("Columns:"), "0",
new BMessage(kMsgWorkspaceColumnsChanged));
fRowsControl = new BTextControl("Rows:", "0",
fRowsControl = new BTextControl(B_TRANSLATE("Rows:"), "0",
new BMessage(kMsgWorkspaceRowsChanged));
screenBox->AddChild(BLayoutBuilder::Grid<>(5.0, 5.0)
.Add(new BStringView("", "Workspaces"), 0, 0, 3)
.Add(new BStringView("", B_TRANSLATE("Workspaces")), 0, 0, 3)
.AddTextControl(fColumnsControl, 0, 1, B_ALIGN_RIGHT)
.AddGroup(B_HORIZONTAL, 0, 2, 1)
.Add(_CreateColumnRowButton(true, false))
@ -231,7 +238,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
.View());
fBackgroundsButton = new BButton("BackgroundsButton",
"Set background" B_UTF8_ELLIPSIS,
B_TRANSLATE("Set background" B_UTF8_ELLIPSIS),
new BMessage(BUTTON_LAUNCH_BACKGROUNDS_MSG));
fBackgroundsButton->SetFontSize(be_plain_font->Size() * 0.9);
screenBox->AddChild(fBackgroundsButton);
@ -244,7 +251,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
outerControlsView->GroupLayout()->SetInsets(10, 10, 10, 10);
controlsBox->AddChild(outerControlsView);
fResolutionMenu = new BPopUpMenu("resolution", true, true);
fResolutionMenu = new BPopUpMenu(B_TRANSLATE("resolution"), true, true);
uint16 maxWidth = 0;
uint16 maxHeight = 0;
@ -275,10 +282,10 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
fMonitorView->SetMaxResolution(maxWidth, maxHeight);
fResolutionField = new BMenuField("ResolutionMenu", "Resolution:",
fResolutionMenu, NULL);
fResolutionField = new BMenuField("ResolutionMenu",
B_TRANSLATE("Resolution:"), fResolutionMenu, NULL);
fColorsMenu = new BPopUpMenu("colors", true, false);
fColorsMenu = new BPopUpMenu(B_TRANSLATE("colors"), true, false);
for (int32 i = 0; i < kColorSpaceCount; i++) {
if ((fSupportedColorSpaces & (1 << i)) == 0)
@ -295,9 +302,10 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
fColorsMenu->AddItem(item);
}
fColorsField = new BMenuField("ColorsMenu", "Colors:", fColorsMenu, NULL);
fColorsField = new BMenuField("ColorsMenu", B_TRANSLATE("Colors:"),
fColorsMenu, NULL);
fRefreshMenu = new BPopUpMenu("refresh rate", true, true);
fRefreshMenu = new BPopUpMenu(B_TRANSLATE("refresh rate"), true, true);
BMessage *message;
@ -306,7 +314,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
// This is a special case for drivers that only support a single
// frequency, like the VESA driver
BString name;
name << min << " Hz";
name << min << B_TRANSLATE(" Hz");
message = new BMessage(POP_REFRESH_MSG);
message->AddFloat("refresh", min);
@ -325,7 +333,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
continue;
BString name;
name << kRefreshRates[i] << " Hz";
name << kRefreshRates[i] << B_TRANSLATE(" Hz");
message = new BMessage(POP_REFRESH_MSG);
message->AddFloat("refresh", kRefreshRates[i]);
@ -335,11 +343,12 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
message = new BMessage(POP_OTHER_REFRESH_MSG);
fOtherRefresh = new BMenuItem("Other" B_UTF8_ELLIPSIS, message);
fOtherRefresh = new BMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS),
message);
fRefreshMenu->AddItem(fOtherRefresh);
}
fRefreshField = new BMenuField("RefreshMenu", "Refresh rate:",
fRefreshField = new BMenuField("RefreshMenu", B_TRANSLATE("Refresh rate:"),
fRefreshMenu, NULL);
if (_IsVesa())
@ -360,7 +369,8 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
// even if there is no support, we still create all controls
// to make sure we don't access NULL pointers later on
fCombineMenu = new BPopUpMenu("CombineDisplays", true, true);
fCombineMenu = new BPopUpMenu(B_TRANSLATE("CombineDisplays"),
true, true);
for (int32 i = 0; i < kCombineModeCount; i++) {
message = new BMessage(POP_COMBINE_DISPLAYS_MSG);
@ -371,46 +381,50 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
}
fCombineField = new BMenuField("CombineMenu",
"Combine displays:", fCombineMenu, NULL);
B_TRANSLATE("Combine displays:"), fCombineMenu, NULL);
if (!multiMonSupport)
fCombineField->Hide();
fSwapDisplaysMenu = new BPopUpMenu("SwapDisplays", true, true);
fSwapDisplaysMenu = new BPopUpMenu(B_TRANSLATE("SwapDisplays"),
true, true);
// !order is important - we rely that boolean value == idx
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
message->AddBool("swap", false);
fSwapDisplaysMenu->AddItem(new BMenuItem("no", message));
fSwapDisplaysMenu->AddItem(new BMenuItem(B_TRANSLATE("no"), message));
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
message->AddBool("swap", true);
fSwapDisplaysMenu->AddItem(new BMenuItem("yes", message));
fSwapDisplaysMenu->AddItem(new BMenuItem(B_TRANSLATE("yes"), message));
fSwapDisplaysField = new BMenuField("SwapMenu", "Swap displays:",
fSwapDisplaysMenu, NULL);
fSwapDisplaysField = new BMenuField("SwapMenu",
B_TRANSLATE("Swap displays:"), fSwapDisplaysMenu, NULL);
if (!multiMonSupport)
fSwapDisplaysField->Hide();
fUseLaptopPanelMenu = new BPopUpMenu("UseLaptopPanel", true, true);
fUseLaptopPanelMenu = new BPopUpMenu(B_TRANSLATE("UseLaptopPanel"),
true, true);
// !order is important - we rely that boolean value == idx
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
message->AddBool("use", false);
fUseLaptopPanelMenu->AddItem(new BMenuItem("if needed", message));
fUseLaptopPanelMenu->AddItem(new BMenuItem(B_TRANSLATE("if needed"),
message));
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
message->AddBool("use", true);
fUseLaptopPanelMenu->AddItem(new BMenuItem("always", message));
fUseLaptopPanelMenu->AddItem(new BMenuItem(B_TRANSLATE("always"),
message));
fUseLaptopPanelField = new BMenuField("UseLaptopPanel",
"Use laptop panel:", fUseLaptopPanelMenu, NULL);
B_TRANSLATE("Use laptop panel:"), fUseLaptopPanelMenu, NULL);
if (!useLaptopPanelSupport)
fUseLaptopPanelField->Hide();
fTVStandardMenu = new BPopUpMenu("TVStandard", true, true);
fTVStandardMenu = new BPopUpMenu(B_TRANSLATE("TVStandard"), true, true);
// arbitrary limit
uint32 i;
@ -427,8 +441,8 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
fTVStandardMenu->AddItem(new BMenuItem(name.String(), message));
}
fTVStandardField = new BMenuField("tv standard", "Video format:",
fTVStandardMenu, NULL);
fTVStandardField = new BMenuField("tv standard",
B_TRANSLATE("Video format:"), fTVStandardMenu, NULL);
fTVStandardField->SetAlignment(B_ALIGN_RIGHT);
if (!tvStandardSupport || i == 0)
@ -450,7 +464,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
/* fDefaultsButton = new BButton(buttonRect, "DefaultsButton", "Defaults",
new BMessage(BUTTON_DEFAULTS_MSG));*/
fApplyButton = new BButton("ApplyButton", "Apply",
fApplyButton = new BButton("ApplyButton", B_TRANSLATE("Apply"),
new BMessage(BUTTON_APPLY_MSG));
fApplyButton->SetEnabled(false);
BLayoutBuilder::Group<>(outerControlsView)
@ -459,7 +473,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
.AddGlue()
.Add(fApplyButton);
fRevertButton = new BButton("RevertButton", "Revert",
fRevertButton = new BButton("RevertButton", B_TRANSLATE("Revert"),
new BMessage(BUTTON_REVERT_MSG));
fRevertButton->SetEnabled(false);
@ -497,10 +511,11 @@ ScreenWindow::QuitRequested()
if (fBootWorkspaceApplied && fScreenMode.Get(vesaMode, 0) == B_OK) {
status_t status = _WriteVesaModeFile(vesaMode);
if (status < B_OK) {
BString warning = "Could not write VESA mode settings file:\n\t";
BString warning = B_TRANSLATE("Could not write VESA mode settings"
" file:\n\t");
warning << strerror(status);
(new BAlert("VesaAlert", warning.String(), "OK", NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
(new BAlert("VesaAlert", warning.String(), B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
}
}
@ -656,7 +671,7 @@ ScreenWindow::_UpdateRefreshControl()
item->SetMarked(true);
// "Other…" items only contains a refresh rate when active
fOtherRefresh->SetLabel("Other" B_UTF8_ELLIPSIS);
fOtherRefresh->SetLabel(B_TRANSLATE("Other" B_UTF8_ELLIPSIS_);
return;
}
@ -667,7 +682,7 @@ ScreenWindow::_UpdateRefreshControl()
fRefreshMenu->Superitem()->SetLabel(string.String());
string.Append("/other" B_UTF8_ELLIPSIS);
string.Append(B_TRANSLATE("/other" B_UTF8_ELLIPSIS));
fOtherRefresh->SetLabel(string.String());
}
@ -928,7 +943,7 @@ ScreenWindow::MessageReceived(BMessage* message)
case POP_REFRESH_MSG:
{
message->FindFloat("refresh", &fSelected.refresh);
fOtherRefresh->SetLabel("Other" B_UTF8_ELLIPSIS);
fOtherRefresh->SetLabel(B_TRANSLATE("Other" B_UTF8_ELLIPSIS));
// revert "Other…" label - it might have a refresh rate prefix
_CheckApplyEnabled();
@ -1193,16 +1208,16 @@ ScreenWindow::_UpdateMonitor()
&& info.min_vertical_frequency != 0
&& info.max_pixel_clock != 0) {
length = snprintf(text, sizeof(text),
"Horizonal frequency:\t%lu - %lu kHz\n"
B_TRANSLATE("Horizonal frequency:\t%lu - %lu kHz\n"
"Vertical frequency:\t%lu - %lu Hz\n\n"
"Maximum pixel clock:\t%g MHz",
"Maximum pixel clock:\t%g MHz"),
info.min_horizontal_frequency, info.max_horizontal_frequency,
info.min_vertical_frequency, info.max_vertical_frequency,
info.max_pixel_clock / 1000.0);
}
if (info.serial_number[0] && length < sizeof(text)) {
length += snprintf(text + length, sizeof(text) - length,
"%sSerial no.: %s", length ? "\n\n" : "",
B_TRANSLATE("%sSerial no.: %s"), length ? "\n\n" : "",
info.serial_number);
if (info.produced.week != 0 && info.produced.year != 0
&& length < sizeof(text)) {
@ -1237,7 +1252,7 @@ void
ScreenWindow::_UpdateColorLabel()
{
BString string;
string << fSelected.BitsPerPixel() << " bits/pixel";
string << fSelected.BitsPerPixel() << B_TRANSLATE(" bits/pixel");
fColorsMenu->Superitem()->SetLabel(string.String());
}
@ -1277,8 +1292,10 @@ ScreenWindow::_Apply()
} else {
char message[256];
snprintf(message, sizeof(message),
"The screen mode could not be set:\n\t%s\n", screen_errors(status));
BAlert* alert = new BAlert("Screen Alert", message, "OK", NULL, NULL,
B_TRANSLATE("The screen mode could not be set:\n\t%s\n"),
screen_errors(status));
BAlert* alert = new BAlert(B_TRANSLATE("Screen Alert"), message,
B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go();
}