Ticket #11404: 0001-Localize-keystore_server.patch

File 0001-Localize-keystore_server.patch, 7.1 KB (added by humdinger, 9 years ago)

patch for localiztion

  • src/servers/keystore/AppAccessRequestWindow.cpp

    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  
    77#include "AppAccessRequestWindow.h"
    88
    99#include <Button.h>
     10#include <Catalog.h>
    1011#include <CheckBox.h>
    1112#include <GridLayout.h>
    1213#include <GridView.h>
     
    2324#include <new>
    2425
    2526
     27#undef B_TRANSLATION_CONTEXT
     28#define B_TRANSLATION_CONTEXT "AppAccessRequestWindow"
     29
     30
    2631static const uint32 kMessageDisallow = 'btda';
    2732static const uint32 kMessageOnce = 'btao';
    2833static const uint32 kMessageAlways = 'btaa';
    public:  
    5358            return;
    5459
    5560        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);
    5865
    5966        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);
    6270        }
    6371
    6472        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);
    6776        }
    6877
    6978        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.");
    7181        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.");
    7484        } 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.");
    7787        }
    7888
    7989        message->SetText(details);
    public:  
    92102        if (buttons == NULL)
    93103            return;
    94104
    95         fDisallowButton = new(std::nothrow) BButton("Disallow",
     105        fDisallowButton = new(std::nothrow) BButton(B_TRANSLATE("Disallow"),
    96106            new BMessage(kMessageDisallow));
    97107        buttons->GroupLayout()->AddView(fDisallowButton);
    98108
    99109        buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
    100110
    101         fOnceButton = new(std::nothrow) BButton("Allow Once",
     111        fOnceButton = new(std::nothrow) BButton(B_TRANSLATE("Allow once"),
    102112            new BMessage(kMessageOnce));
    103113        buttons->GroupLayout()->AddView(fOnceButton);
    104114
    105         fAlwaysButton = new(std::nothrow) BButton("Allow Always",
     115        fAlwaysButton = new(std::nothrow) BButton(B_TRANSLATE("Allow always"),
    106116            new BMessage(kMessageAlways));
    107117        buttons->GroupLayout()->AddView(fAlwaysButton);
    108118
    AppAccessRequestWindow::AppAccessRequestWindow(const char* keyringName,  
    132142    const char* signature, const char* path, const char* accessString,
    133143    bool appIsNew, bool appWasUpdated)
    134144    :
    135     BWindow(BRect(50, 50, 269, 302), "Application Keyring Access",
     145    BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Application keyring access"),
    136146        B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
    137147            | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
    138148    fRequestView(NULL),
  • src/servers/keystore/Jamfile

    diff --git a/src/servers/keystore/Jamfile b/src/servers/keystore/Jamfile
    index 3237a52..bcad91a 100644
    a b Server keystore_server :  
    88    Keyring.cpp
    99    KeyStoreServer.cpp
    1010
    11     : be [ TargetLibstdc++ ]
     11    : be localestub [ TargetLibstdc++ ]
    1212    : keystore_server.rdef
    1313;
     14
     15DoCatalogs keystore_server :
     16    x-vnd.Haiku-keystore_server
     17    :
     18    AppAccessRequestWindow.cpp
     19    KeyRequestWindow.cpp
     20;
  • src/servers/keystore/KeyRequestWindow.cpp

    diff --git a/src/servers/keystore/KeyRequestWindow.cpp b/src/servers/keystore/KeyRequestWindow.cpp
    index bfee16f..7646657 100644
    a b  
    77#include "KeyRequestWindow.h"
    88
    99#include <Button.h>
     10#include <Catalog.h>
    1011#include <CheckBox.h>
    1112#include <GridLayout.h>
    1213#include <GridView.h>
     
    2627#include <new>
    2728
    2829
     30#undef B_TRANSLATION_CONTEXT
     31#define B_TRANSLATION_CONTEXT "KeyRequestWindow"
     32
     33
    2934static const uint32 kMessageCancel = 'btcl';
    3035static const uint32 kMessageUnlock = 'btul';
    3136
    public:  
    5762        layout->SetSpacing(inset, inset);
    5863
    5964        BStringView* label = new(std::nothrow) BStringView("keyringLabel",
    60             "Keyring:");
     65            B_TRANSLATE("Keyring:"));
    6166        if (label == NULL)
    6267            return;
    6368
    public:  
    7075
    7176        layout->AddView(fKeyringName, 1, row++);
    7277
    73         fPassword = new(std::nothrow) BTextControl("Password:", "", NULL);
     78        fPassword = new(std::nothrow) BTextControl(B_TRANSLATE("Password:"), "", NULL);
    7479        if (fPassword == NULL)
    7580            return;
    7681
    public:  
    8691        if (buttons == NULL)
    8792            return;
    8893
    89         fCancelButton = new(std::nothrow) BButton("Cancel",
     94        fCancelButton = new(std::nothrow) BButton(B_TRANSLATE("Cancel"),
    9095            new BMessage(kMessageCancel));
    9196        buttons->GroupLayout()->AddView(fCancelButton);
    9297
    9398        buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
    9499
    95         fUnlockButton = new(std::nothrow) BButton("Unlock",
     100        fUnlockButton = new(std::nothrow) BButton(B_TRANSLATE("Unlock"),
    96101            new BMessage(kMessageUnlock));
    97102        buttons->GroupLayout()->AddView(fUnlockButton);
    98103
    99104        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"
    103108            "If you unlock the keyring, it stays unlocked until the system is "
    104109            "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."));
    106111        message->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    107112        rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
    108113        message->SetFontAndColor(be_plain_font, B_FONT_ALL, &textColor);
    private:  
    147152
    148153KeyRequestWindow::KeyRequestWindow()
    149154    :
    150     BWindow(BRect(50, 50, 269, 302), "Unlock Keyring",
     155    BWindow(BRect(50, 50, 269, 302), B_TRANSLATE("Unlock keyring"),
    151156        B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
    152157            | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
    153158    fRequestView(NULL),