Updated to use B_TRANSLATE* macros. relates to #5408.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36690 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -68,7 +68,8 @@ SettingsView::SettingsView (bool isVideo)
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
|
||||
BBox *defaultsBox = new BBox("defaults");
|
||||
defaultsBox->SetLabel(fIsVideo ? TR("Default nodes") : TR("Defaults"));
|
||||
defaultsBox->SetLabel(fIsVideo ? B_TRANSLATE("Default nodes")
|
||||
: B_TRANSLATE("Defaults"));
|
||||
|
||||
// create the default box
|
||||
BGroupLayout* defaultBoxLayout = new BGroupLayout(B_VERTICAL, 5);
|
||||
@@ -81,18 +82,20 @@ SettingsView::SettingsView (bool isVideo)
|
||||
defaultsBox->GetLayout()->AddView(inputField);
|
||||
defaultsBox->GetLayout()->AddView(outputField);
|
||||
|
||||
float divider = StringWidth(fIsVideo ? TR("Video output:")
|
||||
: TR("Audio output:")) + 5;
|
||||
float divider = StringWidth(fIsVideo ? B_TRANSLATE("Video output:")
|
||||
: B_TRANSLATE("Audio output:")) + 5;
|
||||
fMenu1 = new BPopUpMenu("<none>");
|
||||
fMenu1->SetLabelFromMarked(true);
|
||||
BMenuField *menuField1 = new BMenuField("menuField1",
|
||||
fIsVideo ? TR("Video input:") : TR("Audio input:"), fMenu1, NULL);
|
||||
fIsVideo ? B_TRANSLATE("Video input:")
|
||||
: B_TRANSLATE("Audio input:"), fMenu1, NULL);
|
||||
menuField1->SetDivider(divider);
|
||||
|
||||
fMenu2 = new BPopUpMenu("<none>");
|
||||
fMenu2->SetLabelFromMarked(true);
|
||||
BMenuField *menuField2 = new BMenuField("menuField2",
|
||||
fIsVideo ? TR("Video output:") : TR("Audio output:"), fMenu2, NULL);
|
||||
fIsVideo ? B_TRANSLATE("Video output:")
|
||||
: B_TRANSLATE("Audio output:"), fMenu2, NULL);
|
||||
menuField2->SetDivider(divider);
|
||||
|
||||
inputField->GroupLayout()->AddView(menuField1);
|
||||
@@ -103,26 +106,27 @@ SettingsView::SettingsView (bool isVideo)
|
||||
fMenu3 = new BPopUpMenu("<none>");
|
||||
fMenu3->SetLabelFromMarked(true);
|
||||
menuField3 = new BMenuField("menuField3",
|
||||
TR("Channel:"), fMenu3, NULL);
|
||||
B_TRANSLATE("Channel:"), fMenu3, NULL);
|
||||
outputField->GroupLayout()->AddView(menuField3);
|
||||
menuField3->SetDivider(StringWidth(TR("Channel:"))+5);
|
||||
menuField3->SetDivider(StringWidth(B_TRANSLATE("Channel:"))+5);
|
||||
}
|
||||
|
||||
rgb_color red_color = {222, 32, 33};
|
||||
fRestartView = new BStringView("restartStringView",
|
||||
TR("Restart the media server to apply changes."));
|
||||
B_TRANSLATE("Restart the media server to apply changes."));
|
||||
fRestartView->SetHighColor(red_color);
|
||||
defaultsBox->AddChild(fRestartView);
|
||||
fRestartView->Hide();
|
||||
|
||||
// create the realtime box
|
||||
BBox *realtimeBox = new BBox("realtime");
|
||||
realtimeBox->SetLabel(TR("Real-time"));
|
||||
realtimeBox->SetLabel(B_TRANSLATE("Real-time"));
|
||||
|
||||
BMessage *message = new BMessage(ML_ENABLE_REAL_TIME);
|
||||
message->AddBool("isVideo", fIsVideo);
|
||||
fRealtimeCheckBox = new BCheckBox("realtimeCheckBox",
|
||||
fIsVideo ? TR("Enable real-time video") : TR("Enable real-time audio"),
|
||||
fIsVideo ? B_TRANSLATE("Enable real-time video")
|
||||
: B_TRANSLATE("Enable real-time audio"),
|
||||
message);
|
||||
|
||||
uint32 flags;
|
||||
@@ -131,11 +135,13 @@ SettingsView::SettingsView (bool isVideo)
|
||||
fRealtimeCheckBox->SetValue(B_CONTROL_ON);
|
||||
|
||||
BTextView *textView = new BTextView("stringView");
|
||||
textView->Insert(fIsVideo ? TR("Enabling real-time video allows system to "
|
||||
textView->Insert(fIsVideo ? B_TRANSLATE(
|
||||
"Enabling real-time video allows system to "
|
||||
"perform video operations as fast and smoothly as possible. It "
|
||||
"achieves optimum performance by using more RAM."
|
||||
"\n\nOnly enable this feature if you need the lowest latency possible.")
|
||||
: TR("Enabling real-time audio allows system to record and play audio "
|
||||
: B_TRANSLATE(
|
||||
"Enabling real-time audio allows system to record and play audio "
|
||||
"as fast as possible. It achieves this performance by using more CPU and RAM."
|
||||
"\n\nOnly enable this feature if you need the lowest latency possible."));
|
||||
textView->MakeEditable(false);
|
||||
@@ -153,11 +159,13 @@ SettingsView::SettingsView (bool isVideo)
|
||||
// create the bottom line: volumen in deskbar checkbox and restart button
|
||||
BGroupView* bottomView = new BGroupView(B_HORIZONTAL);
|
||||
BButton *restartButton = new BButton("restartButton",
|
||||
TR("Restart media services"), new BMessage(ML_RESTART_MEDIA_SERVER));
|
||||
B_TRANSLATE("Restart media services"),
|
||||
new BMessage(ML_RESTART_MEDIA_SERVER));
|
||||
|
||||
if (!fIsVideo) {
|
||||
fVolumeCheckBox = new BCheckBox("volumeCheckBox",
|
||||
TR("Show volume control on Deskbar"), new BMessage(ML_SHOW_VOLUME_CONTROL));
|
||||
B_TRANSLATE("Show volume control on Deskbar"),
|
||||
new BMessage(ML_SHOW_VOLUME_CONTROL));
|
||||
bottomView->GroupLayout()->AddView(fVolumeCheckBox);
|
||||
if (BDeskbar().HasItem("MediaReplicant"))
|
||||
fVolumeCheckBox->SetValue(B_CONTROL_ON);
|
||||
|
||||
@@ -40,7 +40,7 @@ const uint32 ML_INIT_MEDIA = 'MlIM';
|
||||
|
||||
// MediaWindow - Constructor
|
||||
MediaWindow::MediaWindow(BRect frame)
|
||||
: BWindow (frame, TR("Media"), B_TITLED_WINDOW,
|
||||
: BWindow (frame, B_TRANSLATE("Media"), B_TITLED_WINDOW,
|
||||
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||
fCurrentNode(NULL),
|
||||
fParamWeb(NULL),
|
||||
@@ -202,7 +202,7 @@ MediaWindow::InitWindow(void)
|
||||
// StringViews
|
||||
rgb_color titleFontColor = { 0, 0, 0, 0 };
|
||||
fTitleView = new BStringView("AudioSettings",
|
||||
TR("Audio settings"), B_WILL_DRAW);
|
||||
B_TRANSLATE("Audio settings"), B_WILL_DRAW);
|
||||
fTitleView->SetFont(be_bold_font);
|
||||
fTitleView->SetHighColor(titleFontColor);
|
||||
|
||||
@@ -254,15 +254,18 @@ MediaWindow::InitMedia(bool first)
|
||||
|
||||
if (first && err != B_OK) {
|
||||
BAlert *alert = new BAlert("start_media_server",
|
||||
TR("Could not connect to the media server.\n"
|
||||
"Would you like to start it ?"), TR("Quit"),
|
||||
TR("Start media server"), NULL,
|
||||
B_TRANSLATE("Could not connect to the media server.\n"
|
||||
"Would you like to start it ?"),
|
||||
B_TRANSLATE("Quit"),
|
||||
B_TRANSLATE("Start media server"), NULL,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
if (alert->Go()==0)
|
||||
return B_ERROR;
|
||||
|
||||
fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
||||
"restart_alert", TR("Restarting media services\nStarting media server" B_UTF8_ELLIPSIS "\n"));
|
||||
"restart_alert", B_TRANSLATE(
|
||||
"Restarting media services\nStarting media server"
|
||||
B_UTF8_ELLIPSIS "\n"));
|
||||
fAlert->Show();
|
||||
|
||||
Show();
|
||||
@@ -279,7 +282,8 @@ MediaWindow::InitMedia(bool first)
|
||||
if ((!first || (first && err) ) && fAlert) {
|
||||
BAutolock locker(fAlert);
|
||||
if (locker.IsLocked())
|
||||
fAlert->TextView()->SetText(TR("Ready for use" B_UTF8_ELLIPSIS));
|
||||
fAlert->TextView()->SetText(
|
||||
B_TRANSLATE("Ready for use" B_UTF8_ELLIPSIS));
|
||||
}
|
||||
|
||||
void *listItem;
|
||||
@@ -418,7 +422,8 @@ MediaWindow::FrameResized (float width, float height)
|
||||
void
|
||||
ErrorAlert(char* errorMessage) {
|
||||
printf("%s\n", errorMessage);
|
||||
BAlert *alert = new BAlert("BAlert", errorMessage, TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||
BAlert *alert = new BAlert("BAlert", errorMessage, B_TRANSLATE("OK"),
|
||||
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||
alert->Go();
|
||||
exit(1);
|
||||
}
|
||||
@@ -530,13 +535,15 @@ MediaWindow::MessageReceived (BMessage *message)
|
||||
status = deskbar.AddItem(&ref, &id);
|
||||
|
||||
if (status != B_OK) {
|
||||
fprintf(stderr, TR("Couldn't add volume control in Deskbar: %s\n"),
|
||||
fprintf(stderr, B_TRANSLATE(
|
||||
"Couldn't add volume control in Deskbar: %s\n"),
|
||||
strerror(status));
|
||||
}
|
||||
} else {
|
||||
status_t status = deskbar.RemoveItem("MediaReplicant");
|
||||
if (status != B_OK) {
|
||||
fprintf(stderr, TR("Couldn't remove volume control in Deskbar: %s\n"),
|
||||
fprintf(stderr, B_TRANSLATE(
|
||||
"Couldn't remove volume control in Deskbar: %s\n"),
|
||||
strerror(status));
|
||||
}
|
||||
}
|
||||
@@ -614,7 +621,8 @@ MediaWindow::MessageReceived (BMessage *message)
|
||||
fParamWeb = NULL;
|
||||
BRect bounds = fContentView->Bounds();
|
||||
BStringView* stringView = new BStringView(bounds,
|
||||
"noControls", TR("This hardware has no controls."), B_FOLLOW_V_CENTER | B_FOLLOW_H_CENTER);
|
||||
"noControls", B_TRANSLATE("This hardware has no controls."),
|
||||
B_FOLLOW_V_CENTER | B_FOLLOW_H_CENTER);
|
||||
stringView->ResizeToPreferred();
|
||||
fContentView->AddChild(stringView);
|
||||
stringView->MoveBy((bounds.Width()-stringView->Bounds().Width())/2,
|
||||
@@ -637,7 +645,8 @@ MediaWindow::MessageReceived (BMessage *message)
|
||||
&& (strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
|
||||
|| strcmp(mimeSig, "application/x-vnd.Be.media-server")==0)) {
|
||||
fAlert->Lock();
|
||||
fAlert->TextView()->SetText(TR("Starting media server" B_UTF8_ELLIPSIS));
|
||||
fAlert->TextView()->SetText(
|
||||
B_TRANSLATE("Starting media server" B_UTF8_ELLIPSIS));
|
||||
fAlert->Unlock();
|
||||
}
|
||||
}
|
||||
@@ -668,7 +677,8 @@ MediaWindow::RestartMediaServices(void *data)
|
||||
{
|
||||
MediaWindow *window = (MediaWindow *)data;
|
||||
window->fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
||||
"restart_alert", TR("Restarting media services\nShutting down media server\n"));
|
||||
"restart_alert", B_TRANSLATE(
|
||||
"Restarting media services\nShutting down media server\n"));
|
||||
|
||||
window->fAlert->Show();
|
||||
|
||||
@@ -677,7 +687,8 @@ MediaWindow::RestartMediaServices(void *data)
|
||||
{
|
||||
BAutolock locker(window->fAlert);
|
||||
if (locker.IsLocked())
|
||||
window->fAlert->TextView()->SetText(TR("Starting media server" B_UTF8_ELLIPSIS));
|
||||
window->fAlert->TextView()->SetText(
|
||||
B_TRANSLATE("Starting media server" B_UTF8_ELLIPSIS));
|
||||
}
|
||||
launch_media_server();
|
||||
|
||||
@@ -692,19 +703,19 @@ MediaWindow::UpdateProgress(int stage, const char * message, void * cookie)
|
||||
const char *string = "Unknown stage";
|
||||
switch (stage) {
|
||||
case 10:
|
||||
string = TR("Stopping media server" B_UTF8_ELLIPSIS);
|
||||
string = B_TRANSLATE("Stopping media server" B_UTF8_ELLIPSIS);
|
||||
break;
|
||||
case 20:
|
||||
string = TR("Telling media_addon_server to quit.");
|
||||
string = B_TRANSLATE("Telling media_addon_server to quit.");
|
||||
break;
|
||||
case 40:
|
||||
string = TR("Waiting for media_server to quit.");
|
||||
string = B_TRANSLATE("Waiting for media_server to quit.");
|
||||
break;
|
||||
case 70:
|
||||
string = TR("Cleaning up.");
|
||||
string = B_TRANSLATE("Cleaning up.");
|
||||
break;
|
||||
case 100:
|
||||
string = TR("Done shutting down.");
|
||||
string = B_TRANSLATE("Done shutting down.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user