From 211be12926b2dd2d7b082a0e30d0c8187dcdd74a Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Tue, 22 Feb 2011 20:37:54 +0000 Subject: [PATCH] A bit of extra localization support for Devices app. Partially fixes #7245. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40622 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/devices/Device.cpp | 26 ++++++++++++++++++++++---- src/apps/devices/Device.h | 3 +-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/apps/devices/Device.cpp b/src/apps/devices/Device.cpp index 54c87491a4..5a5ef9279f 100644 --- a/src/apps/devices/Device.cpp +++ b/src/apps/devices/Device.cpp @@ -40,6 +40,17 @@ const char* kCategoryString[] = { B_TRANSLATE("ACPI controller") // 0x13 (added later) }; +// This list is only used to translate Device properties +static const char* kTranslateMarkString[] = { + B_TRANSLATE_MARK("unknown"), + B_TRANSLATE_MARK("Device"), + B_TRANSLATE_MARK("Computer"), + B_TRANSLATE_MARK("ACPI bus"), + B_TRANSLATE_MARK("PCI bus"), + B_TRANSLATE_MARK("ISA bus"), + B_TRANSLATE_MARK("Unknown device") +}; + Device::Device(Device* physicalParent, BusType busType, Category category, const BString& name, const BString& manufacturer, @@ -50,10 +61,10 @@ Device::Device(Device* physicalParent, BusType busType, Category category, fCategory(category), fPhysicalParent(physicalParent) { - SetAttribute(B_TRANSLATE("Device name"), name); - SetAttribute(B_TRANSLATE("Manufacturer"), manufacturer); - SetAttribute(B_TRANSLATE("Driver used"), driverUsed); - SetAttribute(B_TRANSLATE("Device paths"), devPathsPublished); + SetAttribute(B_TRANSLATE("Device name"), B_TRANSLATE(name)); + SetAttribute(B_TRANSLATE("Manufacturer"), B_TRANSLATE(manufacturer)); + SetAttribute(B_TRANSLATE("Driver used"), B_TRANSLATE(driverUsed)); + SetAttribute(B_TRANSLATE("Device paths"), B_TRANSLATE(devPathsPublished)); } @@ -127,6 +138,13 @@ Device::GetBusStrings() } +BString +Device::GetBusTabName() +{ + return B_TRANSLATE("Bus Information"); +} + + BString Device::GetAllStrings() { diff --git a/src/apps/devices/Device.h b/src/apps/devices/Device.h index 2c53811701..126950a04e 100644 --- a/src/apps/devices/Device.h +++ b/src/apps/devices/Device.h @@ -88,8 +88,7 @@ public: virtual BString GetBusStrings(); virtual BString GetAllStrings(); - virtual BString GetBusTabName() - { return "Bus Information"; } + virtual BString GetBusTabName(); virtual Attribute GetAttribute(const BString& name) { return Attribute(name.String(),