1) Devices application localization support reordered to let more translated

values be handled. Partialy fixes #7245;
2) Support for localization some still not handled parameters in ProcessController.

Pointed out by Diver. Thanks.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski
2011-02-20 18:45:23 +00:00
parent 922f48327f
commit 1153eaca5f
9 changed files with 56 additions and 38 deletions
+15 -2
View File
@@ -7,10 +7,15 @@
*/
#include "DeviceACPI.h"
#include <sstream>
#include <stdlib.h>
#include "DeviceACPI.h"
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "DeviceACPI"
DeviceACPI::DeviceACPI(Device* parent)
@@ -84,8 +89,16 @@ DeviceACPI::GetBusAttributes()
BString
DeviceACPI::GetBusStrings()
{
BString str("Class Info:\t\t\t\t: %classInfo%");
BString str(B_TRANSLATE("Class Info:\t\t\t\t: %classInfo%"));
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
return str;
}
BString
DeviceACPI::GetBusTabName()
{
return B_TRANSLATE("ACPI Information");
}
+2 -6
View File
@@ -10,10 +10,7 @@
#include "Device.h"
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "DeviceACPI"
class DeviceACPI : public Device {
public:
@@ -22,9 +19,8 @@ public:
virtual Attributes GetBusAttributes();
virtual BString GetBusStrings();
virtual void InitFromAttributes();
virtual BString GetBusTabName()
{ return B_TRANSLATE("ACPI Information"); }
virtual BString GetBusTabName();
};
#endif /* DEVICEACPI_H */
+14 -1
View File
@@ -7,10 +7,15 @@
*/
#include "DevicePCI.h"
#include <sstream>
#include <stdlib.h>
#include "DevicePCI.h"
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "DevicePCI"
extern "C" {
#include "dm_wrapper.h"
@@ -128,3 +133,11 @@ DevicePCI::GetBusStrings()
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
return str;
}
BString
DevicePCI::GetBusTabName()
{
return B_TRANSLATE("PCI Information");
}
+1 -7
View File
@@ -10,10 +10,6 @@
#include "Device.h"
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "DevicePCI"
class DevicePCI : public Device {
public:
@@ -22,9 +18,7 @@ public:
virtual Attributes GetBusAttributes();
virtual BString GetBusStrings();
virtual void InitFromAttributes();
virtual BString GetBusTabName()
{ return B_TRANSLATE("PCI Information"); }
virtual BString GetBusTabName();
private:
uint16 fClassBaseId;
+1 -1
View File
@@ -53,7 +53,7 @@ DevicesApplication::AboutRequested()
void
DevicesApplication::ShowAbout()
{
BAlert* alert = new BAlert("about", B_TRANSLATE("Devices\n"
BAlert* alert = new BAlert(B_TRANSLATE("About"), B_TRANSLATE("Devices\n"
"\twritten by Pieter Panman\n"
"\n"
"\tBased on listdev by Jérôme Duval\n"
+2 -10
View File
@@ -84,19 +84,11 @@ DoCatalogs Devices :
DevicePCI.cpp
PropertyList.cpp
PropertyListPlain.cpp
DeviceACPI.cpp
Device.cpp
;
Includes [ FGristFiles DevicesInfo.cpp ] : [ FGristFiles isapnpids.h usbdevs.h
usbdevs_data.h ] ;
Includes [ FGristFiles ConfigurationWindow.cpp ] : [ FGristFiles pcihdr.h ] ;
DoCatalogs Devices :
x-vnd.Haiku-Devices
:
DevicesApplication.cpp
DevicesView.cpp
DevicePCI.h
DeviceACPI.h
Device.cpp
PropertyList.h
;
+5
View File
@@ -8,8 +8,13 @@
#include "PropertyList.h"
#include <Catalog.h>
#include <ColumnTypes.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "PropertyList"
//#include <stdio.h>
PropertyRow::PropertyRow(const char* name, const char* value)
+2 -5
View File
@@ -13,10 +13,6 @@
#include <String.h>
#include "Device.h"
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "PropertyList"
struct Attribute;
@@ -43,7 +39,7 @@ private:
class PropertyList : public BColumnListView {
public:
PropertyList(const char* name = B_TRANSLATE("Properties"));
PropertyList(const char* name);
virtual ~PropertyList();
void RemoveAll();
void AddAttributes(const Attributes& attributes);
@@ -52,3 +48,4 @@ protected:
};
#endif /* PROPERTYLIST_H*/
@@ -26,6 +26,11 @@
#include <stdio.h>
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "ProcessController"
KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo)
: BMenuItem("System resources & caches" B_UTF8_ELLIPSIS, NULL)
@@ -81,8 +86,10 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
cadre.InsetBy(1, 1);
BRect r = cadre;
float grenze1 = cadre.left + (cadre.right - cadre.left) * fCachedMemory / fPhysicalMemory;
float grenze2 = cadre.left + (cadre.right - cadre.left) * fCommittedMemory / fPhysicalMemory;
float grenze1 = cadre.left + (cadre.right - cadre.left)
* fCachedMemory / fPhysicalMemory;
float grenze2 = cadre.left + (cadre.right - cadre.left)
* fCommittedMemory / fPhysicalMemory;
if (grenze1 > cadre.right)
grenze1 = cadre.right;
if (grenze2 > cadre.right)
@@ -145,11 +152,11 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
menu->SetHighColor(kBlack);
char infos[128];
sprintf(infos, "%.1f MB", fCachedMemory / 1024.f);
BPoint loc(cadre.left - kMargin - gMemoryTextWidth / 2 - menu->StringWidth(infos),
cadre.bottom + 1);
sprintf(infos, B_TRANSLATE("%.1f MB"), fCachedMemory / 1024.f);
BPoint loc(cadre.left, cadre.bottom + 1);
loc.x -= kMargin + gMemoryTextWidth / 2 + menu->StringWidth(infos);
menu->DrawString(infos, loc);
sprintf(infos, "%.1f MB", fCommittedMemory / 1024.f);
sprintf(infos, B_TRANSLATE("%.1f MB"), fCommittedMemory / 1024.f);
loc.x = cadre.left - kMargin - menu->StringWidth(infos);
menu->DrawString(infos, loc);
fLastSum = sum;
@@ -166,3 +173,4 @@ KernelMemoryBarMenuItem::GetContentSize(float* _width, float* _height)
*_width += 20 + kBarWidth + kMargin + gMemoryTextWidth;
}