[haiku-commits] r35209 - in haiku/trunk: data/catalogs/apps data/catalogs/apps/installer src/apps/installer

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jan 2010 21:06:30 +0100 (CET)

Author: stippi
Date: 2010-01-20 21:06:30 +0100 (Wed, 20 Jan 2010)
New Revision: 35209
Changeset: http://dev.haiku-os.org/changeset/35209/haiku

Added:
   haiku/trunk/data/catalogs/apps/installer/
   haiku/trunk/data/catalogs/apps/installer/de.catkeys
Modified:
   haiku/trunk/src/apps/installer/InstallerApp.cpp
   haiku/trunk/src/apps/installer/InstallerApp.h
   haiku/trunk/src/apps/installer/InstallerWindow.cpp
   haiku/trunk/src/apps/installer/Jamfile
   haiku/trunk/src/apps/installer/PackageViews.cpp
   haiku/trunk/src/apps/installer/ProgressReporter.cpp
   haiku/trunk/src/apps/installer/WorkerThread.cpp
Log:
 * Applied localization to the Installer.
 * Some coding style fixes along the way.
 * Added German translation.

NOTE: The Installer will have to offer a way to change the current locale! So
any translations which are done at this point will have to receive one more
update after I added this feature.

NOTE2: There is something wrong with generating catalogs and the update-all
jam target. If you don't do a clean build, the build won't run through, but it
is enough to build for example an image and then run update-all on your actual
partition profile.


Added: haiku/trunk/data/catalogs/apps/installer/de.catkeys
===================================================================
--- haiku/trunk/data/catalogs/apps/installer/de.catkeys                         
(rev 0)
+++ haiku/trunk/data/catalogs/apps/installer/de.catkeys 2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -0,0 +1,71 @@
+1      de      x-vnd.Haiku-Installer   3475867404
+%3.1f MB       PackagesView            %3.1f MB
+Installer\n\twritten by Jérôme Duval and Stephan Aßmus\n\tCopyright 2005-2010, 
Haiku.\n\n      InstallerApp            Installer\n\tgeschrieben von Jérôme 
Duval und Stephan Aßmus\n\tCopyright 2005-2001, Haiku.\n\n
+Installation completed. Boot sector has been written to '%s'. Press Quit to 
leave the Installer or choose a new target volume to perform another 
installation. InstallerWindow         Installation completed. Boot sector has 
been written to '%s'. Press Quit to leave the Installer or choose a new target 
volume to perform another installation.
+Quit   InstallerApp            Beenden
+Stop   InstallerWindow In alert after pressing Stop    Stop
+Installation completed. Boot sector has been written to '%s'. Press Quit to 
restart the computer or choose a new target volume to perform another 
installation.        InstallerWindow         Installation completed. Boot 
sector has been written to '%s'. Press Quit to restart the computer or choose a 
new target volume to perform another installation.
+Install progress:      InstallerWindow         Installationsfortschritt:  
+Starting Installation. InstallProgress         Installation wird begonnen.
+Are you sure you want to install onto the current boot disk? The Installer 
will have to reboot your machine if you proceed.    InstallProgress         
Sind Sie sicher, dass Sie auf das aktuelle Startvolumen installieren wollen? 
Der Installer muss Ihr System neustarten, wenn Sie fortfahren.
+Stop   InstallerWindow         Stop
+OK     InstallerApp            OK
+Choose the source and destination disk from the pop-up menus. Then click 
\"Begin\".    InstallerWindow         Wählen Sie die Quell- und Zielvolumen aus 
den Popupmenüs. Klicken Sie dann auf \"Start\".
+Install from:  InstallerWindow         Quelle:
+%1ld of %2ld   InstallerWindow number of files copied  %1ld von %2ld
+Installer      InstallerWindow         Installer
+Continue       InstallerWindow In alert after pressing Stop    Weiter
+Write boot sector to '%s'      InstallerWindow         Bootsektor auf '%s' 
schreiben
+Collecting copy information.   InstallProgress         Kopierinformationen 
werden gesammelt.
+Choose the source disk from the pop-up menu. Then click \"Begin\".     
InstallerWindow         Wählen Sie das Quellvolumen aus dem Popupmenü. Klicken 
Sie dann auf \"Start\".
+%3.1f KB       PackagesView            %3.1f KB
+Quit   InstallerWindow         Beenden
+Boot sector successfully written.      InstallProgress         Bootsektor 
erfolgreich geschrieben.
+Performing installation.       InstallProgress         Installation wird 
durchgeführt.
+scanning…      InstallerWindow         scanning…
+Boot sector not written because of an  internal error. InstallProgress         
Bootsektor wegen eines internen Fehlers nicht geschrieben.
+Finishing Installation.        InstallProgress         Installation wird 
abgeschlossen.
+README InstallerApp            LIESMICH
+The destination disk may not have enough space. Try choosing a different disk 
or choose to not install optional items. InstallProgress         Auf dem 
Zielvolumen gibt es eventuell nicht genug Platz. Wählen Sie ein anderes Volumen 
oder nehmen Sie optionale Pakete aus der Installation.
+%Ld B  PackagesView            %Ld B
+Scanning for disks…    InstallerWindow         Volumen werden gesucht…
+The disk can't be mounted. Please choose a different disk.     InstallProgress 
        Das Volumen kann nicht eingebunden werden. Bitte wählen Sie ein anderes 
aus.
+?? of ??       InstallerWindow Unknown progress        ?? von ??
+Launch the DriveSetup utility to partition\navailable hard drives and other 
media.\nPartitions can be initialized with the\nBe File System needed for a 
Haiku boot\npartition. InstallerWindow         Starten Sie das DriveSetup 
Werkzeug um\nverfügbare Festplatten und andere Medien\nzu partitionieren. 
Partitionen können mit\ndem Be File System eingerichtet werden,\nwelches für 
ein Haiku Bootvolumen\nerforderlich ist.
+Show optional packages InstallerWindow         Optionale Pakete anzeigen
+No partitions have been found that are suitable for installation. Please set 
up partitions and initialize at least one partition with the Be File System.    
  InstallerWindow         Es wurden keine Volumen gefunden, die für eine 
Installation geeignet sind. Bitte richten Sie Partitionen ein und 
initialisieren Sie mindestens eine mit dem Be File System.
+Choose the disk you want to install onto from the pop-up menu. Then click 
\"Begin\".   InstallerWindow         Wählen Sie das Zielvolumen aus dem 
Popupmenü. Klicken Sie dann auf \"Start\".
+%.1f TB        PackagesView            %.1f TB
+Unknown Type   InstallProgress Partition content type  Unbekannter Typ
+<none> InstallerWindow No partition available  <nicht verfügbar>
+Installation canceled. InstallProgress         Installation abgebrochen.
+You can't install the contents of a disk onto itself. Please choose a 
different disk.  InstallProgress         Sie können nicht den Inhalt eines 
Volumens in sich selbst installieren. Bitte wählen Sie ein anderes Volumen.
+???    InstallerWindow Unknown currently copied item   ???
+Hide optional packages InstallerWindow         Optionale Pakete ausblenden
+Please close the DriveSetup window before closing the Installer window.        
InstallerWindow         Bitte schließen Sie das DriveSetup Fenster bevor Sie 
das Installer Fenster schließen.
+OK     InstallerWindow         OK
+Set up partitions…     InstallerWindow         Partitionen einrichten…
+The partition can't be mounted. Please choose a different partition.   
InstallProgress         Das Volumen kann nicht eingebunden werden. Bitte wählen 
Sie ein anderes.
+The mount point could not be retrieve. InstallProgress         Der 
Einhängepunkt konnte nicht ermittelt werden.
+Install anyway InstallProgress         Trotzdem installieren
+An error was encountered and the installation was not completed:\n\nError:  %s 
InstallerWindow         Es ist ein Fehler aufgetreten und die Installation 
wurde nicht fertiggestellt:\n\nFehler:  %s
+Press the Begin button to install from '%1s' onto '%2s'.       InstallerWindow 
        Klicken Sie den Startknopf um von '%1s' auf '%2s' zu installieren.
+Running DriveSetup…\n\nClose DriveSetup to continue with the installation.     
InstallerWindow         DriveSetup wird ausgeführt…\n\nSchließen Sie DriveSetup 
um mit der Installation fortzufahren.
+OK     InstallProgress         OK
+Please choose target   InstallerWindow         Bitte Ziel auswählen
+???    InstallerWindow Unknown partition name  ???
+Begin  InstallerWindow         Start
+Welcome to the Haiku Installer!\n\nIMPORTANT INFORMATION BEFORE INSTALLING 
HAIKU\n\nThis is alpha-quality software! It means there is a high risk of 
losing important data. Make frequent backups! You have been warned.\n\n1)  If 
you are installing Haiku onto real hardware (not inside an emulator) it is 
recommended that you have already prepared a hard disk partition. The Installer 
and the DriveSetup tool offer to initialize existing partitions with the Haiku 
native file system, but the options to change the actual partition layout may 
not have been tested on a sufficiently great variety of computer installations 
so we do not recommend using it.\nIf you have not created a partition yet, 
simply reboot, create the partition using whatever tool you feel most 
comfortable with, and reboot into Haiku to continue with the installation. You 
could for example use the GParted Live-CD, it can also resize existing 
partitions to make room.\n\n2)  The Installer will take no steps to integrat
 e Haiku into an existing boot menu. The Haiku partition itself will be made 
bootable. If you have GRUB already installed, edit your /boot/grub/menu.lst by 
launching your favorite editor from a Terminal like this:\n\n\tsudo <your 
favorite text editor> /boot/grub/menu.lst\n\nYou'll note that GRUB uses a 
different naming strategy for hard drives than Linux.\n\nWith GRUB it's: 
(hdN,n)\n\nAll harddisks start with \"hd\"\n\"N\" is the hard disk number, 
starting with \"0\".\n\"n\" is the partition number, also starting with 
\"0\".\nThe first logical partition always has the number 4, regardless of the 
number of primary partitions.\n\nSo behind the other menu entries towards the 
bottom of the file, add something similar to these lines:\n\n\t# Haiku on 
/dev/sda7\n\ttitle\t\t\t\tHaiku\n\trootnoverify\t\t(hd0,6)\n\tchainloader\t\t+1\n\nYou
 can see the correct partition in GParted for example.\n\n3)  When you 
successfully boot into Haiku for the first time, make sure to read our \"Welco
 me\" documentation, there is a link on the Desktop.\n\nHave fun and thanks a 
lot for trying out Haiku! We hope you like it!    InstallerApp            
Willkommen zur Haiku Installation!\n\nWICHTIGE INFORMATIONEN VOR DER HAIKU 
INSTALLATION\n\nEs handelt sich um Software mit "Alphaqualität"! Demnach gibt 
es ein hohes Risiko, wichtige Daten zu verlieren. Erstellen Sie also regelmäßig 
Sicherungskopien! Sie wurden gewarnt.\n\n1) Wenn Sie Haiku auf echter Hardware 
installieren (nicht in einem Emulator), wird empfohlen, dass Sie vorher bereits 
eine Festplattenpartition eingerichtet haben. Der Installer und das DriveSetup 
Werkzeug erlauben das Initialisieren von bestehenden Partitionen mit dem Haiku 
Dateisystem, aber die Möglichkeiten, die Partitionsaufteilung der Festplatte zu 
ändern, wurden nicht auf einer hinreichend großen Anzahl von Computersystemen 
getestet, weshalb wir ihre Nutzung nicht empfehlen.\nFalls Sie noch keine 
Partition angelegt haben, starten Sie einfach neu, legen Sie di
 e Partition mit einem Werkzeug Ihres Vertrauens an und starten Sie erneut die 
Haiku-Installation. Sie könnten beispielsweise die GParted-LiveCD verwenden, 
diese kann auch bestehende Partitionen ohne Datenverlust verkleinern, um Platz 
zu schaffen.\n\n2)  Der Installer wird keine Schritte unternehmen, um Haiku in 
ein bestehendes Bootmenü zu integrieren. Die Haiku-Partition selbst wird 
bootfähig gemacht. Falls Sie GRUB als Bootmenü installiert haben, müssen Sie 
die Datei /boot/grub/menu.lst bearbeiten, indem Sie Ihren Lieblingstexteditor 
folgendermaßen in einem Terminal starten:\n\n\tsudo <Lieblingstexteditor> 
/boot/grub/menu.lst\n\nSie werden feststellen, dass GRUB ein etwas anderes 
Namensschema für Festplatten verwendet als Linux.\n\nIn GRUB lautet es: 
(hdN,n)\n\nAlle Festplatten beginnen mit \"hd\"\n\"N\" bezeichnet die 
Festplattennummer, angefangen bei \"0\".\n\"n\" ist die Partitionsnummer, auch 
mit \"0\" beginnend.\nDie erste logische Partition hat immer die Nummer
  4, unabhängig von der Anzahl der primären Partitionen.\n\nDemnach müssen Sie 
hinter allen anderen Einträgen am Ende der Datei etwas wie die folgenden Zeilen 
einfügen:\n\n\t# Haiku auf 
/dev/sda7\n\ttitle\t\t\t\tHaiku\n\trootnoverify\t\t(hd0,6)\n\tchainloader\t\t+1\n\nDie
 richtige Partition sollte auch beispielsweise in GParted erkennbar sein.\n\n3) 
 Wenn Sie Haiku das erste Mal erfolgreich gestartet haben, sollten Sie die 
Willkommensdokumentation lesen, eine Verküpfung wurde auf dem Desktop 
angelegt.\n\nViel Spaß und vielen Dank, dass Sie Haiku ausprobieren! Wir 
hoffen, dass es Ihnen gefällt!
+Write boot sector      InstallerWindow         Bootsektor schreiben
+DriveSetup, the application to configure disk partitions, could not be 
launched.       InstallerWindow         DriveSetup, das Werkzeug zum Einrichten 
von Partitionen, konnte nicht gestartet werden.
+%3.1f GB       PackagesView            %3.1f GB
+No optional packages available.        PackagesView            Keine 
optionalen Pakete verfügbar.
+Additional disk space required: 0.0 KB InstallerWindow         Zusätzlich 
benötigter Platz: 0,0 KB
+Continue       InstallerApp            Weiter
+Additional disk space required: %s     InstallerWindow         Zusätzlich 
benötigter Platz: %s
+Cancel InstallProgress         Abbrechen
+Try installing anyway  InstallProgress         Trotzdem installieren
+Are you sure you want to to stop the installation?     InstallerWindow         
Möchten Sie die Installation wirklich abbrechen?
+Writes the Haiku boot code to the partition start\nsector. This step is 
automatically performed by\nthe installation, but you can manually make 
a\npartition bootable in case you do not need to\nperform an installation.     
InstallerWindow         Schreibt den Haiku Bootcode in den Startsektor\nder 
Zielpartition. Dieser Schritt wird bei einer\nInstallation automatisch 
ausgeführt, aber Sie\nkönnen ihn manuell auslösen, falls Sie bereits\nwissen, 
dass Sie keine Installation durchführen\nmüssen.
+Onto:  InstallerWindow         Ziel:
+The target volume is not empty. Are you sure you want to install 
anyway?\n\nNote: The 'system' folder will be a clean copy from the source 
volume, all other folders will be merged, whereas files and links that exist on 
both the source and target volume will be overwritten with the source volume 
version.       InstallProgress         Das Zielvolumen ist nicht leer. Sind Sie 
sicher, dass Sie mit der Installation fortfahren möchten?\n\nHinweis: Der 
Ordner 'system' würde eine saubere Kopie aus dem Quellvolumen, alle anderen 
Ordner werden zusammengefügt, wobei Dateien und Verknüpfungen, die es sowohl 
auf dem Ziel- als auch auf dem Quellvolumen gibt, mit der Version des 
Quellvolumens überschrieben werden.

Modified: haiku/trunk/src/apps/installer/InstallerApp.cpp
===================================================================
--- haiku/trunk/src/apps/installer/InstallerApp.cpp     2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/InstallerApp.cpp     2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -9,6 +9,7 @@
 #include <Alert.h>
 #include <Button.h>
 #include <GroupLayoutBuilder.h>
+#include <Locale.h>
 #include <Screen.h>
 #include <ScrollView.h>
 #include <TextView.h>
@@ -41,60 +42,10 @@
 //"IN THE SOFTWARE.";
 
 
-static const char* kInfoText =
-"Welcome to the Haiku Installer!\n\n"
+#undef TR_CONTEXT
+#define TR_CONTEXT "InstallerApp"
 
-"IMPORTANT INFORMATION BEFORE INSTALLING HAIKU\n\n"
 
-"This is alpha-quality software! It means there is a high risk of losing "
-"important data. Make frequent backups! You have been warned.\n\n"
-
-"1)  If you are installing Haiku onto real hardware (not inside an emulator) "
-"it is recommended that you have already prepared a hard disk partition. The "
-"Installer and the DriveSetup tool offer to initialize existing partitions "
-"with the Haiku native file system, but the options to change the actual "
-"partition layout may not have been tested on a sufficiently great variety of "
-"computer installations so we do not recommend using it.\n"
-"If you have not created a partition yet, simply reboot, create the partition "
-"using whatever tool you feel most comfortable with, and reboot into Haiku to "
-"continue with the installation. You could for example use the GParted "
-"Live-CD, it can also resize existing partitions to make room.\n\n"
-
-"2)  The Installer will take no steps to integrate Haiku into an existing boot 
"
-"menu. The Haiku partition itself will be made bootable. If you have GRUB "
-"already installed, edit your /boot/grub/menu.lst by launching your favorite "
-"editor from a Terminal like this:\n\n"
-
-"\tsudo <your favorite text editor> /boot/grub/menu.lst\n\n"
-
-"You'll note that GRUB uses a different naming strategy for hard drives than "
-"Linux.\n\n"
-
-"With GRUB it's: (hdN,n)\n\n"
-
-"All harddisks start with \"hd\"\n"
-"\"N\" is the hard disk number, starting with \"0\".\n"
-"\"n\" is the partition number, also starting with \"0\".\n"
-"The first logical partition always has the number 4, regardless of the "
-"number of primary partitions.\n\n"
-
-"So behind the other menu entries towards the bottom of the file, add "
-"something similar to these lines:\n\n"
-
-"\t# Haiku on /dev/sda7\n"
-"\ttitle\t\t\t\tHaiku\n"
-"\trootnoverify\t\t(hd0,6)\n"
-"\tchainloader\t\t+1\n\n"
-
-"You can see the correct partition in GParted for example.\n\n"
-
-"3)  When you successfully boot into Haiku for the first time, make sure to 
read "
-"our \"Welcome\" documentation, there is a link on the Desktop.\n\n"
-
-"Have fun and thanks a lot for trying out Haiku! We hope you like it!"
-;
-
-
 int main(int, char **)
 {
        InstallerApp theApp;
@@ -104,7 +55,8 @@
 
 
 InstallerApp::InstallerApp()
-       : BApplication("application/x-vnd.Haiku-Installer")
+       :
+       BApplication("application/x-vnd.Haiku-Installer")
 {
 }
 
@@ -128,9 +80,9 @@
 void
 InstallerApp::AboutRequested()
 {
-       BAlert *alert = new BAlert("about", "Installer\n"
-               "\twritten by Jérôme Duval\n"
-               "\tCopyright 2005, Haiku.\n\n", "OK");
+       BAlert *alert = new BAlert("about", TR("Installer\n"
+               "\twritten by Jérôme Duval and Stephan Aßmus\n"
+               "\tCopyright 2005-2010, Haiku.\n\n"), TR("OK"));
        BTextView *view = alert->TextView();
        BFont font;
 
@@ -148,6 +100,67 @@
 void
 InstallerApp::ReadyToRun()
 {
+       // Initilialize the Locale Kit
+       be_locale->GetAppCatalog(&fCatalog);
+
+       const char* infoText = TR(
+               "Welcome to the Haiku Installer!\n\n"
+               
+               "IMPORTANT INFORMATION BEFORE INSTALLING HAIKU\n\n"
+               
+               "This is alpha-quality software! It means there is a high risk 
of "
+               "losing important data. Make frequent backups! You have been "
+               "warned.\n\n"
+               
+               "1)  If you are installing Haiku onto real hardware (not inside 
an "
+               "emulator) it is recommended that you have already prepared a 
hard "
+               "disk partition. The Installer and the DriveSetup tool offer to 
"
+               "initialize existing partitions with the Haiku native file 
system, "
+               "but the options to change the actual partition layout may not 
have "
+               "been tested on a sufficiently great variety of computer "
+               "installations so we do not recommend using it.\n"
+               "If you have not created a partition yet, simply reboot, create 
the "
+               "partition using whatever tool you feel most comfortable with, 
and "
+               "reboot into Haiku to continue with the installation. You could 
for "
+               "example use the GParted Live-CD, it can also resize existing "
+               "partitions to make room.\n\n"
+               
+               "2)  The Installer will take no steps to integrate Haiku into 
an "
+               "existing boot menu. The Haiku partition itself will be made "
+               "bootable. If you have GRUB already installed, edit your "
+               "/boot/grub/menu.lst by launching your favorite editor from a "
+               "Terminal like this:\n\n"
+               
+               "\tsudo <your favorite text editor> /boot/grub/menu.lst\n\n"
+               
+               "You'll note that GRUB uses a different naming strategy for 
hard "
+               "drives than Linux.\n\n"
+               
+               "With GRUB it's: (hdN,n)\n\n"
+               
+               "All harddisks start with \"hd\"\n"
+               "\"N\" is the hard disk number, starting with \"0\".\n"
+               "\"n\" is the partition number, also starting with \"0\".\n"
+               "The first logical partition always has the number 4, 
regardless of "
+               "the number of primary partitions.\n\n"
+               
+               "So behind the other menu entries towards the bottom of the 
file, add "
+               "something similar to these lines:\n\n"
+               
+               "\t# Haiku on /dev/sda7\n"
+               "\ttitle\t\t\t\tHaiku\n"
+               "\trootnoverify\t\t(hd0,6)\n"
+               "\tchainloader\t\t+1\n\n"
+               
+               "You can see the correct partition in GParted for example.\n\n"
+               
+               "3)  When you successfully boot into Haiku for the first time, 
make "
+               "sure to read our \"Welcome\" documentation, there is a link on 
the "
+               "Desktop.\n\n"
+               
+               "Have fun and thanks a lot for trying out Haiku! We hope you 
like it!"
+       );
+
 #if 1
        // Show the EULA first.
        BTextView* textView = new BTextView("eula", be_plain_font, NULL,
@@ -155,22 +168,22 @@
        textView->SetInsets(10, 10, 10, 10);
        textView->MakeEditable(false);
        textView->MakeSelectable(false);
-       textView->SetText(kInfoText);
+       textView->SetText(infoText);
 
        BScrollView* scrollView = new BScrollView("eulaScroll",
                textView, B_WILL_DRAW, false, true);
 
-       BButton* cancelButton = new BButton("Quit",
+       BButton* cancelButton = new BButton(TR("Quit"),
                new BMessage(B_QUIT_REQUESTED));
        cancelButton->SetTarget(this);
 
-       BButton* continueButton = new BButton("Continue",
+       BButton* continueButton = new BButton(TR("Continue"),
                new BMessage(kMsgAgree));
        continueButton->SetTarget(this);
        continueButton->MakeDefault(true);
 
        BRect eulaFrame = BRect(0, 0, 600, 450);
-       fEULAWindow = new BWindow(eulaFrame, "README",
+       fEULAWindow = new BWindow(eulaFrame, TR("README"),
                B_MODAL_WINDOW, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
                        | B_AUTO_UPDATE_SIZE_LIMITS);
 

Modified: haiku/trunk/src/apps/installer/InstallerApp.h
===================================================================
--- haiku/trunk/src/apps/installer/InstallerApp.h       2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/InstallerApp.h       2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -6,6 +6,8 @@
 #define INSTALLER_APP_H
 
 #include <Application.h>
+#include <Catalog.h>
+
 #include "InstallerWindow.h"
 
 
@@ -19,6 +21,7 @@
 
 private:
                        BWindow*                        fEULAWindow;
+                       BCatalog                        fCatalog;
 };
 
 #endif // INSTALLER_APP_H

Modified: haiku/trunk/src/apps/installer/InstallerWindow.cpp
===================================================================
--- haiku/trunk/src/apps/installer/InstallerWindow.cpp  2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/InstallerWindow.cpp  2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -14,12 +14,14 @@
 #include <Autolock.h>
 #include <Box.h>
 #include <Button.h>
+#include <Catalog.h>
 #include <ClassInfo.h>
 #include <Directory.h>
 #include <FindDirectory.h>
 #include <GridLayoutBuilder.h>
 #include <GroupLayoutBuilder.h>
 #include <LayoutUtils.h>
+#include <Locale.h>
 #include <MenuBar.h>
 #include <MenuField.h>
 #include <Path.h>
@@ -43,6 +45,9 @@
 #include "WorkerThread.h"
 
 
+#undef TR_CONTEXT
+#define TR_CONTEXT "InstallerWindow"
+
 #define DRIVESETUP_SIG "application/x-vnd.Haiku-DriveSetup"
 
 const uint32 BEGIN_MESSAGE = 'iBGN';
@@ -143,8 +148,8 @@
 
 
 InstallerWindow::InstallerWindow()
-       : BWindow(BRect(-2000, -2000, -1800, -1800), "Installer", 
B_TITLED_WINDOW,
-               B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
+       : BWindow(BRect(-2000, -2000, -1800, -1800), TR("Installer"),
+               B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
        fEncouragedToSetupPartitions(false),
        fDriveSetupLaunched(false),
        fInstallStatus(kReadyForInstall),
@@ -162,19 +167,20 @@
        logoView->SetExplicitMaxSize(logoSize);
        fStatusView->SetExplicitMinSize(BSize(logoSize.width * 0.66, 
B_SIZE_UNSET));
 
-       fDestMenu = new BPopUpMenu("scanning" B_UTF8_ELLIPSIS, true, false);
-       fSrcMenu = new BPopUpMenu("scanning" B_UTF8_ELLIPSIS, true, false);
+       fDestMenu = new BPopUpMenu(TR("scanning" B_UTF8_ELLIPSIS), true, false);
+       fSrcMenu = new BPopUpMenu(TR("scanning" B_UTF8_ELLIPSIS), true, false);
 
-       fSrcMenuField = new BMenuField("srcMenuField", "Install from: ", 
fSrcMenu,
-               NULL);
+       fSrcMenuField = new BMenuField("srcMenuField", TR("Install from:"),
+               fSrcMenu, NULL);
        fSrcMenuField->SetAlignment(B_ALIGN_RIGHT);
 
-       fDestMenuField = new BMenuField("destMenuField", "Onto: ", fDestMenu, 
NULL);
+       fDestMenuField = new BMenuField("destMenuField", TR("Onto:"), fDestMenu,
+               NULL);
        fDestMenuField->SetAlignment(B_ALIGN_RIGHT);
 
        fPackagesSwitch = new PaneSwitch("options_button");
-       fPackagesSwitch->SetLabels("Hide optional packages",
-               "Show optional packages");
+       fPackagesSwitch->SetLabels(TR("Hide optional packages"),
+               TR("Show optional packages"));
        fPackagesSwitch->SetMessage(new BMessage(SHOW_BOTTOM_MESSAGE));
        fPackagesSwitch->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED,
                B_SIZE_UNSET));
@@ -186,26 +192,26 @@
                fPackagesView, B_WILL_DRAW, false, true);
 
        const char* requiredDiskSpaceString
-               = "Additional disk space required: 0.0 KB";
+               = TR("Additional disk space required: 0.0 KB");
        fSizeView = new BStringView("size_view", requiredDiskSpaceString);
        fSizeView->SetAlignment(B_ALIGN_RIGHT);
        fSizeView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 
B_SIZE_UNLIMITED));
        fSizeView->SetExplicitAlignment(
                BAlignment(B_ALIGN_RIGHT, B_ALIGN_MIDDLE));
 
-       fProgressBar = new BStatusBar("progress", "Install progress:  ");
+       fProgressBar = new BStatusBar("progress", TR("Install progress:  "));
        fProgressBar->SetMaxValue(100.0);
 
-       fBeginButton = new BButton("begin_button", "Begin",
+       fBeginButton = new BButton("begin_button", TR("Begin"),
                new BMessage(BEGIN_MESSAGE));
        fBeginButton->MakeDefault(true);
        fBeginButton->SetEnabled(false);
 
        fSetupButton = new BButton("setup_button",
-               "Set up partitions" B_UTF8_ELLIPSIS, new 
BMessage(SETUP_MESSAGE));
+               TR("Set up partitions" B_UTF8_ELLIPSIS), new 
BMessage(SETUP_MESSAGE));
 
        fMakeBootableButton = new BButton("makebootable_button",
-               "Write boot sector", new BMessage(MSG_WRITE_BOOT_SECTOR));
+               TR("Write boot sector"), new BMessage(MSG_WRITE_BOOT_SECTOR));
        fMakeBootableButton->SetEnabled(false);
 
        SetLayout(new BGroupLayout(B_HORIZONTAL));
@@ -252,17 +258,17 @@
 
        // Setup tool tips for the non-obvious features
        fSetupButton->SetToolTip(
-               "Launch the DriveSetup utility to partition\n"
+               TR("Launch the DriveSetup utility to partition\n"
                "available hard drives and other media.\n"
                "Partitions can be initialized with the\n"
                "Be File System needed for a Haiku boot\n"
-               "partition.");
+               "partition."));
        fMakeBootableButton->SetToolTip(
-               "Writes the Haiku boot code to the partition start\n"
+               TR("Writes the Haiku boot code to the partition start\n"
                "sector. This step is automatically performed by\n"
                "the installation, but you can manually make a\n"
                "partition bootable in case you do not need to\n"
-               "perform an installation.");
+               "perform an installation."));
 
        // finish creating window
        if (!be_roster->IsRunning(kDeskbarSignature))
@@ -302,10 +308,10 @@
                        status_t error;
                        if (msg->FindInt32("error", &error) == B_OK) {
                                char errorMessage[2048];
-                               snprintf(errorMessage, sizeof(errorMessage), 
"An error was "
+                               snprintf(errorMessage, sizeof(errorMessage), 
TR("An error was "
                                        "encountered and the installation was 
not completed:\n\n"
-                                       "Error:  %s", strerror(error));
-                               (new BAlert("error", errorMessage, "OK"))->Go();
+                                       "Error:  %s"), strerror(error));
+                               (new BAlert("error", errorMessage, 
TR("OK")))->Go();
                        }
 
                        _DisableInterface(false);
@@ -334,7 +340,7 @@
                                        fWorkerThread->SetSpaceRequired(size);
                                        fInstallStatus = kInstalling;
                                        fWorkerThread->StartInstall();
-                                       fBeginButton->SetLabel("Stop");
+                                       fBeginButton->SetLabel(TR("Stop"));
                                        _DisableInterface(true);
 
                                        fProgressBar->SetTo(0.0, NULL, NULL);
@@ -375,16 +381,16 @@
                        char buffer[15];
                        fPackagesView->GetTotalSizeAsString(buffer);
                        char string[255];
-                       sprintf(string, "Additional disk space required: %s", 
buffer);
+                       sprintf(string, TR("Additional disk space required: 
%s"), buffer);
                        fSizeView->SetText(string);
                        break;
                }
                case ENCOURAGE_DRIVESETUP:
                {
-                       (new BAlert("use drive setup", "No partitions have been 
found that "
-                               "are suitable for installation. Please set up 
partitions and "
-                               "initialize at least one partition with the Be 
file system." ,
-                               "OK"))->Go();
+                       (new BAlert("use drive setup", TR("No partitions have 
been found "
+                               "that are suitable for installation. Please set 
up partitions "
+                               "and initialize at least one partition with the 
Be File "
+                               "System."), TR("OK")))->Go();
                }
                case MSG_STATUS_MESSAGE:
                {
@@ -395,16 +401,21 @@
                        float progress;
                        if (msg->FindFloat("progress", &progress) == B_OK) {
                                const char* currentItem;
-                               if (msg->FindString("item", &currentItem) != 
B_OK)
-                                       currentItem = "???";
+                               if (msg->FindString("item", &currentItem) != 
B_OK) {
+                                       currentItem = TR_CMT("???",
+                                               "Unknown currently copied 
item");
+                               }
                                BString trailingLabel;
                                int32 currentCount;
                                int32 maximumCount;
                                if (msg->FindInt32("current", &currentCount) == 
B_OK
                                        && msg->FindInt32("maximum", 
&maximumCount) == B_OK) {
-                                       trailingLabel << currentCount << " of " 
<< maximumCount;
+                                       char buffer[64];
+                                       snprintf(buffer, sizeof(buffer), 
TR_CMT("%1ld of %2ld",
+                                               "number of files copied"), 
currentCount, maximumCount);
+                                       trailingLabel << buffer;
                                } else {
-                                       trailingLabel << "?? of ??";
+                                       trailingLabel << TR_CMT("?? of ??", 
"Unknown progress");
                                }
                                fProgressBar->SetTo(progress, currentItem,
                                        trailingLabel.String());
@@ -423,22 +434,28 @@
                        
                        _SetCopyEngineCancelSemaphore(-1);
 
-                       fBeginButton->SetLabel("Quit");
+                       fBeginButton->SetLabel(TR("Quit"));
 
                        PartitionMenuItem* dstItem
                                = (PartitionMenuItem*)fDestMenu->FindMarked();
 
-                       const char* quitString;
-                       if (be_roster->IsRunning(kDeskbarSignature))
-                               quitString = "leave the Installer";
-                       else
-                               quitString = "restart the computer";
+                       char status[1024];
+                       if (be_roster->IsRunning(kDeskbarSignature)) {
+                               snprintf(status, sizeof(status), 
TR("Installation completed. "
+                                       "Boot sector has been written to '%s'. 
Press Quit to "
+                                       "leave the Installer or choose a new 
target volume to "
+                                       "perform another installation."),
+                                       dstItem ? dstItem->Name() : 
TR_CMT("???",
+                                               "Unknown partition name"));
+                       } else {
+                               snprintf(status, sizeof(status), 
TR("Installation completed. "
+                                       "Boot sector has been written to '%s'. 
Press Quit to "
+                                       "restart the computer or choose a new 
target volume "
+                                       "to perform another installation."),
+                                       dstItem ? dstItem->Name() : 
TR_CMT("???",
+                                               "Unknown partition name"));
+                       }
 
-                       char status[1024];
-                       snprintf(status, sizeof(status), "Installation 
completed. "
-                               "Boot sector has been written to '%s'. Press 
Quit to %s "
-                               "or choose a new target volume to perform 
another "
-                               "installation.", dstItem ? dstItem->Name() : 
"???", quitString);
                        _SetStatusMessage(status);
                        fInstallStatus = kFinished;
                        _DisableInterface(false);
@@ -457,9 +474,9 @@
                                fBeginButton->SetEnabled(!fDriveSetupLaunched);
                                _DisableInterface(fDriveSetupLaunched);
                                if (fDriveSetupLaunched)
-                                       _SetStatusMessage("Running DriveSetup" 
B_UTF8_ELLIPSIS
+                                       _SetStatusMessage(TR("Running 
DriveSetup" B_UTF8_ELLIPSIS
                                                "\n\nClose DriveSetup to 
continue with the "
-                                               "installation.");
+                                               "installation."));
                                else
                                        _ScanPartitions();
                        }
@@ -481,8 +498,8 @@
 {
        if (fDriveSetupLaunched) {
                (new BAlert("driveSetup",
-                       "Please close the DriveSetup window before closing the "
-                       "Installer window.", "OK"))->Go();
+                       TR("Please close the DriveSetup window before closing 
the "
+                       "Installer window."), TR("OK")))->Go();
                return false;
        }
        _QuitCopyEngine(false);
@@ -520,9 +537,9 @@
                BEntry entry(path.Path());
                entry_ref ref;
                if (entry.GetRef(&ref) != B_OK || be_roster->Launch(&ref) != 
B_OK) {
-                       BAlert* alert = new BAlert("error", "DriveSetup, the 
application "
-                               "to configure disk partitions, could not be 
launched.",
-                               "OK");
+                       BAlert* alert = new BAlert("error", TR("DriveSetup, the 
"
+                               "application to configure disk partitions, 
could not be "
+                               "launched."), TR("OK"));
                        alert->Go();
                }
        }
@@ -542,7 +559,7 @@
 void
 InstallerWindow::_ScanPartitions()
 {
-       _SetStatusMessage("Scanning for disks" B_UTF8_ELLIPSIS);
+       _SetStatusMessage(TR("Scanning for disks" B_UTF8_ELLIPSIS));
 
        BMenuItem *item;
        while ((item = fSrcMenu->RemoveItem((int32)0)))
@@ -568,7 +585,7 @@
                label = srcItem->MenuLabel();
        } else {
                if (fSrcMenu->CountItems() == 0)
-                       label = "<none>";
+                       label = TR_CMT("<none>", "No partition available");
                else
                        label = 
((PartitionMenuItem*)fSrcMenu->ItemAt(0))->MenuLabel();
        }
@@ -597,36 +614,40 @@
                label = dstItem->MenuLabel();
        } else {
                if (fDestMenu->CountItems() == 0)
-                       label = "<none>";
+                       label = TR_CMT("<none>", "No partition available");
                else
-                       label = "Please choose target";
+                       label = TR("Please choose target");
        }
        fDestMenuField->MenuItem()->SetLabel(label.String());
 
        if (srcItem && dstItem) {
                char message[255];
-               sprintf(message, "Press the Begin button to install from '%s' 
onto "
-                       "'%s'.", srcItem->Name(), dstItem->Name());
+               sprintf(message, TR("Press the Begin button to install from 
'%1s' "
+                       "onto '%2s'."), srcItem->Name(), dstItem->Name());
                _SetStatusMessage(message);
        } else if (srcItem) {
-               _SetStatusMessage("Choose the disk you want to install onto 
from the "
-                       "pop-up menu. Then click \"Begin\".");
+               _SetStatusMessage(TR("Choose the disk you want to install onto 
from "
+                       "the pop-up menu. Then click \"Begin\"."));
        } else if (dstItem) {
-               _SetStatusMessage("Choose the source disk from the "
-                       "pop-up menu. Then click \"Begin\".");
+               _SetStatusMessage(TR("Choose the source disk from the "
+                       "pop-up menu. Then click \"Begin\"."));
        } else {
-               _SetStatusMessage("Choose the source and destination disk from 
the "
-                       "pop-up menus. Then click \"Begin\".");
+               _SetStatusMessage(TR("Choose the source and destination disk 
from the "
+                       "pop-up menus. Then click \"Begin\"."));
        }
 
        fInstallStatus = kReadyForInstall;
-       fBeginButton->SetLabel("Begin");
+       fBeginButton->SetLabel(TR("Begin"));
        fBeginButton->SetEnabled(srcItem && dstItem);
 
        // adjust "Write Boot Sector" button
-       label = "Write boot sector";
-       if (dstItem)
-               label << " to \'" <<dstItem->Name() << '\'';
+       if (dstItem) {
+               char buffer[256];
+               snprintf(buffer, sizeof(buffer), TR("Write boot sector to 
'%s'"),
+                       dstItem->Name());
+               label = buffer;
+       } else
+               label = TR("Write boot sector");
        fMakeBootableButton->SetEnabled(dstItem);
        fMakeBootableButton->SetLabel(label.String());
 
@@ -646,7 +667,6 @@
        if (!item)
                return;
 
-#ifdef __HAIKU__
        BPath directory;
        BDiskDeviceRoster roster;
        BDiskDevice device;
@@ -659,9 +679,6 @@
                        return;
        } else
                return; // shouldn't happen
-#else
-       BPath directory = "/BeOS 5 PE Max Edition V3.1 beta";
-#endif
 
        directory.Append(PACKAGES_DIRECTORY);
        BDirectory dir(directory.Path());
@@ -671,10 +688,9 @@
        BEntry packageEntry;
        BList packages;
        while (dir.GetNextEntry(&packageEntry) == B_OK) {
-               Package *package = Package::PackageFromEntry(packageEntry);
-               if (package) {
+               Package* package = Package::PackageFromEntry(packageEntry);
+               if (package != NULL)
                        packages.AddItem(package);
-               }
        }
        packages.SortItems(_ComparePackages);
 
@@ -715,8 +731,9 @@
        bool quit = true;
        if (askUser) {
                quit = (new BAlert("cancel",
-                       "Are you sure you want to to stop the installation?", 
-                       "Continue", "Stop", 0,
+                       TR("Are you sure you want to to stop the 
installation?"),
+                       TR_CMT("Continue", "In alert after pressing Stop"),
+                       TR_CMT("Stop", "In alert after pressing Stop"), 0,
                        B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0;
        }
 
@@ -732,18 +749,18 @@
 
 
 int
-InstallerWindow::_ComparePackages(const void *firstArg, const void *secondArg)
+InstallerWindow::_ComparePackages(const void* firstArg, const void* secondArg)
 {
-       const Group *group1 = *static_cast<const Group * const *>(firstArg);
-       const Group *group2 = *static_cast<const Group * const *>(secondArg);
-       const Package *package1 = dynamic_cast<const Package *>(group1);
-       const Package *package2 = dynamic_cast<const Package *>(group2);
+       const Group* group1 = *static_cast<const Group* const *>(firstArg);
+       const Group* group2 = *static_cast<const Group* const *>(secondArg);
+       const Package* package1 = dynamic_cast<const Package*>(group1);
+       const Package* package2 = dynamic_cast<const Package*>(group2);
        int sameGroup = strcmp(group1->GroupName(), group2->GroupName());
        if (sameGroup != 0)
                return sameGroup;
-       if (!package2)
+       if (package2 == NULL)
                return -1;
-       if (!package1)
+       if (package1 == NULL)
                return 1;
        return strcmp(package1->Name(), package2->Name());
 }

Modified: haiku/trunk/src/apps/installer/Jamfile
===================================================================
--- haiku/trunk/src/apps/installer/Jamfile      2010-01-20 19:34:45 UTC (rev 
35208)
+++ haiku/trunk/src/apps/installer/Jamfile      2010-01-20 20:06:30 UTC (rev 
35209)
@@ -12,5 +12,19 @@
        ProgressReporter.cpp
        UnzipEngine.cpp
        WorkerThread.cpp
-       : be tracker translation libshared.a $(TARGET_LIBSTDC++)
-       : Installer.rdef ;
+       : be tracker translation libshared.a $(TARGET_LIBSTDC++) liblocale.so
+       : Installer.rdef
+;
+
+DoCatalogs Installer :
+       x-vnd.Haiku-Installer
+       :
+       InstallerApp.cpp
+       InstallerWindow.cpp
+       PackageViews.cpp
+       ProgressReporter.cpp
+       WorkerThread.cpp
+       : en.catalog
+       : de.catkeys
+;
+

Modified: haiku/trunk/src/apps/installer/PackageViews.cpp
===================================================================
--- haiku/trunk/src/apps/installer/PackageViews.cpp     2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/PackageViews.cpp     2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -8,6 +8,7 @@
 
 #include <stdio.h>
 
+#include <Catalog.h>
 #include <ControlLook.h>
 #include <Directory.h>
 #include <Entry.h>
@@ -21,40 +22,41 @@
 #include "InstallerWindow.h"
 
 
+#undef TR_CONTEXT
+#define TR_CONTEXT "PackagesView"
+
 #define ICON_ATTRIBUTE "INSTALLER PACKAGE: ICON"
 
-void SizeAsString(off_t size, char *string);
-
-
 void
 SizeAsString(off_t size, char *string)
 {
        double kb = size / 1024.0;
        if (kb < 1.0) {
-               sprintf(string, "%Ld B", size);
+               sprintf(string, TR("%Ld B"), size);
                return;
        }
        float mb = kb / 1024.0;
        if (mb < 1.0) {
-               sprintf(string, "%3.1f KB", kb);
+               sprintf(string, TR("%3.1f KB"), kb);
                return;
        }
        float gb = mb / 1024.0;
        if (gb < 1.0) {
-               sprintf(string, "%3.1f MB", mb);
+               sprintf(string, TR("%3.1f MB"), mb);
                return;
        }
        float tb = gb / 1024.0;
        if (tb < 1.0) {
-               sprintf(string, "%3.1f GB", gb);
+               sprintf(string, TR("%3.1f GB"), gb);
                return;
        }
-       sprintf(string, "%.1f TB", tb);
+       sprintf(string, TR("%.1f TB"), tb);
 }
 
 
 Package::Package(const char *folder)
-       : Group(),
+       :
+       Group(),
        fSize(0),
        fIcon(NULL)
 {
@@ -115,7 +117,8 @@
        if (directory.GetAttrInfo(ICON_ATTRIBUTE, &info) == B_OK) {
                char buffer[info.size];
                BMessage msg;
-               if ((directory.ReadAttr(ICON_ATTRIBUTE, info.type, 0, buffer, 
info.size) == info.size)
+               if ((directory.ReadAttr(ICON_ATTRIBUTE, info.type, 0, buffer,
+                               info.size) == info.size)
                        && (msg.Unflatten(buffer) == B_OK)) {
                        package->SetIcon(new BBitmap(&msg));
                }
@@ -145,7 +148,8 @@
 
 
 PackageCheckBox::PackageCheckBox(BRect rect, Package *item)
-       : BCheckBox(rect.OffsetBySelf(7, 0), "pack_cb", item->Name(), NULL),
+       :
+       BCheckBox(rect.OffsetBySelf(7, 0), "pack_cb", item->Name(), NULL),
        fPackage(item)
 {
 }
@@ -189,7 +193,8 @@
 
 
 GroupView::GroupView(BRect rect, Group *group)
-       : BStringView(rect, "group", group->GroupName()),
+       :
+       BStringView(rect, "group", group->GroupName()),
        fGroup(group)
 {
        SetFont(be_bold_font);
@@ -206,13 +211,15 @@
 
 
 PackagesView::PackagesView(BRect rect, const char* name)
-       : BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS)
+       :
+       BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS)
 {
 }
 
 
 PackagesView::PackagesView(const char* name)
-       : BView(name, B_WILL_DRAW | B_FRAME_EVENTS)
+       :
+       BView(name, B_WILL_DRAW | B_FRAME_EVENTS)
 {
 }
 
@@ -226,7 +233,7 @@
 void
 PackagesView::Clean()
 {
-       BView *view;
+       BView* view;
        while ((view = ChildAt(0))) {
                if (dynamic_cast<GroupView*>(view)
                        || dynamic_cast<PackageCheckBox*>(view)) {
@@ -239,7 +246,7 @@
 
 
 void
-PackagesView::AddPackages(BList &packages, BMessage *msg)
+PackagesView::AddPackages(BList& packages, BMessage* msg)
 {
        int32 count = packages.CountItems();
        BRect rect = Bounds();
@@ -249,18 +256,18 @@
        rect.top = 0;
        BString lastGroup = "";
        for (int32 i = 0; i < count; i++) {
-               void *item = packages.ItemAt(i);
-               Package *package = static_cast<Package *>(item);
+               void* item = packages.ItemAt(i);
+               Package* package = static_cast<Package*>(item);
                if (lastGroup != BString(package->GroupName())) {
                        rect.OffsetBy(0, 1);
                        lastGroup = package->GroupName();
-                       Group *group = new Group();
+                       Group* group = new Group();
                        group->SetGroupName(package->GroupName());
                        GroupView *view = new GroupView(rect, group);
                        AddChild(view);
                        rect.OffsetBy(0, 17);
                }
-               PackageCheckBox *checkBox = new PackageCheckBox(rect, package);
+               PackageCheckBox* checkBox = new PackageCheckBox(rect, package);
                checkBox->SetValue(package->OnByDefault()
                        ? B_CONTROL_ON : B_CONTROL_OFF);
                checkBox->SetEnabled(!package->AlwaysOn());
@@ -274,12 +281,12 @@
 
 
 void
-PackagesView::GetTotalSizeAsString(char *string)
+PackagesView::GetTotalSizeAsString(char* string)
 {
        int32 count = CountChildren();
        int32 size = 0;
        for (int32 i = 0; i < count; i++) {
-               PackageCheckBox *cb = 
dynamic_cast<PackageCheckBox*>(ChildAt(i));
+               PackageCheckBox* cb = 
dynamic_cast<PackageCheckBox*>(ChildAt(i));
                if (cb && cb->Value())
                        size += cb->GetPackage()->Size();
        }
@@ -288,12 +295,12 @@
 
 
 void
-PackagesView::GetPackagesToInstall(BList *list, int32 *size)
+PackagesView::GetPackagesToInstall(BList* list, int32* size)
 {
        int32 count = CountChildren();
        *size = 0;
        for (int32 i = 0; i < count; i++) {
-               PackageCheckBox *cb = 
dynamic_cast<PackageCheckBox*>(ChildAt(i));
+               PackageCheckBox* cb = 
dynamic_cast<PackageCheckBox*>(ChildAt(i));
                if (cb && cb->Value()) {
                        list->AddItem(cb->GetPackage());
                        *size += cb->GetPackage()->Size();
@@ -338,7 +345,7 @@
        if (CountChildren() > 0)
                return;
 
-       be_control_look->DrawLabel(this, "No optional packages available.",
+       be_control_look->DrawLabel(this, TR("No optional packages available."),
                Bounds(), updateRect, ViewColor(), BControlLook::B_DISABLED,
                BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
 }

Modified: haiku/trunk/src/apps/installer/ProgressReporter.cpp
===================================================================
--- haiku/trunk/src/apps/installer/ProgressReporter.cpp 2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/ProgressReporter.cpp 2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -1,13 +1,19 @@
 /*
- * Copyright 2009, Stephan Aßmus <superstippi@xxxxxx>
- *  All rights reserved. Distributed under the terms of the MIT License.
+ * Copyright 2009-2010, Stephan Aßmus <superstippi@xxxxxx>
+ * All rights reserved. Distributed under the terms of the MIT License.
  */
 
 #include "ProgressReporter.h"
 
 #include <stdio.h>
 
+#include <Catalog.h>
 
+
+#undef TR_CONTEXT
+#define TR_CONTEXT "InstallProgress"
+
+
 ProgressReporter::ProgressReporter(const BMessenger& messenger,
                BMessage* message)
        :
@@ -42,7 +48,7 @@
 
        if (fMessage) {
                BMessage message(*fMessage);
-               message.AddString("status", "Collecting copy information.");
+               message.AddString("status", TR("Collecting copy information."));
                fMessenger.SendMessage(&message);
        }
 }
@@ -66,7 +72,7 @@
 
        if (fMessage) {
                BMessage message(*fMessage);
-               message.AddString("status", "Performing installation.");
+               message.AddString("status", TR("Performing installation."));
                fMessenger.SendMessage(&message);
        }
 }

Modified: haiku/trunk/src/apps/installer/WorkerThread.cpp
===================================================================
--- haiku/trunk/src/apps/installer/WorkerThread.cpp     2010-01-20 19:34:45 UTC 
(rev 35208)
+++ haiku/trunk/src/apps/installer/WorkerThread.cpp     2010-01-20 20:06:30 UTC 
(rev 35209)
@@ -10,6 +10,7 @@
 
 #include <Alert.h>
 #include <Autolock.h>
+#include <Catalog.h>
 #include <Directory.h>
 #include <DiskDeviceVisitor.h>
 #include <DiskDeviceTypes.h>
@@ -31,6 +32,9 @@
 #include "UnzipEngine.h"
 
 
+#define TR_CONTEXT "InstallProgress"
+
+
 //#define COPY_TRACE
 #ifdef COPY_TRACE
 #define CALLED()               printf("CALLED %s\n",__PRETTY_FUNCTION__)
@@ -76,7 +80,8 @@
 
 
 WorkerThread::WorkerThread(InstallerWindow *window)
-       : BLooper("copy_engine"),
+       :
+       BLooper("copy_engine"),
        fWindow(window),
        fPackages(NULL),

[... truncated: 187 lines follow ...]

Other related posts: