Ticket #7234: Login-localization.patch
File Login-localization.patch, 8.0 KB (added by , 13 years ago) |
---|
-
src/apps/login/LoginWindow.cpp
4 4 */ 5 5 6 6 7 #include <Catalog.h> 8 7 9 #include "LoginWindow.h" 8 10 #include "LoginView.h" 9 11 12 #undef B_TRANSLATE_CONTEXT 13 #define B_TRANSLATE_CONTEXT "Login Window" 14 10 15 #define WINDOW_FEEL B_NORMAL_WINDOW_FEEL 11 16 //#define WINDOW_FEEL B_FLOATING_ALL_WINDOW_FEEL 12 17 13 18 LoginWindow::LoginWindow(BRect frame) 14 : BWindow(frame, "Welcome to Haiku", B_TITLED_WINDOW_LOOK,19 : BWindow(frame, B_TRANSLATE("Welcome to Haiku"), B_TITLED_WINDOW_LOOK, 15 20 WINDOW_FEEL, 16 21 B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | 17 22 B_NOT_MINIMIZABLE | B_NOT_RESIZABLE | -
src/apps/login/DesktopWindow.cpp
7 7 #include <string.h> 8 8 #include <stdio.h> 9 9 10 #include <Catalog.h> 10 11 #include <Directory.h> 11 12 #include <Entry.h> 12 13 #include <FindDirectory.h> … … 17 18 #include "LoginApp.h" 18 19 #include "DesktopWindow.h" 19 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "Desktop Window" 23 20 24 const window_feel kPrivateDesktopWindowFeel = window_feel(1024); 21 25 const window_look kPrivateDesktopWindowLook = window_look(4); 22 26 // this is a mirror of an app server private values 23 27 24 28 25 29 DesktopWindow::DesktopWindow(BRect frame, bool editMode) 26 : BWindow(frame, "Desktop",30 : BWindow(frame, B_TRANSLATE("Desktop"), 27 31 kPrivateDesktopWindowLook, 28 32 kPrivateDesktopWindowFeel, 29 33 B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE … … 71 75 { 72 76 status_t err; 73 77 err = fDesktopShelf->Save(); 74 printf("error %s\n", strerror(err)); 78 printf(B_TRANSLATE_COMMENT("error %s\n", 79 "A return message from fDesktopShelf->Save(). It can be \"B_OK\""), 80 strerror(err)); 75 81 return BWindow::QuitRequested(); 76 82 } 77 83 -
src/apps/login/LoginView.cpp
2 2 * Copyright 2008, François Revol, <revol@free.fr>. All rights reserved. 3 3 * Distributed under the terms of the MIT License. 4 4 */ 5 #include <Catalog.h> 5 6 #include <ScrollView.h> 6 7 #include <String.h> 7 8 #include <Window.h> … … 14 15 #include "LoginApp.h" 15 16 #include "LoginView.h" 16 17 18 #undef B_TRANSLATE_CONTEXT 19 #define B_TRANSLATE_CONTEXT "Login View" 20 17 21 #define LW 120 18 22 #define CSEP 15 19 23 #define BH 20 … … 57 61 58 62 r.Set(LW + 30, Bounds().top + CSEP, 59 63 Bounds().right - CSEP, Bounds().top + CSEP + CSEP); 60 fLoginControl = new BTextControl(r, "login", "Login:", "",64 fLoginControl = new BTextControl(r, "login", B_TRANSLATE("Login:"), "", 61 65 new BMessage(kLoginEdited)); 62 66 AddChild(fLoginControl); 63 67 64 68 r.OffsetBySelf(0, CSEP + CSEP); 65 fPasswordControl = new BTextControl(r, "password", "Password:", "",66 new BMessage(kPasswordEdited));69 fPasswordControl = new BTextControl(r, "password", 70 B_TRANSLATE("Password:"), "", new BMessage(kPasswordEdited)); 67 71 fPasswordControl->TextView()->HideTyping(true); 68 72 AddChild(fPasswordControl); 69 73 70 74 r.OffsetBySelf(0, CSEP + CSEP); 71 fHidePasswordCheckBox = new BCheckBox(r, "hidepw", "Hide password",72 new BMessage(kHidePassword));75 fHidePasswordCheckBox = new BCheckBox(r, "hidepw", 76 B_TRANSLATE("Hide password"), new BMessage(kHidePassword)); 73 77 fHidePasswordCheckBox->SetValue(1); 74 78 AddChild(fHidePasswordCheckBox); 75 79 … … 79 83 buttonWidth, Bounds().bottom); 80 84 buttonRect.OffsetBySelf(CSEP, -CSEP); 81 85 82 fHaltButton = new BButton(buttonRect, "halt", "Halt",86 fHaltButton = new BButton(buttonRect, "halt", B_TRANSLATE("Halt"), 83 87 new BMessage(kHaltAction)); 84 88 AddChild(fHaltButton); 85 89 86 90 buttonRect.OffsetBySelf(CSEP + buttonWidth, 0); 87 fRebootButton = new BButton(buttonRect, "reboot", "Reboot",91 fRebootButton = new BButton(buttonRect, "reboot", B_TRANSLATE("Reboot"), 88 92 new BMessage(kRebootAction)); 89 93 AddChild(fRebootButton); 90 94 … … 93 97 94 98 buttonRect.OffsetToSelf(Bounds().Width() - CSEP - buttonWidth, 95 99 Bounds().Height() - CSEP - BH); 96 fLoginButton = new BButton(buttonRect, "ok", "OK",100 fLoginButton = new BButton(buttonRect, "ok", B_TRANSLATE("OK"), 97 101 new BMessage(kAttemptLogin)); 98 102 AddChild(fLoginButton); 99 103 … … 175 179 case kLoginBad: 176 180 fPasswordControl->SetText(""); 177 181 EnableControls(false); 178 fInfoView->SetText( "Invalid login!");182 fInfoView->SetText(B_TRANSLATE("Invalid login!")); 179 183 if (Window()) { 180 184 BPoint savedPos = Window()->Frame().LeftTop(); 181 185 for (int i = 0; i < 10; i++) { -
src/apps/login/Jamfile
19 19 LoginWindow.cpp 20 20 LoginView.cpp 21 21 main.cpp 22 : be tracker $(mu_libs) $(TARGET_LIBSTDC++) 22 : be tracker $(mu_libs) $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) 23 23 : Login.rdef 24 24 ; 25 25 26 DoCatalogs Login : 27 x-vnd.Haiku-Login 28 : 29 LoginApp.cpp 30 DesktopWindow.cpp 31 LoginView.cpp 32 LoginWindow.cpp 33 ; -
src/apps/login/LoginApp.cpp
5 5 6 6 7 7 #include <Alert.h> 8 #include <Catalog.h> 8 9 #include <Screen.h> 9 10 #include <String.h> 10 11 #include <View.h> … … 25 26 #include "multiuser_utils.h" 26 27 #endif 27 28 29 #undef B_TRANSLATE_CONTEXT 30 #define B_TRANSLATE_CONTEXT "Login App" 28 31 29 32 const char *kLoginAppSig = "application/x-vnd.Haiku-Login"; 30 33 … … 48 51 BScreen screen; 49 52 50 53 if (fEditShelfMode) { 51 (new BAlert("Info", "You can customize the desktop shown " 52 "behind the Login application by dropping replicants onto it.\n" 54 (new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can customize the " 55 "desktop shown behind the Login application by dropping replicants" 56 " onto it.\n" 53 57 "\n" 54 "When you are finished just quit the application (Alt-Q)." ,55 "OK"))->Go(NULL);58 "When you are finished just quit the application (Alt-Q)."), 59 B_TRANSLATE("OK")))->Go(NULL); 56 60 } else { 57 61 BRect frame(0, 0, 400, 150); 58 62 frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2, … … 88 92 BRoster::Private rosterPrivate(roster); 89 93 status_t error = rosterPrivate.ShutDown(reboot, false, false); 90 94 if (error < B_OK) { 91 BString msg( "Error: ");92 msg << strerror(error);93 (new BAlert( "Error", msg.String(), "OK"))->Go();95 BString msg(B_TRANSLATE("Error: %1")); 96 msg.ReplaceFirst("%1", strerror(error)); 97 (new BAlert(("Error"), msg.String(), B_TRANSLATE("OK")))->Go(); 94 98 } 95 99 break; 96 100 } 97 101 case kSuspendAction: 98 (new BAlert("Error", "Unimplemented", "OK"))->Go(); 102 (new BAlert(B_TRANSLATE("Error"), B_TRANSLATE("Unimplemented"), 103 B_TRANSLATE("OK")))->Go(); 99 104 break; 100 105 #endif 101 106 default: … … 115 120 else if (arg == "--nonmodal") 116 121 fModalMode = false; 117 122 else /*if (arg == "--help")*/ { 118 printf( "Login application for Haiku\nUsage:\n");123 printf(B_TRANSLATE("Login application for Haiku\nUsage:\n")); 119 124 printf("%s [--nonmodal] [--edit]\n", argv[0]); 120 printf( "--nonmodal Do not make the window modal\n");121 printf( "--edit Launch in shelf editting mode to "122 "allow customizing the desktop.\n") ;125 printf(B_TRANSLATE("--nonmodal Do not make the window modal\n")); 126 printf(B_TRANSLATE("--edit Launch in shelf editting mode to " 127 "allow customizing the desktop.\n")); 123 128 // just return to the shell 124 129 exit((arg == "--help") ? 0 : 1); 125 130 return; … … 139 144 if (message->FindString("password", &password) < B_OK) 140 145 password = NULL; 141 146 err = ValidateLogin(login, password); 142 printf("ValidateLogin: %s\n", strerror(err)); 147 printf(B_TRANSLATE_COMMENT("ValidateLogin: %s\n", 148 "A message returned from the ValidateLogin function. " 149 "It can be \"B_OK\"."), strerror(err)); 143 150 if (err == B_OK) { 144 151 reply.what = kLoginOk; 145 152 message->SendReply(&reply); … … 224 231 225 232 return fd; 226 233 } 227 228 229