diff --git a/src/apps/devices/Device.cpp b/src/apps/devices/Device.cpp index 7e1af26f87..54c87491a4 100644 --- a/src/apps/devices/Device.cpp +++ b/src/apps/devices/Device.cpp @@ -107,18 +107,23 @@ Device::GetAllAttributes() BString Device::GetBasicStrings() { - BString str; - str << B_TRANSLATE("Device Name\t\t\t\t: ") << GetName() << "\n"; - str << B_TRANSLATE("Manufacturer\t\t\t: ") << GetManufacturer() << "\n"; - str << B_TRANSLATE("Driver used\t\t\t\t: ") << GetDriverUsed() << "\n"; - str << B_TRANSLATE("Device paths\t: ") << GetDevPathsPublished(); + BString str(B_TRANSLATE("Device Name\t\t\t\t: %Name%\n" + "Manufacturer\t\t\t: %Manufacturer%\n" + "Driver used\t\t\t\t: %DriverUsed%\n" + "Device paths\t: %DevicePaths%")); + + str.ReplaceFirst("%Name%", GetName()); + str.ReplaceFirst("%Manufacturer%", GetManufacturer()); + str.ReplaceFirst("%DriverUsed%", GetDriverUsed()); + str.ReplaceFirst("%DevicePaths%", GetDevPathsPublished()); + return str; } BString Device::GetBusStrings() { - return "None"; + return B_TRANSLATE("None"); } diff --git a/src/apps/devices/DeviceACPI.cpp b/src/apps/devices/DeviceACPI.cpp index b5f7dd9d20..0da6df0d7e 100644 --- a/src/apps/devices/DeviceACPI.cpp +++ b/src/apps/devices/DeviceACPI.cpp @@ -48,17 +48,22 @@ DeviceACPI::InitFromAttributes() } else if (rootACPIPath == "\\_TZ_") { outlineName = B_TRANSLATE("ACPI Thermal Zone"); } else if (rootACPIPath == "\\_PR_.") { + // This allows to localize apostrophes, too + BString string(B_TRANSLATE("ACPI Processor Namespace '%2'")); + string.ReplaceFirst("%2", nodeACPIPath); // each CPU node is considered a root node - outlineName << B_TRANSLATE("ACPI Processor Namespace '") - << nodeACPIPath << "'"; + outlineName << string.String(); } else if (rootACPIPath == "\\_SI_") { outlineName = B_TRANSLATE("ACPI System Indicator"); } else { - outlineName << B_TRANSLATE("ACPI node '") << nodeACPIPath << "'"; + // This allows to localize apostrophes, too + BString string(B_TRANSLATE("ACPI node '%1'")); + string.ReplaceFirst("%1", nodeACPIPath); + outlineName << string.String(); } SetAttribute(B_TRANSLATE("Device name"), outlineName.String()); - SetAttribute(B_TRANSLATE("Manufacturer"), B_TRANSLATE("Not implimented")); + SetAttribute(B_TRANSLATE("Manufacturer"), B_TRANSLATE("Not implemented")); SetText(outlineName.String()); } @@ -79,7 +84,8 @@ DeviceACPI::GetBusAttributes() BString DeviceACPI::GetBusStrings() { - BString str; - str << "Class Info:\t\t\t\t: " << fAttributeMap["Class Info"]; + BString str("Class Info:\t\t\t\t: %classInfo%"); + str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]); + return str; } diff --git a/src/apps/devices/DevicePCI.cpp b/src/apps/devices/DevicePCI.cpp index 07248c8682..3b1852e7a2 100644 --- a/src/apps/devices/DevicePCI.cpp +++ b/src/apps/devices/DevicePCI.cpp @@ -19,7 +19,6 @@ extern "C" { } - DevicePCI::DevicePCI(Device* parent) : Device(parent), @@ -76,7 +75,7 @@ DevicePCI::InitFromAttributes() const char *venFull; get_vendor_info(fVendorId, &venShort, &venFull); if (!venShort && !venFull) { - ManufacturerName << "Unknown"; + ManufacturerName << B_TRANSLATE("Unknown"); } else if (venShort && venFull) { ManufacturerName << venFull << "(" << venShort << ")"; } else { @@ -90,7 +89,7 @@ DevicePCI::InitFromAttributes() get_device_info(fVendorId, fDeviceId, fSubsystemVendorId, fSubSystemId, &devShort, &devFull); if (!devShort && !devFull) { - DeviceName << "Unknown"; + DeviceName << B_TRANSLATE("Unknown"); } else if (devShort && devFull) { DeviceName << devFull << "(" << devShort << ")"; } else { @@ -125,7 +124,7 @@ DevicePCI::GetBusAttributes() BString DevicePCI::GetBusStrings() { - BString str; - str << "Class Info:\t\t\t\t: " << fAttributeMap["Class Info"]; + BString str("Class Info:\t\t\t\t: %classInfo%"); + str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]); return str; } diff --git a/src/apps/devices/DevicesApplication.cpp b/src/apps/devices/DevicesApplication.cpp index 8d7a4a3a48..839722bafc 100644 --- a/src/apps/devices/DevicesApplication.cpp +++ b/src/apps/devices/DevicesApplication.cpp @@ -53,13 +53,13 @@ DevicesApplication::AboutRequested() void DevicesApplication::ShowAbout() { - BAlert* alert = new BAlert(B_TRANSLATE("about"), B_TRANSLATE("Devices\n" + BAlert* alert = new BAlert("about", B_TRANSLATE("Devices\n" "\twritten by Pieter Panman\n" "\n" "\tBased on listdev by Jérôme Duval\n" "\tand the previous Devices preference\n" "\tby Jérôme Duval and Sikosis\n" - "\tCopyright 2009, Haiku, Inc.\n"), "OK"); + "\tCopyright 2009, Haiku, Inc.\n"), B_TRANSLATE("OK")); BTextView* view = alert->TextView(); BFont font; @@ -76,9 +76,10 @@ DevicesApplication::ShowAbout() DevicesWindow::DevicesWindow() : - BWindow(BRect(50, 50, 750, 550), "Devices", B_TITLED_WINDOW, - B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS - | B_QUIT_ON_WINDOW_CLOSE) + BWindow(BRect(50, 50, 750, 550), B_TRANSLATE("Devices"), + B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS + | B_AUTO_UPDATE_SIZE_LIMITS + | B_QUIT_ON_WINDOW_CLOSE) { float minWidth; float maxWidth; diff --git a/src/apps/devices/Jamfile b/src/apps/devices/Jamfile index a3b8973b09..c7621b4427 100644 --- a/src/apps/devices/Jamfile +++ b/src/apps/devices/Jamfile @@ -76,6 +76,16 @@ Application Devices : : Devices.rdef ; +DoCatalogs Devices : + x-vnd.Haiku-Devices + : + DevicesApplication.cpp + DevicesView.cpp + DevicePCI.cpp + PropertyList.cpp + PropertyListPlain.cpp +; + Includes [ FGristFiles DevicesInfo.cpp ] : [ FGristFiles isapnpids.h usbdevs.h usbdevs_data.h ] ; Includes [ FGristFiles ConfigurationWindow.cpp ] : [ FGristFiles pcihdr.h ] ; diff --git a/src/apps/devices/ResourceUsageWindow.cpp b/src/apps/devices/ResourceUsageWindow.cpp index eb8e8511eb..cb5548e543 100644 --- a/src/apps/devices/ResourceUsageWindow.cpp +++ b/src/apps/devices/ResourceUsageWindow.cpp @@ -189,7 +189,7 @@ RangeItem::Compare(const void *firstArg, const void *secondArg) // ResourceUsageWindow - Constructor ResourceUsageWindow::ResourceUsageWindow(BRect frame, BList &list) - : BWindow (frame, "Resource Usage", B_TITLED_WINDOW_LOOK, + : BWindow (frame, B_TRANSLATE("Resource Usage"), B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL , B_NOT_ZOOMABLE|B_NOT_RESIZABLE) { InitWindow(list);