Opened 13 years ago

Closed 12 years ago

#7245 closed bug (fixed)

Some enchancements and fixing of the Devices application localization

Reported by: Karvjorm Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Devices Version: R1/alpha2
Keywords: Devices localization Cc: Karvjorm
Blocked By: Blocking:
Platform: All

Description

Localization has caused some problems in Devices application. Details tab can include English "Device name" and value "unknown" and at the same time a localized "Device name" with some quite reasonable text. I backed a little backward in localization and started to test, how those duplicate fields could be removed. I wrote a filter that work by some way. Still it is only a workaround, but could be used until someone have time to refactor the whole application.

As you can see in the enclosed figure, the scsi/vendor + scsi/product could combined to better "Device name" than "unknown" or the localized "Unknown device" is now. In my filter I tried the same ide, but it does not work quite correct yet. At present "Manufacturer" and "Device name" are already combined in device tree on the left ("Intel Corporation"+"82372AB/EB/MB PIIX4 ACPI").

In the figure you can also see, that V from Virtual is clipped (it is at the end of scsi/vendor). It is a bug before the localization, I think.

Also, I enchanced code by adding handling of ACPI Battery (it is not quite complete but better than before). I added also DeviceUSB and DeviceSCSI code, but only USB code is compiled and is shown in ACPI only, I think.

Br, Karvjorm

Attachments (5)

DeviceNameVirtualError.png (59.6 KB ) - added by Karvjorm 13 years ago.
A "Virtual" bug
devices-fix.patch (28.3 KB ) - added by Karvjorm 13 years ago.
An enhancement and fix for the Devices application.
WhatsWrongWithDevicesAbout.png (10.3 KB ) - added by Karvjorm 13 years ago.
Devices About window with wrong left alignment before this fix
FixedDevicesAboutWindow.png (10.1 KB ) - added by Karvjorm 13 years ago.
Devices About window after fixes of the patch
fix_devices-patch.diff (1.5 KB ) - added by Karvjorm 12 years ago.
This should fix non-localized strings of the Devices application

Download all attachments as: .zip

Change History (15)

by Karvjorm, 13 years ago

Attachment: DeviceNameVirtualError.png added

A "Virtual" bug

by Karvjorm, 13 years ago

Attachment: devices-fix.patch added

An enhancement and fix for the Devices application.

comment:1 by Karvjorm, 13 years ago

patch: 01

comment:2 by Karvjorm, 13 years ago

About text looked awful and I fixed it too.

br, Karvjorm

comment:3 by siarzhuk, 13 years ago

What is wrong with this one so you going to change it?

@@ -53,13 +53,13 @@
 void
 DevicesApplication::ShowAbout()
 {
-	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"), B_TRANSLATE("OK"));
+	BString aboutStr("%1\n%2\n\n%3\nCopyright 2009, Haiku, Inc.\n");
+	aboutStr.ReplaceFirst("%1", B_TRANSLATE("Devices"));
+	aboutStr.ReplaceFirst("%2", B_TRANSLATE("written by Pieter Panman"));
+	aboutStr.ReplaceFirst("%3", B_TRANSLATE("Based on listdev by Jérôme "
+	"Duval\nand the previous Devices preference\nby Jérôme Duval and "
+	"Sikosis"));
+	BAlert* alert = new BAlert("about", aboutStr.String(), B_TRANSLATE("OK"));

1) This lines already translated to dozen of languages and changing it now discards all that translations work. Please be more thrifty to your colleagues' work and do not change already translated lines without significant reasons;

2) Frankly speaking original code is looking much more clean than you one. Please do not over-complicate the source code because temporary problems at HTA. Sooner or later HTA will be fixed but this bloat-lines can stay in the sources for years;

3) As it was already discussed in ML - the first parameter of BAlert constructor call must be translated too. It is visible on some non-default decoration themes.

by Karvjorm, 13 years ago

Devices About window with wrong left alignment before this fix

by Karvjorm, 13 years ago

Attachment: FixedDevicesAboutWindow.png added

Devices About window after fixes of the patch

in reply to:  3 ; comment:4 by Karvjorm, 13 years ago

Replying to siarzhuk:

What is wrong with this one so you going to change it?

1) This lines already translated to dozen of languages and changing it now discards all that translations work. Please be more thrifty to your colleagues' work and do not change already translated lines without significant reasons;

2) Frankly speaking original code is looking much more clean than you one. Please do not over-complicate the source code because temporary problems at HTA. Sooner or later HTA will be fixed but this bloat-lines can stay in the sources for years;

PLS, feel free to compare the two figures I have enclosed here. The problem with the previous layout was those '\t' marks that caused that alignment to to left was wrong.

3) As it was already discussed in ML - the first parameter of BAlert constructor call must be translated too. It is visible on some non-default decoration themes.

Sorry, I forgot that one.

Br, Karvjorm

in reply to:  4 comment:5 by siarzhuk, 13 years ago

Replying to Karvjorm:

PLS, feel free to compare the two figures I have enclosed here. The problem with the previous layout was those '\t' marks that caused that alignment to to left was wrong.

But alignment of original English line is OK. :-) To solve this problem you can reformat localized part as you want - remove tabs, or break the string into more lines.

3) As it was already discussed in ML - the first parameter of BAlert constructor call must be translated too. It is visible on some non-default decoration themes.

Sorry, I forgot that one.

Not a problem, just a reminder.

comment:6 by siarzhuk, 13 years ago

This app localization partially fixed in hrev40586 and hrev40622. Please check and adjust your patch. Thank you.

comment:7 by mmadia, 13 years ago

Marking the patch obsolete, as an updated version has been requested.

comment:8 by mmadia, 13 years ago

patch: 10

by Karvjorm, 12 years ago

Attachment: fix_devices-patch.diff added

This should fix non-localized strings of the Devices application

comment:9 by Karvjorm, 12 years ago

patch: 01

comment:10 by humdinger, 12 years ago

Resolution: fixed
Status: newclosed

Applied with hrev43723. Thanks! Closing as fixed, right?

Note: See TracTickets for help on using tickets.