Ticket #6100: workspacesLocalization.patch
File workspacesLocalization.patch, 6.6 KB (added by , 14 years ago) |
---|
-
src/apps/workspaces/Workspaces.cpp
13 13 14 14 #include <Alert.h> 15 15 #include <Application.h> 16 #include <Catalog.h> 16 17 #include <Dragger.h> 17 18 #include <Entry.h> 18 19 #include <File.h> 19 20 #include <FindDirectory.h> 21 #include <Locale.h> 20 22 #include <MenuItem.h> 21 23 #include <Path.h> 22 24 #include <PopUpMenu.h> … … 34 36 #include <ViewPrivate.h> 35 37 #include <WindowPrivate.h> 36 38 39 #undef B_TRANSLATE_CONTEXT 40 #define B_TRANSLATE_CONTEXT "Workspaces" 37 41 42 38 43 static const char* kSignature = "application/x-vnd.Be-WORK"; 39 44 static const char* kOldSettingFile = "Workspace_data"; 40 45 static const char* kSettingsFile = "Workspaces_settings"; … … 144 149 145 150 private: 146 151 WorkspacesWindow* fWindow; 152 BCatalog fAppCatalog; 147 153 }; 148 154 149 155 … … 387 393 void 388 394 WorkspacesView::_AboutRequested() 389 395 { 390 B Alert *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" 393 399 "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")); 395 406 BTextView *view = alert->TextView(); 396 407 BFont font; 397 408 … … 537 548 menu->SetFont(be_plain_font); 538 549 539 550 // 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)); 542 553 menu->AddItem(changeItem); 543 554 544 555 WorkspacesWindow* window = dynamic_cast<WorkspacesWindow*>(Window()); … … 546 557 BMenuItem* item; 547 558 548 559 menu->AddSeparatorItem(); 549 menu->AddItem(item = new BMenuItem( "Show window title",560 menu->AddItem(item = new BMenuItem(B_TRANSLATE("Show window title"), 550 561 new BMessage(kMsgToggleTitle))); 551 562 if (window->Look() == B_TITLED_WINDOW_LOOK) 552 563 item->SetMarked(true); 553 menu->AddItem(item = new BMenuItem( "Show window border",564 menu->AddItem(item = new BMenuItem(B_TRANSLATE("Show window border"), 554 565 new BMessage(kMsgToggleBorder))); 555 566 if (window->Look() == B_TITLED_WINDOW_LOOK 556 567 || window->Look() == B_MODAL_WINDOW_LOOK) 557 568 item->SetMarked(true); 558 569 559 570 menu->AddSeparatorItem(); 560 menu->AddItem(item = new BMenuItem( "Always on top",571 menu->AddItem(item = new BMenuItem(B_TRANSLATE("Always on top"), 561 572 new BMessage(kMsgToggleAlwaysOnTop))); 562 573 if (window->Feel() == B_FLOATING_ALL_WINDOW_FEEL) 563 574 item->SetMarked(true); 564 menu->AddItem(item = new BMenuItem( "Auto-raise",575 menu->AddItem(item = new BMenuItem(B_TRANSLATE("Auto-raise"), 565 576 new BMessage(kMsgToggleAutoRaise))); 566 577 if (window->IsAutoRaising()) 567 578 item->SetMarked(true); 568 579 569 580 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))); 573 585 menu->SetTargetForItems(window); 574 586 } 575 587 … … 583 595 584 596 585 597 WorkspacesWindow::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 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), 589 601 fSettings(settings), 590 602 fAutoRaising(false) 591 603 { … … 733 745 else 734 746 SetLook(B_MODAL_WINDOW_LOOK); 735 747 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 737 750 fSettings->SetHasBorder(true); 738 751 fSettings->SetHasTitle(enable); 739 752 break; … … 796 809 WorkspacesApp::WorkspacesApp() 797 810 : BApplication(kSignature) 798 811 { 812 be_locale->GetAppCatalog(&fAppCatalog); 799 813 fWindow = new WorkspacesWindow(new WorkspacesSettings()); 800 814 } 801 815 … … 815 829 void 816 830 WorkspacesApp::Usage(const char *programName) 817 831 { 818 printf( "Usage: %s [options] [workspace]\n"832 printf(B_TRANSLATE("Usage: %s [options] [workspace]\n" 819 833 "where \"options\" is one of:\n" 820 834 " --notitle\t\ttitle bar removed. border and resize kept.\n" 821 835 " --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" 823 838 " --alwaysontop\t\tkeeps window on top\n" 824 839 " --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" 826 842 " --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"), 828 845 programName); 829 846 830 847 // quit only if we aren't running already … … 878 895 Quit(); 879 896 } else { 880 897 // 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]); 882 899 883 900 if (IsLaunching()) 884 901 Quit(); -
src/apps/workspaces/Jamfile
7 7 8 8 Application Workspaces : 9 9 Workspaces.cpp 10 : be $(TARGET_LIBSUPC++)10 : be locale $(TARGET_LIBSUPC++) 11 11 : Workspaces.rdef 12 12 ; 13 13 … … 15 15 HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Workspaces 16 16 : tests!apps ; 17 17 } 18 19 DoCatalogs Workspaces : 20 x-vnd.Be-WORK 21 : 22 Workspaces.cpp 23 ;