Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36682 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-05-06 23:07:38 +00:00
parent ea8a1f5804
commit 241ad40bd3
7 changed files with 87 additions and 71 deletions
@@ -39,7 +39,8 @@ BluetoothDeviceView::BluetoothDeviceView(BRect frame, BluetoothDevice* bDevice,
bdaddrUtils::ToString(bdaddrUtils::NullAddress()));
fBdaddr->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
fClassService = new BStringView("ServiceClass", TR("Service classes: "));
fClassService = new BStringView("ServiceClass",
B_TRANSLATE("Service classes: "));
fClassService->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_MIDDLE));
@@ -116,7 +117,7 @@ BluetoothDeviceView::SetBluetoothDevice(BluetoothDevice* bDevice)
fName->SetText(bDevice->GetFriendlyName().String());
fBdaddr->SetText(bdaddrUtils::ToString(bDevice->GetBluetoothAddress()));
BString string(TR("Service classes: "));
BString string(B_TRANSLATE("Service classes: "));
bDevice->GetDeviceClass().GetServiceClass(string);
fClassService->SetText(string.String());
+3 -2
View File
@@ -90,7 +90,7 @@ void
BluetoothApplication::AboutRequested()
{
(new BAlert("about", TR("Haiku Bluetooth system, (ARCE)\n\n"
(new BAlert("about", B_TRANSLATE("Haiku Bluetooth system, (ARCE)\n\n"
"Created by Oliver Ruiz Dorantes\n\n"
"With support of:\n"
" - Mika Lindqvist\n"
@@ -119,7 +119,8 @@ BluetoothApplication::AboutRequested()
"Testing:\n"
" - Petter H. Juliussen\n"
"Who gave me all the knowledge:\n"
" - the yellowTAB team"), TR("OK")))->Go();
" - the yellowTAB team"),
B_TRANSLATE("OK")))->Go();
}
@@ -38,15 +38,16 @@ static const int32 kMsgSetDeviceClassSmartPhone = 'sDCp';
static const int32 kMsgSetAverageWeight = 'afEa';
static const int32 kMsgLocalSwitched = 'lDsW';
static const char* kAllLabel = TR_MARK("From all devices");
static const char* kTrustedLabel = TR_MARK("Only from trusted devices");
static const char* kAlwaysLabel = TR_MARK("Always ask");
static const char* kAllLabel = B_TRANSLATE_MARK("From all devices");
static const char* kTrustedLabel =
B_TRANSLATE_MARK("Only from trusted devices");
static const char* kAlwaysLabel = B_TRANSLATE_MARK("Always ask");
static const char* kDesktopLabel = TR_MARK("Desktop");
static const char* kServerLabel = TR_MARK("Server");
static const char* kLaptopLabel = TR_MARK("Laptop");
static const char* kHandheldLabel = TR_MARK("Handheld");
static const char* kPhoneLabel = TR_MARK("Smart phone");
static const char* kDesktopLabel = B_TRANSLATE_MARK("Desktop");
static const char* kServerLabel = B_TRANSLATE_MARK("Server");
static const char* kLaptopLabel = B_TRANSLATE_MARK("Laptop");
static const char* kHandheldLabel = B_TRANSLATE_MARK("Handheld");
static const char* kPhoneLabel = B_TRANSLATE_MARK("Smart phone");
// #pragma mark -
@@ -57,25 +58,27 @@ BluetoothSettingsView::BluetoothSettingsView(const char* name)
{
_BuildConnectionPolicy();
fPolicyMenuField = new BMenuField("antialiasing",
TR("Incoming connections policy:"), fPolicyMenu, NULL);
B_TRANSLATE("Incoming connections policy:"), fPolicyMenu, NULL);
fInquiryTimeControl = new BSlider("time",
TR("Default inquiry time:"), new BMessage(kMsgSetAverageWeight), 0, 255,
B_HORIZONTAL);
fInquiryTimeControl->SetLimitLabels(TR("15 secs"), TR("61 secs"));
B_TRANSLATE("Default inquiry time:"), new BMessage(kMsgSetAverageWeight),
0, 255, B_HORIZONTAL);
fInquiryTimeControl->SetLimitLabels(B_TRANSLATE("15 secs"),
B_TRANSLATE("61 secs"));
fInquiryTimeControl->SetHashMarks(B_HASH_MARKS_BOTTOM);
fInquiryTimeControl->SetHashMarkCount(255 / 15);
fInquiryTimeControl->SetEnabled(true);
// hinting menu
_BuildClassMenu();
fClassMenuField = new BMenuField("class", TR("Identify host as:"),
fClassMenuField = new BMenuField("class", B_TRANSLATE("Identify host as:"),
fClassMenu, NULL);
// localdevices menu
_BuildLocalDevicesMenu();
fLocalDevicesMenuField = new BMenuField("devices",
TR("Local devices found on system:"), fLocalDevicesMenu, NULL);
B_TRANSLATE("Local devices found on system:"),
fLocalDevicesMenu, NULL);
fExtDeviceView = new ExtendedLocalDeviceView(BRect(0, 0, 5, 5), NULL);
@@ -195,23 +198,23 @@ BluetoothSettingsView::MessageReceived(BMessage* message)
void
BluetoothSettingsView::_BuildConnectionPolicy()
{
fPolicyMenu = new BPopUpMenu(TR("Policy..."));
fPolicyMenu = new BPopUpMenu(B_TRANSLATE("Policy..."));
BMessage* message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", false);
BMenuItem* item = new BMenuItem(TR(kAllLabel), message);
BMenuItem* item = new BMenuItem(B_TRANSLATE(kAllLabel), message);
fPolicyMenu->AddItem(item);
message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", true);
item = new BMenuItem(TR(kTrustedLabel), message);
item = new BMenuItem(B_TRANSLATE(kTrustedLabel), message);
fPolicyMenu->AddItem(item);
BMenuItem* item2 = new BMenuItem(TR(kAlwaysLabel), NULL);
BMenuItem* item2 = new BMenuItem(B_TRANSLATE(kAlwaysLabel), NULL);
fPolicyMenu->AddItem(item2);
@@ -222,27 +225,27 @@ void
BluetoothSettingsView::_BuildClassMenu()
{
fClassMenu = new BPopUpMenu(TR("Identify us as..."));
fClassMenu = new BPopUpMenu(B_TRANSLATE("Identify us as..."));
BMessage* message;
message = new BMessage(kMsgSetDeviceClassDesktop);
BMenuItem* item = new BMenuItem(TR(kDesktopLabel), message);
BMenuItem* item = new BMenuItem(B_TRANSLATE(kDesktopLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassServer);
item = new BMenuItem(TR(kServerLabel), message);
item = new BMenuItem(B_TRANSLATE(kServerLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassLaptop);
item = new BMenuItem(TR(kLaptopLabel), message);
item = new BMenuItem(B_TRANSLATE(kLaptopLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassHandheld);
item = new BMenuItem(TR(kHandheldLabel), message);
item = new BMenuItem(B_TRANSLATE(kHandheldLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassSmartPhone);
item = new BMenuItem(TR(kPhoneLabel), message);
item = new BMenuItem(B_TRANSLATE(kPhoneLabel), message);
fClassMenu->AddItem(item);
}
@@ -254,7 +257,7 @@ BluetoothSettingsView::_BuildLocalDevicesMenu()
LocalDevice* lDevice;
if (!fLocalDevicesMenu)
fLocalDevicesMenu = new BPopUpMenu(TR("Pick LocalDevice..."));
fLocalDevicesMenu = new BPopUpMenu(B_TRANSLATE("Pick LocalDevice..."));
for (uint32 index = 0; index < LocalDevice::GetLocalDeviceCount(); index++) {
+22 -17
View File
@@ -33,50 +33,55 @@ LocalDevice* ActiveLocalDevice = NULL;
BluetoothWindow::BluetoothWindow(BRect frame)
: BWindow(frame, TR("Bluetooth"), B_TITLED_WINDOW,
: BWindow(frame, B_TRANSLATE("Bluetooth"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
fDefaultsButton = new BButton("defaults", TR("Defaults"),
fDefaultsButton = new BButton("defaults", B_TRANSLATE("Defaults"),
new BMessage(kMsgSetDefaults), B_WILL_DRAW);
fRevertButton = new BButton("revert", TR("Revert"),
fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(kMsgRevert), B_WILL_DRAW);
// Add the menu bar
fMenubar = new BMenuBar(Bounds(), "menu_bar");
// Add File menu to menu bar
BMenu* menu = new BMenu(TR("Server"));
menu->AddItem(new BMenuItem(TR("Start bluetooth services" B_UTF8_ELLIPSIS),
BMenu* menu = new BMenu(B_TRANSLATE("Server"));
menu->AddItem(new BMenuItem(
B_TRANSLATE("Start bluetooth services" B_UTF8_ELLIPSIS),
new BMessage(kMsgStartServices), 0));
menu->AddItem(new BMenuItem(TR("Stop bluetooth services" B_UTF8_ELLIPSIS),
menu->AddItem(new BMenuItem(
B_TRANSLATE("Stop bluetooth services" B_UTF8_ELLIPSIS),
new BMessage(kMsgStopServices), 0));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Show bluetooth console" B_UTF8_ELLIPSIS),
menu->AddItem(new BMenuItem(
B_TRANSLATE("Show bluetooth console" B_UTF8_ELLIPSIS),
new BMessage(kMsgStartServices), 0));
menu->AddItem(new BMenuItem(TR("Refresh LocalDevices" B_UTF8_ELLIPSIS),
menu->AddItem(new BMenuItem(
B_TRANSLATE("Refresh LocalDevices" B_UTF8_ELLIPSIS),
new BMessage(kMsgRefresh), 0));
fMenubar->AddItem(menu);
menu = new BMenu(TR("View"));
menu->AddItem(new BMenuItem(TR("Connections & channels" B_UTF8_ELLIPSIS),
NULL, 0));
menu->AddItem(new BMenuItem(TR("Remote devices list" B_UTF8_ELLIPSIS),
NULL, 0));
menu = new BMenu(B_TRANSLATE("View"));
menu->AddItem(new BMenuItem(
B_TRANSLATE("Connections & channels" B_UTF8_ELLIPSIS), NULL, 0));
menu->AddItem(new BMenuItem(
B_TRANSLATE("Remote devices list" B_UTF8_ELLIPSIS), NULL, 0));
fMenubar->AddItem(menu);
menu = new BMenu(TR("Help"));
menu->AddItem(new BMenuItem(TR("About Bluetooth" B_UTF8_ELLIPSIS),
menu = new BMenu(B_TRANSLATE("Help"));
menu->AddItem(new BMenuItem(B_TRANSLATE("About Bluetooth" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED), 0));
fMenubar->AddItem(menu);
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
fSettingsView = new BluetoothSettingsView(TR("Settings"));
fSettingsView = new BluetoothSettingsView(B_TRANSLATE("Settings"));
// fConnChan = new ConnChanView("Connections & Channels", B_WILL_DRAW);
fRemoteDevices = new RemoteDevicesView(TR("Remote devices"), B_WILL_DRAW);
fRemoteDevices = new RemoteDevicesView(
B_TRANSLATE("Remote devices"), B_WILL_DRAW);
tabView->AddTab(fRemoteDevices);
// tabView->AddTab(fConnChan);
@@ -33,12 +33,12 @@ ExtendedLocalDeviceView::ExtendedLocalDeviceView(BRect frame,
fDeviceView = new BluetoothDeviceView(BRect(0, 0, 5, 5), bDevice);
fDiscoverable = new BCheckBox(iDontCare, "Discoverable", TR("Discoverable"),
new BMessage(SET_DISCOVERABLE));
fVisible = new BCheckBox(iDontCare, "Visible", TR("Show name"),
new BMessage(SET_VISIBLE));
fAuthentication = new BCheckBox(iDontCare, "Authenticate", TR("Authenticate"),
new BMessage(SET_AUTHENTICATION));
fDiscoverable = new BCheckBox(iDontCare, "Discoverable",
B_TRANSLATE("Discoverable"), new BMessage(SET_DISCOVERABLE));
fVisible = new BCheckBox(iDontCare, "Visible",
B_TRANSLATE("Show name"), new BMessage(SET_VISIBLE));
fAuthentication = new BCheckBox(iDontCare, "Authenticate",
B_TRANSLATE("Authenticate"), new BMessage(SET_AUTHENTICATION));
fDiscoverable->SetEnabled(false);
fVisible->SetEnabled(false);
+19 -13
View File
@@ -102,7 +102,8 @@ InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
fScanProgress = new BStatusBar("status", TR("Scanning progress"), "");
fScanProgress = new BStatusBar("status",
B_TRANSLATE("Scanning progress"), "");
activeColor = fScanProgress->BarColor();
if (fLocalDevice == NULL)
@@ -114,10 +115,10 @@ InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
fMessage->MakeEditable(false);
fMessage->MakeSelectable(false);
fInquiryButton = new BButton("Inquiry", TR("Inquiry"),
fInquiryButton = new BButton("Inquiry", B_TRANSLATE("Inquiry"),
new BMessage(kMsgInquiry), B_WILL_DRAW);
fAddButton = new BButton("add", TR("Add device to list"),
fAddButton = new BButton("add", B_TRANSLATE("Add device to list"),
new BMessage(kMsgAddToRemoteList), B_WILL_DRAW);
fAddButton->SetEnabled(false);
@@ -128,7 +129,8 @@ InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
if (fLocalDevice != NULL) {
fMessage->SetText(TR("Check that the Bluetooth capabilities of your"
fMessage->SetText(B_TRANSLATE(
"Check that the Bluetooth capabilities of your"
" remote device are activated. Press 'Inquiry' to start scanning."
" The needed time for the retrieval of the names is unknown, "
"although should not take more than 3 seconds per device. "
@@ -143,8 +145,8 @@ InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
} else {
fMessage->SetText(TR("There isn't any Bluetooth LocalDevice registered"
" on the system."));
fMessage->SetText(B_TRANSLATE("There isn't any Bluetooth LocalDevice "
"registered on the system."));
fInquiryButton->SetEnabled(false);
}
@@ -220,7 +222,7 @@ InquiryPanel::MessageReceived(BMessage* message)
fRemoteList->MakeEmpty();
fScanProgress->Reset();
fScanProgress->SetTo(1);
fScanProgress->SetTrailingText(TR("Starting scan..."));
fScanProgress->SetTrailingText(B_TRANSLATE("Starting scan..."));
fScanProgress->SetBarColor(activeColor);
fAddButton->SetEnabled(false);
@@ -240,7 +242,7 @@ InquiryPanel::MessageReceived(BMessage* message)
fRetrieving = true;
labelPlaced = false;
fScanProgress->SetTo(100);
fScanProgress->SetTrailingText(TR("Retrieving names..."));
fScanProgress->SetTrailingText(B_TRANSLATE("Retrieving names..."));
BMessageRunner::StartSending(fMessenger, fRetrieveMessage, 1000000, 1);
break;
@@ -248,12 +250,13 @@ InquiryPanel::MessageReceived(BMessage* message)
case kMsgSecond:
if (fScanning && scanningTime < timer) {
// TODO time formatting could use Locale Kit
BString elapsedTime = TR("Remaining ");
BString elapsedTime = B_TRANSLATE("Remaining ");
// TODO should not be needed if SetMaxValue works...
fScanProgress->SetTo(scanningTime * 100 / timer);
elapsedTime << (int)(timer - scanningTime) << TR(" seconds");
elapsedTime << (int)(timer - scanningTime) <<
B_TRANSLATE(" seconds");
fScanProgress->SetTrailingText(elapsedTime.String());
scanningTime = scanningTime + 1;
@@ -269,7 +272,8 @@ InquiryPanel::MessageReceived(BMessage* message)
if (!labelPlaced) {
labelPlaced = true;
BString progressText = TR("Retrieving name of ");
BString progressText =
B_TRANSLATE("Retrieving name of ");
progressText << bdaddrUtils::ToString(fDiscoveryAgent
->RetrieveDevices(0).ItemAt(retrievalIndex)
->GetBluetoothAddress());
@@ -294,8 +298,10 @@ InquiryPanel::MessageReceived(BMessage* message)
fRetrieving = false;
retrievalIndex = 0;
fScanProgress->SetBarColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fScanProgress->SetTrailingText(TR("Scanning completed."));
fScanProgress->SetBarColor(
ui_color(B_PANEL_BACKGROUND_COLOR));
fScanProgress->SetTrailingText(
B_TRANSLATE("Scanning completed."));
fInquiryButton->SetEnabled(true);
UpdateListStatus();
}
@@ -42,23 +42,23 @@ RemoteDevicesView::RemoteDevicesView(const char* name, uint32 flags)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
addButton = new BButton("add", TR("Add" B_UTF8_ELLIPSIS),
addButton = new BButton("add", B_TRANSLATE("Add" B_UTF8_ELLIPSIS),
new BMessage(kMsgAddDevices));
removeButton = new BButton("remove", TR("Remove"),
removeButton = new BButton("remove", B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveDevice));
pairButton = new BButton("pair", TR("Pair" B_UTF8_ELLIPSIS),
pairButton = new BButton("pair", B_TRANSLATE("Pair" B_UTF8_ELLIPSIS),
new BMessage(kMsgPairDevice));
disconnectButton = new BButton("disconnect", TR("Disconnect"),
disconnectButton = new BButton("disconnect", B_TRANSLATE("Disconnect"),
new BMessage(kMsgDisconnectDevice));
blockButton = new BButton("block", TR("As blocked"),
blockButton = new BButton("block", B_TRANSLATE("As blocked"),
new BMessage(kMsgBlockDevice));
availButton = new BButton("check", TR("Refresh" B_UTF8_ELLIPSIS),
availButton = new BButton("check", B_TRANSLATE("Refresh" B_UTF8_ELLIPSIS),
new BMessage(kMsgRefreshDevices));
// Set up device list