Ticket #6100: workspacesLocalization.patch

File workspacesLocalization.patch, 6.6 KB (added by Karvjorm, 14 years ago)

An updated localization patch for workspaces

  • src/apps/workspaces/Workspaces.cpp

     
    1313
    1414#include <Alert.h>
    1515#include <Application.h>
     16#include <Catalog.h>
    1617#include <Dragger.h>
    1718#include <Entry.h>
    1819#include <File.h>
    1920#include <FindDirectory.h>
     21#include <Locale.h>
    2022#include <MenuItem.h>
    2123#include <Path.h>
    2224#include <PopUpMenu.h>
     
    3436#include <ViewPrivate.h>
    3537#include <WindowPrivate.h>
    3638
     39#undef B_TRANSLATE_CONTEXT
     40#define B_TRANSLATE_CONTEXT "Workspaces"
    3741
     42
    3843static const char* kSignature = "application/x-vnd.Be-WORK";
    3944static const char* kOldSettingFile = "Workspace_data";
    4045static const char* kSettingsFile = "Workspaces_settings";
     
    144149
    145150    private:
    146151        WorkspacesWindow*   fWindow;
     152        BCatalog            fAppCatalog;
    147153};
    148154
    149155
     
    387393void
    388394WorkspacesView::_AboutRequested()
    389395{
    390     BAlert *alert = new BAlert("about", "Workspaces\n"
    391         "written by François Revol, Axel Dörfler, and Matt Madia.\n\n"
    392         "Copyright 2002-2008, Haiku.\n\n"
     396    BString text = B_TRANSLATE("Workspaces\n"
     397        "written by %1, and %2.\n\n"
     398        "Copyright %3, Haiku.\n\n"
    393399        "Send windows behind using the Option key. "
    394         "Move windows to front using the Control key.\n", "OK");
     400        "Move windows to front using the Control key.\n");
     401    text.ReplaceFirst("%1", "François Revol, Axel Dörfler");
     402    text.ReplaceFirst("%2", "Matt Madia");
     403    text.ReplaceFirst("%3", "2002-2008");
     404       
     405    BAlert *alert = new BAlert("about", text.String(), B_TRANSLATE("OK"));
    395406    BTextView *view = alert->TextView();
    396407    BFont font;
    397408
     
    537548    menu->SetFont(be_plain_font);
    538549
    539550    // TODO: alternatively change the count here directly?
    540     BMenuItem* changeItem = new BMenuItem("Change workspace count"
    541         B_UTF8_ELLIPSIS, new BMessage(kMsgChangeCount));
     551    BMenuItem* changeItem = new BMenuItem(B_TRANSLATE("Change workspace count"
     552        B_UTF8_ELLIPSIS), new BMessage(kMsgChangeCount));
    542553    menu->AddItem(changeItem);
    543554
    544555    WorkspacesWindow* window = dynamic_cast<WorkspacesWindow*>(Window());
     
    546557        BMenuItem* item;
    547558
    548559        menu->AddSeparatorItem();
    549         menu->AddItem(item = new BMenuItem("Show window title",
     560        menu->AddItem(item = new BMenuItem(B_TRANSLATE("Show window title"),
    550561            new BMessage(kMsgToggleTitle)));
    551562        if (window->Look() == B_TITLED_WINDOW_LOOK)
    552563            item->SetMarked(true);
    553         menu->AddItem(item = new BMenuItem("Show window border",
     564        menu->AddItem(item = new BMenuItem(B_TRANSLATE("Show window border"),
    554565            new BMessage(kMsgToggleBorder)));
    555566        if (window->Look() == B_TITLED_WINDOW_LOOK
    556567            || window->Look() == B_MODAL_WINDOW_LOOK)
    557568            item->SetMarked(true);
    558569
    559570        menu->AddSeparatorItem();
    560         menu->AddItem(item = new BMenuItem("Always on top",
     571        menu->AddItem(item = new BMenuItem(B_TRANSLATE("Always on top"),
    561572            new BMessage(kMsgToggleAlwaysOnTop)));
    562573        if (window->Feel() == B_FLOATING_ALL_WINDOW_FEEL)
    563574            item->SetMarked(true);
    564         menu->AddItem(item = new BMenuItem("Auto-raise",
     575        menu->AddItem(item = new BMenuItem(B_TRANSLATE("Auto-raise"),
    565576            new BMessage(kMsgToggleAutoRaise)));
    566577        if (window->IsAutoRaising())
    567578            item->SetMarked(true);
    568579
    569580        menu->AddSeparatorItem();
    570         menu->AddItem(new BMenuItem("About Workspaces" B_UTF8_ELLIPSIS,
    571             new BMessage(B_ABOUT_REQUESTED)));
    572         menu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED)));
     581        menu->AddItem(new BMenuItem(B_TRANSLATE("About Workspaces"
     582            B_UTF8_ELLIPSIS), new BMessage(B_ABOUT_REQUESTED)));
     583        menu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
     584            new BMessage(B_QUIT_REQUESTED)));
    573585        menu->SetTargetForItems(window);
    574586    }
    575587
     
    583595
    584596
    585597WorkspacesWindow::WorkspacesWindow(WorkspacesSettings *settings)
    586     : BWindow(settings->WindowFrame(), "Workspaces", B_TITLED_WINDOW_LOOK,
    587             B_NORMAL_WINDOW_FEEL, B_AVOID_FRONT | B_WILL_ACCEPT_FIRST_CLICK,
    588             B_ALL_WORKSPACES),
     598    : BWindow(settings->WindowFrame(), B_TRANSLATE("Workspaces"),
     599        B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_AVOID_FRONT
     600        | B_WILL_ACCEPT_FIRST_CLICK, B_ALL_WORKSPACES),
    589601    fSettings(settings),
    590602    fAutoRaising(false)
    591603{
     
    733745            else
    734746                SetLook(B_MODAL_WINDOW_LOOK);
    735747
    736             // No matter what the setting for title, we must force the border on
     748            // No matter what the setting for title,
     749            // we must force the border on
    737750            fSettings->SetHasBorder(true);
    738751            fSettings->SetHasTitle(enable);
    739752            break;
     
    796809WorkspacesApp::WorkspacesApp()
    797810    : BApplication(kSignature)
    798811{
     812    be_locale->GetAppCatalog(&fAppCatalog);
    799813    fWindow = new WorkspacesWindow(new WorkspacesSettings());
    800814}
    801815
     
    815829void
    816830WorkspacesApp::Usage(const char *programName)
    817831{
    818     printf("Usage: %s [options] [workspace]\n"
     832    printf(B_TRANSLATE("Usage: %s [options] [workspace]\n"
    819833        "where \"options\" is one of:\n"
    820834        "  --notitle\t\ttitle bar removed.  border and resize kept.\n"
    821835        "  --noborder\t\ttitle, border, and resize removed.\n"
    822         "  --avoidfocus\t\tprevents the window from being the target of keyboard events.\n"
     836        "  --avoidfocus\t\tprevents the window from being the target of "
     837        "keyboard events.\n"
    823838        "  --alwaysontop\t\tkeeps window on top\n"
    824839        "  --notmovable\t\twindow can't be moved around\n"
    825         "  --autoraise\t\tauto-raise the workspace window when it's at the screen corner\n"
     840        "  --autoraise\t\tauto-raise the workspace window when it's at the "
     841        "screen corner\n"
    826842        "  --help\t\tdisplay this help and exit\n"
    827         "and \"workspace\" is the number of the Workspace to which to switch (0-31)\n",
     843        "and \"workspace\" is the number of the Workspace to which to switch "
     844        "(0-31)\n"),
    828845        programName);
    829846
    830847    // quit only if we aren't running already
     
    878895                Quit();
    879896        } else {
    880897            // some unknown arguments were specified
    881             fprintf(stderr, "Invalid argument: %s\n", argv[i]);
     898            fprintf(stderr, B_TRANSLATE("Invalid argument: %s\n"), argv[i]);
    882899
    883900            if (IsLaunching())
    884901                Quit();
  • src/apps/workspaces/Jamfile

     
    77
    88Application Workspaces :
    99    Workspaces.cpp
    10     : be $(TARGET_LIBSUPC++)
     10    : be locale $(TARGET_LIBSUPC++)
    1111    : Workspaces.rdef
    1212    ;
    1313
     
    1515    HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Workspaces
    1616        : tests!apps ;
    1717}
     18
     19DoCatalogs Workspaces :
     20    x-vnd.Be-WORK
     21    :
     22    Workspaces.cpp
     23;