Localize keystore_server

Signed-off-by: Adrien Destugues <[email protected]>
Fixes #11404.
This commit is contained in:
Humdinger
2014-11-02 09:46:44 +01:00
committed by Adrien Destugues
parent a7459df4c9
commit 5e654f6ab8
3 changed files with 47 additions and 25 deletions
+25 -15
View File
@@ -7,6 +7,7 @@
#include "AppAccessRequestWindow.h" #include "AppAccessRequestWindow.h"
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include <CheckBox.h> #include <CheckBox.h>
#include <GridLayout.h> #include <GridLayout.h>
#include <GridView.h> #include <GridView.h>
@@ -23,6 +24,10 @@
#include <new> #include <new>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "AppAccessRequestWindow"
static const uint32 kMessageDisallow = 'btda'; static const uint32 kMessageDisallow = 'btda';
static const uint32 kMessageOnce = 'btao'; static const uint32 kMessageOnce = 'btao';
static const uint32 kMessageAlways = 'btaa'; static const uint32 kMessageAlways = 'btaa';
@@ -53,27 +58,32 @@ public:
return; return;
BString details; BString details;
details << "The application:\n" details << B_TRANSLATE("The application:\n"
<< signature << " (" << path << ")\n\n"; "%signature% (%path%)\n\n");
details.ReplaceFirst("%signature%", signature);
details.ReplaceFirst("%path%", path);
if (keyringName != NULL) { if (keyringName != NULL) {
details << "requests access to keyring:\n" details << B_TRANSLATE("requests access to keyring:\n"
<< keyringName << "\n\n"; "%keyringName%\n\n");
details.ReplaceFirst("%keyringName%", keyringName);
} }
if (accessString != NULL) { if (accessString != NULL) {
details << "to perform the following action:\n" details << B_TRANSLATE("to perform the following action:\n"
<< accessString << "\n\n"; "%accessString%\n\n");
details.ReplaceFirst("%accessString%", accessString);
} }
if (appIsNew) if (appIsNew)
details << "This application hasn't been granted access before."; details << B_TRANSLATE("This application hasn't been granted "
"access before.");
else if (appWasUpdated) { else if (appWasUpdated) {
details << "This application has been updated since it was last" details << B_TRANSLATE("This application has been updated since "
<< " granted access."; "it was last granted access.");
} else { } else {
details << "This application doesn't yet have the required" details << B_TRANSLATE("This application doesn't yet have the "
" privileges."; "required privileges.");
} }
message->SetText(details); message->SetText(details);
@@ -92,17 +102,17 @@ public:
if (buttons == NULL) if (buttons == NULL)
return; return;
fDisallowButton = new(std::nothrow) BButton("Disallow", fDisallowButton = new(std::nothrow) BButton(B_TRANSLATE("Disallow"),
new BMessage(kMessageDisallow)); new BMessage(kMessageDisallow));
buttons->GroupLayout()->AddView(fDisallowButton); buttons->GroupLayout()->AddView(fDisallowButton);
buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
fOnceButton = new(std::nothrow) BButton("Allow Once", fOnceButton = new(std::nothrow) BButton(B_TRANSLATE("Allow once"),
new BMessage(kMessageOnce)); new BMessage(kMessageOnce));
buttons->GroupLayout()->AddView(fOnceButton); buttons->GroupLayout()->AddView(fOnceButton);
fAlwaysButton = new(std::nothrow) BButton("Allow Always", fAlwaysButton = new(std::nothrow) BButton(B_TRANSLATE("Allow always"),
new BMessage(kMessageAlways)); new BMessage(kMessageAlways));
buttons->GroupLayout()->AddView(fAlwaysButton); buttons->GroupLayout()->AddView(fAlwaysButton);
@@ -132,7 +142,7 @@ AppAccessRequestWindow::AppAccessRequestWindow(const char* keyringName,
const char* signature, const char* path, const char* accessString, const char* signature, const char* path, const char* accessString,
bool appIsNew, bool appWasUpdated) bool appIsNew, bool appWasUpdated)
: :
BWindow(BRect(50, 50, 269, 302), "Application Keyring Access", BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Application keyring access"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fRequestView(NULL), fRequestView(NULL),
+8 -1
View File
@@ -8,6 +8,13 @@ Server keystore_server :
Keyring.cpp Keyring.cpp
KeyStoreServer.cpp KeyStoreServer.cpp
: be [ TargetLibstdc++ ] : be localestub [ TargetLibstdc++ ]
: keystore_server.rdef : keystore_server.rdef
; ;
DoCatalogs keystore_server :
x-vnd.Haiku-keystore_server
:
AppAccessRequestWindow.cpp
KeyRequestWindow.cpp
;
+14 -9
View File
@@ -7,6 +7,7 @@
#include "KeyRequestWindow.h" #include "KeyRequestWindow.h"
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include <CheckBox.h> #include <CheckBox.h>
#include <GridLayout.h> #include <GridLayout.h>
#include <GridView.h> #include <GridView.h>
@@ -26,6 +27,10 @@
#include <new> #include <new>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "KeyRequestWindow"
static const uint32 kMessageCancel = 'btcl'; static const uint32 kMessageCancel = 'btcl';
static const uint32 kMessageUnlock = 'btul'; static const uint32 kMessageUnlock = 'btul';
@@ -57,7 +62,7 @@ public:
layout->SetSpacing(inset, inset); layout->SetSpacing(inset, inset);
BStringView* label = new(std::nothrow) BStringView("keyringLabel", BStringView* label = new(std::nothrow) BStringView("keyringLabel",
"Keyring:"); B_TRANSLATE("Keyring:"));
if (label == NULL) if (label == NULL)
return; return;
@@ -70,7 +75,7 @@ public:
layout->AddView(fKeyringName, 1, row++); layout->AddView(fKeyringName, 1, row++);
fPassword = new(std::nothrow) BTextControl("Password:", "", NULL); fPassword = new(std::nothrow) BTextControl(B_TRANSLATE("Password:"), "", NULL);
if (fPassword == NULL) if (fPassword == NULL)
return; return;
@@ -86,23 +91,23 @@ public:
if (buttons == NULL) if (buttons == NULL)
return; return;
fCancelButton = new(std::nothrow) BButton("Cancel", fCancelButton = new(std::nothrow) BButton(B_TRANSLATE("Cancel"),
new BMessage(kMessageCancel)); new BMessage(kMessageCancel));
buttons->GroupLayout()->AddView(fCancelButton); buttons->GroupLayout()->AddView(fCancelButton);
buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
fUnlockButton = new(std::nothrow) BButton("Unlock", fUnlockButton = new(std::nothrow) BButton(B_TRANSLATE("Unlock"),
new BMessage(kMessageUnlock)); new BMessage(kMessageUnlock));
buttons->GroupLayout()->AddView(fUnlockButton); buttons->GroupLayout()->AddView(fUnlockButton);
BTextView* message = new(std::nothrow) BTextView("message"); BTextView* message = new(std::nothrow) BTextView("message");
message->SetText("An application wants to access the keyring below, " message->SetText(B_TRANSLATE("An application wants to access the "
"but it is locked with a passphrase. Please enter the passphrase " "keyring below, but it is locked with a passphrase. Please enter "
"to unlock the keyring.\n" "the passphrase to unlock the keyring.\n"
"If you unlock the keyring, it stays unlocked until the system is " "If you unlock the keyring, it stays unlocked until the system is "
"shut down or the keyring is manually locked again.\n" "shut down or the keyring is manually locked again.\n"
"If you cancel this dialog the keyring will remain locked."); "If you cancel this dialog the keyring will remain locked."));
message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor);
@@ -147,7 +152,7 @@ private:
KeyRequestWindow::KeyRequestWindow() KeyRequestWindow::KeyRequestWindow()
: :
BWindow(BRect(50, 50, 269, 302), "Unlock Keyring", BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Unlock keyring"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fRequestView(NULL), fRequestView(NULL),