From c3cd5321d5ea3431cef8c1d4a923d12896a8622f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Fri, 18 Mar 2011 22:45:59 +0000 Subject: [PATCH] Localization of Screensaver unlock window. Ticket #7232 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41023 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/screen_blanker/Jamfile | 8 +++++++- src/bin/screen_blanker/PasswordWindow.cpp | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/bin/screen_blanker/Jamfile b/src/bin/screen_blanker/Jamfile index c103b53d03..e86dd903a0 100644 --- a/src/bin/screen_blanker/Jamfile +++ b/src/bin/screen_blanker/Jamfile @@ -16,7 +16,7 @@ BinCommand screen_blanker : # needed for some old/broken screen saver add-ons that do not # link against libscreensaver.so - : be game libscreensaver.so $(TARGET_LIBSUPC++) + : be game $(HAIKU_LOCALE_LIBS) libscreensaver.so $(TARGET_LIBSUPC++) : screen_blanker.rdef ; @@ -27,3 +27,9 @@ SEARCH on [ FGristFiles Package haiku-screensaverkit-cvs : screen_blanker : boot home config bin ; + +DoCatalogs screen_blanker : + x-vnd.Haiku.screenblanker + : + PasswordWindow.cpp +; diff --git a/src/bin/screen_blanker/PasswordWindow.cpp b/src/bin/screen_blanker/PasswordWindow.cpp index 8a19b2c9c9..ab0e3f55f1 100644 --- a/src/bin/screen_blanker/PasswordWindow.cpp +++ b/src/bin/screen_blanker/PasswordWindow.cpp @@ -14,13 +14,19 @@ #include #include #include +#include #include #include +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Screensaver password dialog" + + PasswordWindow::PasswordWindow() - : BWindow(BRect(100, 100, 400, 230), "Enter password", + : + BWindow(BRect(100, 100, 400, 230), "Enter password", B_NO_BORDER_WINDOW_LOOK, kPasswordWindowFeel /* TODO: B_MODAL_APP_WINDOW_FEEL should also behave correctly */, B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE @@ -35,18 +41,20 @@ PasswordWindow::PasswordWindow() BBox *customBox = new BBox(bounds, "customBox", B_FOLLOW_NONE); topView->AddChild(customBox); - customBox->SetLabel("Unlock screen saver"); + customBox->SetLabel(B_TRANSLATE("Unlock screen saver")); bounds.top += 10.0; - fPassword = new BTextControl(bounds, "password", "Enter password:", - "VeryLongPasswordPossible", B_FOLLOW_NONE); + fPassword = new BTextControl(bounds, "password", + B_TRANSLATE("Enter password:"), "VeryLongPasswordPossible", + B_FOLLOW_NONE); customBox->AddChild(fPassword); fPassword->MakeFocus(true); fPassword->ResizeToPreferred(); fPassword->TextView()->HideTyping(true); - fPassword->SetDivider(be_plain_font->StringWidth("Enter password:") + 5.0); + fPassword->SetDivider(be_plain_font->StringWidth( + B_TRANSLATE_NOCOLLECT("Enter password:")) + 5.0); - BButton* button = new BButton(BRect(), "unlock", "Unlock", + BButton* button = new BButton(BRect(), "unlock", B_TRANSLATE("Unlock"), new BMessage(kMsgUnlock), B_FOLLOW_NONE); customBox->AddChild(button); button->MakeDefault(true);