Ticket #5905: installedpackagesLocalization.patch

File installedpackagesLocalization.patch, 7.2 KB (added by Karvjorm, 14 years ago)

Fixed installedpackagesLocalization patch

  • src/apps/installedpackages/UninstallWindow.cpp

     
    77 */
    88#include "UninstallWindow.h"
    99
     10#include <Catalog.h>
    1011#include <GroupLayout.h>
     12#include <Locale.h>
    1113
    1214
    13 // Macro reserved for later localization
    14 #define T(x) x
     15#undef TR_CONTEXT
     16#define TR_CONTEXT "UninstallWindow"
    1517
    16 
    1718UninstallWindow::UninstallWindow()
    18     : BWindow(BRect(100, 100, 600, 300), T("Installed packages"),
     19    : BWindow(BRect(100, 100, 600, 300), TR("Installed packages"),
    1920        B_TITLED_WINDOW, B_NOT_ZOOMABLE
    2021        | B_QUIT_ON_WINDOW_CLOSE | B_AUTO_UPDATE_SIZE_LIMITS)
    2122{
  • src/apps/installedpackages/UninstallView.cpp

     
    1313#include <Alert.h>
    1414#include <Box.h>
    1515#include <Button.h>
     16#include <Catalog.h>
    1617#include <Directory.h>
    1718#include <Entry.h>
    1819#include <File.h>
    1920#include <FindDirectory.h>
     21#include <Locale.h>
    2022#include <NodeMonitor.h>
    2123#include <String.h>
    2224#include <StringView.h>
     
    2729#   include <SpaceLayoutItem.h>
    2830#endif
    2931
     32#undef TR_CONTEXT
     33#define TR_CONTEXT "UninstallView"
    3034
    3135enum {
    3236    P_MSG_REMOVE = 'umrm',
     
    3438};
    3539
    3640
    37 // Reserved
    38 #define T(x) x
    39 
    40 
    4141// TODO list:
    4242//  - B_ENTRY_MOVED
    4343//  - Right now the installed package info naming convention is the same
     
    4545//  - Add a status window (reuse the one from PackageInstall)
    4646
    4747
    48 static const char* kNoPackageSelected = "No package selected.";
     48static const char* kNoPackageSelected = TR("No package selected.");
    4949
    5050class UninstallView::InfoItem : public BStringItem {
    5151    public:
     
    152152                if (fWatcherRunning) {
    153153                    _AddFile(filename.String(), ref);
    154154                } else {
    155                     // This most likely means we were waiting for the packages/ dir
    156                     // to appear
     155                    // This most likely means we were waiting for
     156                    // the packages/ dir to appear
    157157                    if (filename == "packages") {
    158158                        if (watch_node(&ref, B_WATCH_DIRECTORY, this) == B_OK)
    159159                            fWatcherRunning = true;
     
    171171                    iter = static_cast<InfoItem *>(fAppList->ItemAt(i));
    172172                    if (iter->GetNodeRef() == ref) {
    173173                        if (i == fAppList->CurrentSelection())
    174                             fDescription->SetText(T(kNoPackageSelected));
     174                            fDescription->SetText(kNoPackageSelected);
    175175                        fAppList->RemoveItem(i);
    176176                        delete iter;
    177177                    }
     
    199199        case P_MSG_SELECT:
    200200        {
    201201            fButton->SetEnabled(false);
    202             fDescription->SetText(T(kNoPackageSelected));
     202            fDescription->SetText(kNoPackageSelected);
    203203
    204204            int32 index = fAppList->CurrentSelection();
    205205            if (index < 0)
     
    236236                BListItem* item = fAppList->RemoveItem(index);
    237237                delete item;
    238238
    239                 fDescription->SetText(T(kNoPackageSelected));
     239                fDescription->SetText(kNoPackageSelected);
    240240
    241241                notify = new BAlert("removal_success",
    242                     T("The package you selected has been successfully removed "
    243                     "from your system."), T("OK"));
     242                    TR("The package you selected has been successfully removed "
     243                    "from your system."), TR("OK"));
    244244            } else {
    245245                notify = new BAlert("removal_failed",
    246                     T("The selected package was not removed from your system. "
     246                    TR("The selected package was not removed from your system. "
    247247                    "The given installed package information file might have "
    248                     "been corrupted."), T("OK"), NULL,
     248                    "been corrupted."), TR("OK"), NULL,
    249249                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    250250            }
    251251
     
    280280    scrollView->SetLayout(scrollLayout);
    281281
    282282    BStringView* descriptionLabel = new BStringView("desc_label",
    283         T("Package description"));
     283        TR("Package description"));
    284284    descriptionLabel->SetFont(be_bold_font);
    285285
    286286    fDescription = new BTextView("description", B_WILL_DRAW);
    287287    fDescription->MakeSelectable(false);
    288288    fDescription->MakeEditable(false);
    289289    fDescription->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    290     fDescription->SetText(T(kNoPackageSelected));
     290    fDescription->SetText(kNoPackageSelected);
    291291
    292     fButton = new BButton("removal", T("Remove"), new BMessage(P_MSG_REMOVE));
     292    fButton = new BButton("removal", TR("Remove"), new BMessage(P_MSG_REMOVE));
    293293    fButton->SetEnabled(false);
    294294
    295295    SetLayout(new BGroupLayout(B_HORIZONTAL));
     
    333333    BBox* box = new BBox(rect, "desc_box");
    334334
    335335    BStringView *descLabel = new BStringView(BRect(3, 3, 10, 10), "desc_label",
    336         T("Package description:"));
     336        TR("Package description:"));
    337337    descLabel->ResizeToPreferred();
    338338    box->AddChild(descLabel);
    339339
     
    346346    fDescription->MakeSelectable(true);
    347347    fDescription->MakeEditable(false);
    348348    fDescription->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    349     fDescription->SetText(T(kNoPackageSelected));
     349    fDescription->SetText(kNoPackageSelected);
    350350   
    351351    fDescScroll = new BScrollView("desc_scroll", fDescription, B_FOLLOW_NONE,
    352352        0, false, true, B_NO_BORDER);
     
    354354
    355355    AddChild(box);
    356356
    357     fButton = new BButton(BRect(0, 0, 1, 1), "removal", T("Remove"),
     357    fButton = new BButton(BRect(0, 0, 1, 1), "removal", TR("Remove"),
    358358        new BMessage(P_MSG_REMOVE));
    359359    fButton->ResizeToPreferred();
    360360    fButton->SetEnabled(false);
  • src/apps/installedpackages/main.cpp

     
    66 *      Łukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
    77 */
    88#include "UninstallWindow.h"
     9
     10#include <Alert.h>
    911#include <Application.h>
     12#include <Autolock.h>
     13#include <Catalog.h>
     14#include <Entry.h>
     15#include <Locale.h>
    1016#include <List.h>
    11 #include <Alert.h>
    1217#include <TextView.h>
    13 #include <Entry.h>
    14 #include <Autolock.h>
     18
    1519#include <stdio.h>
    1620
     21#undef TR_CONTEXT
     22#define TR_CONTEXT "UninstallApplication"
    1723
    1824class UninstallApplication : public BApplication {
    1925    public:
     
    2531        void AboutRequested();
    2632
    2733    private:
    28         UninstallWindow *fWindow;
     34        UninstallWindow *fWindow;
     35        BCatalog        fAppCatalog;
    2936};
    3037
    3138
    3239UninstallApplication::UninstallApplication()
    33     :   BApplication("application/x-vnd.Haiku-InstalledPackages")
     40    :   BApplication("application/x-vnd.Haiku-InstalledPackages"),
     41    fWindow(NULL),
     42    fAppCatalog(NULL)
    3443{
     44    be_locale->GetAppCatalog(&fAppCatalog);
    3545    fWindow = new UninstallWindow();
    3646    fWindow->Show();
    3747}
     
    5666UninstallApplication::AboutRequested()
    5767{
    5868    BAlert *about = new BAlert("about",
    59             "InstalledPackages\n"
     69            TR("InstalledPackages\n"
    6070            "BeOS legacy .pkg package removing application for Haiku.\n\n"
    6171            "Copyright 2007,\nŁukasz 'Sil2100' Zemczak\n\n"
    62             "Copyright (c) 2007 Haiku, Inc. \n",
    63             "Close");
     72            "Copyright (c) 2007 Haiku, Inc. \n"),
     73            TR("Close"));
    6474
    6575    BTextView *view = about->TextView();
    6676    BFont font;
  • src/apps/installedpackages/Jamfile

     
    1313    main.cpp
    1414    UninstallWindow.cpp
    1515    UninstallView.cpp
    16     : be tracker $(TARGET_LIBSUPC++)
     16    : be locale tracker translation z $(TARGET_LIBSUPC++)
    1717;