Ticket #7156: bluetooth-preflet-localization-fix.patch
File bluetooth-preflet-localization-fix.patch, 8.9 KB (added by , 13 years ago) |
---|
-
src/preferences/bluetooth/BluetoothMain.cpp
6 6 7 7 #include <Alert.h> 8 8 #include <Catalog.h> 9 #include <Locale.h>10 9 #include <MessageRunner.h> 11 10 #include <Roster.h> 12 11 … … 30 29 if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) { 31 30 32 31 int32 choice = (new BAlert("bluetooth_server not running", 33 "bluetooth_server has not been found running on the system."34 "Should be started, or stay offline" , "Work offline",35 "Quit", "Start please", B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();32 B_TRANSLATE("bluetooth_server has not been found running on the system. " 33 "Should be started, or stay offline"), B_TRANSLATE("Work offline"), 34 B_TRANSLATE("Quit"), B_TRANSLATE("Start please"), B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); 36 35 37 36 38 37 switch (choice) { -
src/preferences/bluetooth/BluetoothDeviceView.cpp
12 12 #include <Bitmap.h> 13 13 #include <Catalog.h> 14 14 #include <GroupLayoutBuilder.h> 15 #include <Locale.h>16 15 #include <SpaceLayoutItem.h> 17 16 #include <StringView.h> 18 17 #include <TextView.h> … … 40 39 bdaddrUtils::ToString(bdaddrUtils::NullAddress())); 41 40 fBdaddr->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE)); 42 41 42 BString str1("%1: "); 43 str1.ReplaceFirst("%1", B_TRANSLATE("Service classes")); 43 44 fClassService = new BStringView("ServiceClass", 44 B_TRANSLATE("Service classes: "));45 str1.String()); 45 46 fClassService->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, 46 47 B_ALIGN_MIDDLE)); 47 48 … … 118 119 fName->SetText(bDevice->GetFriendlyName().String()); 119 120 fBdaddr->SetText(bdaddrUtils::ToString(bDevice->GetBluetoothAddress())); 120 121 121 BString string(B_TRANSLATE("Service classes: ")); 122 BString string("%1: "); 123 string.ReplaceFirst("%1", B_TRANSLATE("Service classes")); 122 124 bDevice->GetDeviceClass().GetServiceClass(string); 123 125 fClassService->SetText(string.String()); 124 126 … … 134 136 135 137 string = ""; 136 138 if (bDevice->GetProperty("hci_version", &value) == B_OK) 137 string << "HCI ver: " << BluetoothHciVersion(value);139 string << B_TRANSLATE("HCI ver") << ": " << BluetoothHciVersion(value); 138 140 if (bDevice->GetProperty("hci_revision", &value) == B_OK) 139 string << " HCI rev: " << value ;141 string << B_TRANSLATE(" HCI rev") << ": " << value ; 140 142 141 143 fHCIVersionProperties->SetText(string.String()); 142 144 143 145 string = ""; 144 146 if (bDevice->GetProperty("lmp_version", &value) == B_OK) 145 string << "LMP ver: " << BluetoothLmpVersion(value);147 string << B_TRANSLATE("LMP ver") << ": " << BluetoothLmpVersion(value); 146 148 if (bDevice->GetProperty("lmp_subversion", &value) == B_OK) 147 string << " LMP subver: " << value;149 string << B_TRANSLATE(" LMP subver") << ": " << value; 148 150 fLMPVersionProperties->SetText(string.String()); 149 151 150 152 string = ""; 151 153 if (bDevice->GetProperty("manufacturer", &value) == B_OK) 152 string << "Manufacturer: " << BluetoothManufacturer(value); 154 string << B_TRANSLATE("Manufacturer") << ": " 155 << BluetoothManufacturer(value); 153 156 fManufacturerProperties->SetText(string.String()); 154 157 155 158 string = ""; 156 159 if (bDevice->GetProperty("acl_mtu", &value) == B_OK) 157 string << "ACL mtu: " << value;160 string << B_TRANSLATE("ACL mtu") << ": " << value; 158 161 if (bDevice->GetProperty("acl_max_pkt", &value) == B_OK) 159 string << " packets: " << value;162 string << B_TRANSLATE(" packets") << ": " << value; 160 163 fACLBuffersProperties->SetText(string.String()); 161 164 162 165 string = ""; 163 166 if (bDevice->GetProperty("sco_mtu", &value) == B_OK) 164 string << "SCO mtu: " << value;167 string << B_TRANSLATE("SCO mtu") << ": " << value; 165 168 if (bDevice->GetProperty("sco_max_pkt", &value) == B_OK) 166 string << " packets: " << value;169 string << B_TRANSLATE(" packets") << ": " << value; 167 170 fSCOBuffersProperties->SetText(string.String()); 168 171 169 172 } -
src/preferences/bluetooth/InquiryPanel.cpp
7 7 #include <Button.h> 8 8 #include <Catalog.h> 9 9 #include <GroupLayoutBuilder.h> 10 #include <Locale.h>11 10 #include <ListView.h> 12 11 #include <ListItem.h> 13 12 #include <MessageRunner.h> … … 94 93 95 94 InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice) 96 95 : 97 BWindow(frame, "Bluetooth", B_FLOATING_WINDOW,96 BWindow(frame, B_TRANSLATE("Bluetooth"), B_FLOATING_WINDOW, 98 97 B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS, B_ALL_WORKSPACES ), 99 98 fMessenger(this), 100 99 fScanning(false), … … 252 251 case kMsgSecond: 253 252 if (fScanning && scanningTime < timer) { 254 253 // TODO time formatting could use Locale Kit 255 BString elapsedTime = B_TRANSLATE("Remaining ");256 254 257 255 // TODO should not be needed if SetMaxValue works... 258 256 fScanProgress->SetTo(scanningTime * 100 / timer); 257 BString elapsedTime = B_TRANSLATE("Remaining %1 seconds"); 259 258 260 elapsedTime << (int)(timer - scanningTime) << 261 B_TRANSLATE(" seconds"); 259 BString seconds(""); 260 seconds << (int)(timer - scanningTime); 261 262 elapsedTime.ReplaceFirst("%1", seconds.String()); 262 263 fScanProgress->SetTrailingText(elapsedTime.String()); 263 264 264 265 scanningTime = scanningTime + 1; … … 274 275 if (!labelPlaced) { 275 276 276 277 labelPlaced = true; 277 BString progressText = 278 B_TRANSLATE("Retrieving name of "); 279 progressText << bdaddrUtils::ToString(fDiscoveryAgent 278 BString progressText(B_TRANSLATE("Retrieving name of %1")); 279 280 BString namestr(""); 281 namestr << bdaddrUtils::ToString(fDiscoveryAgent 280 282 ->RetrieveDevices(0).ItemAt(retrievalIndex) 281 283 ->GetBluetoothAddress()); 284 progressText.ReplaceFirst("%1", namestr.String()); 282 285 fScanProgress->SetTrailingText(progressText.String()); 283 286 284 287 } else { -
src/preferences/bluetooth/BluetoothSettingsView.cpp
11 11 #include <Catalog.h> 12 12 #include <GridLayoutBuilder.h> 13 13 #include <GroupLayoutBuilder.h> 14 #include <Locale.h>15 14 #include <MenuField.h> 16 15 #include <MenuItem.h> 17 16 #include <PopUpMenu.h> … … 156 155 case kMsgSetDeviceClassDesktop: 157 156 { 158 157 devClass.SetRecord(1, 1, 0x72); 159 ActiveLocalDevice->SetDeviceClass(devClass); 158 if (ActiveLocalDevice != NULL) 159 ActiveLocalDevice->SetDeviceClass(devClass); 160 160 break; 161 161 } 162 162 163 163 case kMsgSetDeviceClassServer: 164 164 { 165 165 devClass.SetRecord(1, 2, 0x72); 166 ActiveLocalDevice->SetDeviceClass(devClass); 166 if (ActiveLocalDevice != NULL) 167 ActiveLocalDevice->SetDeviceClass(devClass); 167 168 break; 168 169 } 169 170 170 171 case kMsgSetDeviceClassLaptop: 171 172 { 172 173 devClass.SetRecord(1, 3, 0x72); 173 ActiveLocalDevice->SetDeviceClass(devClass); 174 if (ActiveLocalDevice != NULL) 175 ActiveLocalDevice->SetDeviceClass(devClass); 174 176 break; 175 177 } 176 178 177 179 case kMsgSetDeviceClassHandheld: 178 180 { 179 181 devClass.SetRecord(1, 4, 0x72); 180 ActiveLocalDevice->SetDeviceClass(devClass); 182 if (ActiveLocalDevice != NULL) 183 ActiveLocalDevice->SetDeviceClass(devClass); 181 184 break; 182 185 } 183 186 184 187 case kMsgSetDeviceClassSmartPhone: 185 188 { 186 189 devClass.SetRecord(2, 3, 0x72); 187 ActiveLocalDevice->SetDeviceClass(devClass); 190 if (ActiveLocalDevice != NULL) 191 ActiveLocalDevice->SetDeviceClass(devClass); 188 192 break; 189 193 } 190 194 -
src/preferences/bluetooth/ExtendedLocalDeviceView.cpp
12 12 #include <Catalog.h> 13 13 #include <CheckBox.h> 14 14 #include <GroupLayoutBuilder.h> 15 #include <Locale.h>16 15 #include <SpaceLayoutItem.h> 17 16 #include <StringView.h> 18 17 -
src/preferences/bluetooth/RemoteDevicesView.cpp
6 6 7 7 #include <Alert.h> 8 8 #include <Catalog.h> 9 #include <Locale.h>10 9 #include <Messenger.h> 11 10 12 11 #include <Directory.h> -
src/preferences/bluetooth/BluetoothWindow.cpp
8 8 #include <Button.h> 9 9 #include <Catalog.h> 10 10 #include <GroupLayoutBuilder.h> 11 #include <Locale.h>12 11 #include <Messenger.h> 13 12 #include <SpaceLayoutItem.h> 14 13 #include <TabView.h>