From 63091fd66037015783dbd23aea3c860ec3d7d25e Mon Sep 17 00:00:00 2001
From: Humdinger <humdingerb@gmail.com>
Date: Sat, 1 Nov 2014 19:06:53 +0100
Subject: [PATCH] Localize keystore_server
---
src/servers/keystore/AppAccessRequestWindow.cpp | 40 +++++++++++++++----------
src/servers/keystore/Jamfile | 9 +++++-
src/servers/keystore/KeyRequestWindow.cpp | 23 ++++++++------
3 files changed, 47 insertions(+), 25 deletions(-)
diff --git a/src/servers/keystore/AppAccessRequestWindow.cpp b/src/servers/keystore/AppAccessRequestWindow.cpp
index c87ca52..1a0292a 100644
a
|
b
|
|
7 | 7 | #include "AppAccessRequestWindow.h" |
8 | 8 | |
9 | 9 | #include <Button.h> |
| 10 | #include <Catalog.h> |
10 | 11 | #include <CheckBox.h> |
11 | 12 | #include <GridLayout.h> |
12 | 13 | #include <GridView.h> |
… |
… |
|
23 | 24 | #include <new> |
24 | 25 | |
25 | 26 | |
| 27 | #undef B_TRANSLATION_CONTEXT |
| 28 | #define B_TRANSLATION_CONTEXT "AppAccessRequestWindow" |
| 29 | |
| 30 | |
26 | 31 | static const uint32 kMessageDisallow = 'btda'; |
27 | 32 | static const uint32 kMessageOnce = 'btao'; |
28 | 33 | static const uint32 kMessageAlways = 'btaa'; |
… |
… |
public:
|
53 | 58 | return; |
54 | 59 | |
55 | 60 | BString details; |
56 | | details << "The application:\n" |
57 | | << signature << " (" << path << ")\n\n"; |
| 61 | details << B_TRANSLATE("The application:\n" |
| 62 | "%signature% (%path%)\n\n"); |
| 63 | details.ReplaceFirst("%signature%", signature); |
| 64 | details.ReplaceFirst("%path%", path); |
58 | 65 | |
59 | 66 | if (keyringName != NULL) { |
60 | | details << "requests access to keyring:\n" |
61 | | << keyringName << "\n\n"; |
| 67 | details << B_TRANSLATE("requests access to keyring:\n" |
| 68 | "%keyringName%\n\n"); |
| 69 | details.ReplaceFirst("%keyringName%", keyringName); |
62 | 70 | } |
63 | 71 | |
64 | 72 | if (accessString != NULL) { |
65 | | details << "to perform the following action:\n" |
66 | | << accessString << "\n\n"; |
| 73 | details << B_TRANSLATE("to perform the following action:\n" |
| 74 | "%accessString%\n\n"); |
| 75 | details.ReplaceFirst("%accessString%", accessString); |
67 | 76 | } |
68 | 77 | |
69 | 78 | if (appIsNew) |
70 | | details << "This application hasn't been granted access before."; |
| 79 | details << B_TRANSLATE("This application hasn't been granted " |
| 80 | "access before."); |
71 | 81 | else if (appWasUpdated) { |
72 | | details << "This application has been updated since it was last" |
73 | | << " granted access."; |
| 82 | details << B_TRANSLATE("This application has been updated since " |
| 83 | "it was last granted access."); |
74 | 84 | } else { |
75 | | details << "This application doesn't yet have the required" |
76 | | " privileges."; |
| 85 | details << B_TRANSLATE("This application doesn't yet have the " |
| 86 | "required privileges."); |
77 | 87 | } |
78 | 88 | |
79 | 89 | message->SetText(details); |
… |
… |
public:
|
92 | 102 | if (buttons == NULL) |
93 | 103 | return; |
94 | 104 | |
95 | | fDisallowButton = new(std::nothrow) BButton("Disallow", |
| 105 | fDisallowButton = new(std::nothrow) BButton(B_TRANSLATE("Disallow"), |
96 | 106 | new BMessage(kMessageDisallow)); |
97 | 107 | buttons->GroupLayout()->AddView(fDisallowButton); |
98 | 108 | |
99 | 109 | buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); |
100 | 110 | |
101 | | fOnceButton = new(std::nothrow) BButton("Allow Once", |
| 111 | fOnceButton = new(std::nothrow) BButton(B_TRANSLATE("Allow once"), |
102 | 112 | new BMessage(kMessageOnce)); |
103 | 113 | buttons->GroupLayout()->AddView(fOnceButton); |
104 | 114 | |
105 | | fAlwaysButton = new(std::nothrow) BButton("Allow Always", |
| 115 | fAlwaysButton = new(std::nothrow) BButton(B_TRANSLATE("Allow always"), |
106 | 116 | new BMessage(kMessageAlways)); |
107 | 117 | buttons->GroupLayout()->AddView(fAlwaysButton); |
108 | 118 | |
… |
… |
AppAccessRequestWindow::AppAccessRequestWindow(const char* keyringName,
|
132 | 142 | const char* signature, const char* path, const char* accessString, |
133 | 143 | bool appIsNew, bool appWasUpdated) |
134 | 144 | : |
135 | | BWindow(BRect(50, 50, 269, 302), "Application Keyring Access", |
| 145 | BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Application keyring access"), |
136 | 146 | B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS |
137 | 147 | | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), |
138 | 148 | fRequestView(NULL), |
diff --git a/src/servers/keystore/Jamfile b/src/servers/keystore/Jamfile
index 3237a52..bcad91a 100644
a
|
b
|
Server keystore_server :
|
8 | 8 | Keyring.cpp |
9 | 9 | KeyStoreServer.cpp |
10 | 10 | |
11 | | : be [ TargetLibstdc++ ] |
| 11 | : be localestub [ TargetLibstdc++ ] |
12 | 12 | : keystore_server.rdef |
13 | 13 | ; |
| 14 | |
| 15 | DoCatalogs keystore_server : |
| 16 | x-vnd.Haiku-keystore_server |
| 17 | : |
| 18 | AppAccessRequestWindow.cpp |
| 19 | KeyRequestWindow.cpp |
| 20 | ; |
diff --git a/src/servers/keystore/KeyRequestWindow.cpp b/src/servers/keystore/KeyRequestWindow.cpp
index bfee16f..7646657 100644
a
|
b
|
|
7 | 7 | #include "KeyRequestWindow.h" |
8 | 8 | |
9 | 9 | #include <Button.h> |
| 10 | #include <Catalog.h> |
10 | 11 | #include <CheckBox.h> |
11 | 12 | #include <GridLayout.h> |
12 | 13 | #include <GridView.h> |
… |
… |
|
26 | 27 | #include <new> |
27 | 28 | |
28 | 29 | |
| 30 | #undef B_TRANSLATION_CONTEXT |
| 31 | #define B_TRANSLATION_CONTEXT "KeyRequestWindow" |
| 32 | |
| 33 | |
29 | 34 | static const uint32 kMessageCancel = 'btcl'; |
30 | 35 | static const uint32 kMessageUnlock = 'btul'; |
31 | 36 | |
… |
… |
public:
|
57 | 62 | layout->SetSpacing(inset, inset); |
58 | 63 | |
59 | 64 | BStringView* label = new(std::nothrow) BStringView("keyringLabel", |
60 | | "Keyring:"); |
| 65 | B_TRANSLATE("Keyring:")); |
61 | 66 | if (label == NULL) |
62 | 67 | return; |
63 | 68 | |
… |
… |
public:
|
70 | 75 | |
71 | 76 | layout->AddView(fKeyringName, 1, row++); |
72 | 77 | |
73 | | fPassword = new(std::nothrow) BTextControl("Password:", "", NULL); |
| 78 | fPassword = new(std::nothrow) BTextControl(B_TRANSLATE("Password:"), "", NULL); |
74 | 79 | if (fPassword == NULL) |
75 | 80 | return; |
76 | 81 | |
… |
… |
public:
|
86 | 91 | if (buttons == NULL) |
87 | 92 | return; |
88 | 93 | |
89 | | fCancelButton = new(std::nothrow) BButton("Cancel", |
| 94 | fCancelButton = new(std::nothrow) BButton(B_TRANSLATE("Cancel"), |
90 | 95 | new BMessage(kMessageCancel)); |
91 | 96 | buttons->GroupLayout()->AddView(fCancelButton); |
92 | 97 | |
93 | 98 | buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); |
94 | 99 | |
95 | | fUnlockButton = new(std::nothrow) BButton("Unlock", |
| 100 | fUnlockButton = new(std::nothrow) BButton(B_TRANSLATE("Unlock"), |
96 | 101 | new BMessage(kMessageUnlock)); |
97 | 102 | buttons->GroupLayout()->AddView(fUnlockButton); |
98 | 103 | |
99 | 104 | BTextView* message = new(std::nothrow) BTextView("message"); |
100 | | message->SetText("An application wants to access the keyring below, " |
101 | | "but it is locked with a passphrase. Please enter the passphrase " |
102 | | "to unlock the keyring.\n" |
| 105 | message->SetText(B_TRANSLATE("An application wants to access the " |
| 106 | "keyring below, but it is locked with a passphrase. Please enter " |
| 107 | "the passphrase to unlock the keyring.\n" |
103 | 108 | "If you unlock the keyring, it stays unlocked until the system is " |
104 | 109 | "shut down or the keyring is manually locked again.\n" |
105 | | "If you cancel this dialog the keyring will remain locked."); |
| 110 | "If you cancel this dialog the keyring will remain locked.")); |
106 | 111 | message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); |
107 | 112 | rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); |
108 | 113 | message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor); |
… |
… |
private:
|
147 | 152 | |
148 | 153 | KeyRequestWindow::KeyRequestWindow() |
149 | 154 | : |
150 | | BWindow(BRect(50, 50, 269, 302), "Unlock Keyring", |
| 155 | BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Unlock keyring"), |
151 | 156 | B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS |
152 | 157 | | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), |
153 | 158 | fRequestView(NULL), |