Localization of strings in PLAP dialog

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/560/head
Selva Nair 2 years ago
parent 3427aeb88f
commit fa0f55e5a3

@ -254,6 +254,10 @@
#define IDS_NFO_BYTECOUNT 1258
#define IDS_NFO_STATE_ONHOLD 1259
#define IDS_ERR_PARSE_MGMT_OPTION 1260
#define IDS_NFO_STATE_CANCELLING 1261
#define IDS_NFO_STATE_RETRYING 1262
#define IDS_NFO_STATE_DISCONNECTING 1263
#define IDS_NFO_CONN_CANCELLED 1264
/* Program Startup Related */
#define IDS_ERR_OPEN_DEBUG_FILE 1301

@ -29,6 +29,7 @@
#include <assert.h>
#include "resource.h"
#include "localization.h"
#include "openvpn-gui-res.h"
/* A "class" that implements IConnectableCredentialProviderCredential */
@ -487,9 +488,9 @@ GetSerialization(ICCPC *this, CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE *re
if (text && icon)
{
if (oc->connect_cancelled)
hr = SHStrDupW(L"Connection cancelled by user", text);
else if (text)
hr = SHStrDupW(L"Connection failed to complete", text);
hr = SHStrDupW(LoadLocalizedString(IDS_NFO_CONN_CANCELLED), text);
else
hr = SHStrDupW(LoadLocalizedString(IDS_NFO_CONN_FAILED, oc->display_name), text);
*icon = CPSI_ERROR;
}
@ -501,7 +502,7 @@ GetSerialization(ICCPC *this, CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE *re
/* return CPGSR_RETURN_NO_CREDENTIAL_FINISHED leads to a loop! */
if (text && icon)
{
hr = SHStrDupW(L"Connected..", text);
hr = SHStrDupW(LoadLocalizedString(IDS_NFO_OVPN_STATE_CONNECTED), text);
*icon = CPSI_SUCCESS;
}
}
@ -620,7 +621,7 @@ again:
if (res == IDRETRY && !ISCONNECTED(oc->c))
{
wcsncpy_s(status, _countof(status), L"Current State: Retrying", _TRUNCATE);
LoadLocalizedStringBuf(status, _countof(status), IDS_NFO_STATE_RETRYING);
NotifyEvents(oc, status);
DisconnectHelper(oc->c);
@ -628,7 +629,7 @@ again:
}
else if (res == IDCANCEL && !ISCONNECTED(oc->c) && !ISDISCONNECTED(oc->c))
{
wcsncpy_s(status, _countof(status), L"Current State: Cancelling", _TRUNCATE);
LoadLocalizedStringBuf(status, _countof(status), IDS_NFO_STATE_CANCELLING);
NotifyEvents(oc, status);
DisconnectHelper(oc->c);
@ -654,7 +655,7 @@ Disconnect(ICCPC *this)
OpenVPNConnection *oc = (OpenVPNConnection *) this;
dmsg (L"profile <%ls>", oc->display_name);
NotifyEvents(oc, L"Disconnecting");
NotifyEvents(oc, LoadLocalizedString(IDS_NFO_STATE_DISCONNECTING));
DisconnectHelper(oc->c);

@ -510,7 +510,7 @@ RunProgressDialog(connection_t *c, PFTASKDIALOGCALLBACK cb_fn, LONG_PTR cb_data)
flags |= TDF_RTL_LAYOUT;
}
_sntprintf_0(main_text, L"%ls %ls", LoadLocalizedString(IDS_MENU_CONNECT), c->config_name);
LoadLocalizedStringBuf(details_btn_text, _countof(main_text), IDS_MENU_STATUS);
LoadLocalizedStringBuf(details_btn_text, _countof(details_btn_text), IDS_MENU_STATUS);
const TASKDIALOG_BUTTON extra_buttons[] = {
{status_menu_id, details_btn_text},
@ -527,7 +527,7 @@ RunProgressDialog(connection_t *c, PFTASKDIALOGCALLBACK cb_fn, LONG_PTR cb_data)
.dwCommonButtons = TDCBF_CANCEL_BUTTON|TDCBF_RETRY_BUTTON,
.pszWindowTitle = L""PACKAGE_NAME" PLAP",
.pszMainInstruction = main_text,
.pszContent = L"Starting", /* replaced on create */
.pszContent = L"Starting", /* updated in progress callback */
.pfCallback = cb_fn,
.lpCallbackData = cb_data,
};

@ -583,6 +583,12 @@ once as Administrator to update the registry."
IDS_CERT_ISSUER "Issued by"
IDS_CERT_NOTAFTER "Valid until"
/* PLAP related */
IDS_NFO_STATE_RETRYING "Retrying"
IDS_NFO_STATE_CANCELLING "Cancelling"
IDS_NFO_STATE_DISCONNECTING "Disconnecting"
IDS_NFO_CONN_CANCELLED "Connection cancelled by user"
/* openvpn daemon state names -- these are shown on progress dialog in PLAP */
IDS_NFO_OVPN_STATE_INITIAL "Initializing"
IDS_NFO_OVPN_STATE_CONNECTING "Connecting"

Loading…
Cancel
Save