From 72a4bb84bfaa069cf4a97c5658d04f5a5bb0972b Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Thu, 31 Aug 2023 18:13:13 +0300 Subject: [PATCH] Improve "OpenVPN GUI" tooltip handling (#649) There is no point in localizing "OpenVPN GUI" tray icon tooltip. Remove it from resources and replace with PACKAGE_NAME define. Signed-off-by: Lev Stipakov --- openvpn-gui-res.h | 1 - res/openvpn-gui-res-cs.rc | 1 - res/openvpn-gui-res-de.rc | 1 - res/openvpn-gui-res-dk.rc | 1 - res/openvpn-gui-res-en.rc | 1 - res/openvpn-gui-res-es.rc | 1 - res/openvpn-gui-res-fa.rc | 1 - res/openvpn-gui-res-fi.rc | 1 - res/openvpn-gui-res-fr.rc | 1 - res/openvpn-gui-res-it.rc | 1 - res/openvpn-gui-res-jp.rc | 1 - res/openvpn-gui-res-kr.rc | 1 - res/openvpn-gui-res-nl.rc | 1 - res/openvpn-gui-res-no.rc | 1 - res/openvpn-gui-res-pl.rc | 1 - res/openvpn-gui-res-pt.rc | 1 - res/openvpn-gui-res-ru.rc | 1 - res/openvpn-gui-res-se.rc | 1 - res/openvpn-gui-res-tr.rc | 1 - res/openvpn-gui-res-ua.rc | 1 - res/openvpn-gui-res-zh-hans.rc | 1 - res/openvpn-gui-res-zh-hant.rc | 1 - tray.c | 4 ++-- 23 files changed, 2 insertions(+), 24 deletions(-) diff --git a/openvpn-gui-res.h b/openvpn-gui-res.h index 41ce3ce..e32aab2 100644 --- a/openvpn-gui-res.h +++ b/openvpn-gui-res.h @@ -171,7 +171,6 @@ */ /* Tray Tooltips */ -#define IDS_TIP_DEFAULT 1000 #define IDS_TIP_CONNECTED 1001 #define IDS_TIP_CONNECTING 1003 #define IDS_TIP_CONNECTED_SINCE 1004 diff --git a/res/openvpn-gui-res-cs.rc b/res/openvpn-gui-res-cs.rc index 2a6352e..140303f 100644 --- a/res/openvpn-gui-res-cs.rc +++ b/res/openvpn-gui-res-cs.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Česky - Czech" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nPřipojeno: " IDS_TIP_CONNECTING "\nPřipojování: " IDS_TIP_CONNECTED_SINCE "\nPřipojeno od: " diff --git a/res/openvpn-gui-res-de.rc b/res/openvpn-gui-res-de.rc index bb1b48a..9001eff 100644 --- a/res/openvpn-gui-res-de.rc +++ b/res/openvpn-gui-res-de.rc @@ -311,7 +311,6 @@ BEGIN IDS_LANGUAGE_NAME "Deutsch – German" /* Tray – Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI" IDS_TIP_CONNECTED "\nVerbunden mit: " IDS_TIP_CONNECTING "\nVerbinden mit: " IDS_TIP_CONNECTED_SINCE "\nVerbunden seit: " diff --git a/res/openvpn-gui-res-dk.rc b/res/openvpn-gui-res-dk.rc index 6d4200a..679227a 100644 --- a/res/openvpn-gui-res-dk.rc +++ b/res/openvpn-gui-res-dk.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Dansk - Danish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN Brugerprogram" IDS_TIP_CONNECTED "\nForbundet: " IDS_TIP_CONNECTING "\nEtablere forbindelse: " IDS_TIP_CONNECTED_SINCE "\nForbundet siden: " diff --git a/res/openvpn-gui-res-en.rc b/res/openvpn-gui-res-en.rc index 3ee885e..c0bc3c0 100644 --- a/res/openvpn-gui-res-en.rc +++ b/res/openvpn-gui-res-en.rc @@ -324,7 +324,6 @@ BEGIN IDS_LANGUAGE_NAME "English" /* Tray – Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nConnected to: " IDS_TIP_CONNECTING "\nConnecting to: " IDS_TIP_CONNECTED_SINCE "\nConnected since: " diff --git a/res/openvpn-gui-res-es.rc b/res/openvpn-gui-res-es.rc index 96d5507..c728a21 100644 --- a/res/openvpn-gui-res-es.rc +++ b/res/openvpn-gui-res-es.rc @@ -308,7 +308,6 @@ BEGIN IDS_LANGUAGE_NAME "Español - Spanish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nConectado a: " IDS_TIP_CONNECTING "\nConectando a: " IDS_TIP_CONNECTED_SINCE "\nConectado desde: " diff --git a/res/openvpn-gui-res-fa.rc b/res/openvpn-gui-res-fa.rc index 781dbda..00879ed 100644 --- a/res/openvpn-gui-res-fa.rc +++ b/res/openvpn-gui-res-fa.rc @@ -318,7 +318,6 @@ BEGIN IDS_LANGUAGE_NAME "فارسی - Persian(Farsi)" /* Tray – Resources */ - IDS_TIP_DEFAULT "رابط گرافیکی OpenVPN " IDS_TIP_CONNECTED "\nاتصال به: " IDS_TIP_CONNECTING "\nدر حال اتصال به: " IDS_TIP_CONNECTED_SINCE "\nمتصل شده به: " diff --git a/res/openvpn-gui-res-fi.rc b/res/openvpn-gui-res-fi.rc index 84d5adc..3f055bf 100644 --- a/res/openvpn-gui-res-fi.rc +++ b/res/openvpn-gui-res-fi.rc @@ -309,7 +309,6 @@ BEGIN IDS_LANGUAGE_NAME "Suomi - Finnish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI" IDS_TIP_CONNECTED "\nYhdistetty kohteeseen: " IDS_TIP_CONNECTING "\nYhdistetään kohteeseen: " IDS_TIP_CONNECTED_SINCE "\nYhteys luotu: " diff --git a/res/openvpn-gui-res-fr.rc b/res/openvpn-gui-res-fr.rc index c8e5353..59ff15b 100644 --- a/res/openvpn-gui-res-fr.rc +++ b/res/openvpn-gui-res-fr.rc @@ -309,7 +309,6 @@ BEGIN IDS_LANGUAGE_NAME "Français - French" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nConnecté à: " IDS_TIP_CONNECTING "\nConnexion à: " IDS_TIP_CONNECTED_SINCE "\nConnecté depuis: " diff --git a/res/openvpn-gui-res-it.rc b/res/openvpn-gui-res-it.rc index 57e7a0c..9653d31 100644 --- a/res/openvpn-gui-res-it.rc +++ b/res/openvpn-gui-res-it.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Italiano - Italian" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nConnesso a: " IDS_TIP_CONNECTING "\nConnessione in corso a: " IDS_TIP_CONNECTED_SINCE "\nConnesso da: " diff --git a/res/openvpn-gui-res-jp.rc b/res/openvpn-gui-res-jp.rc index 07d78ce..ee849ab 100644 --- a/res/openvpn-gui-res-jp.rc +++ b/res/openvpn-gui-res-jp.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "日本語 - Japanese" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\n接続済み: " IDS_TIP_CONNECTING "\n接続中: " IDS_TIP_CONNECTED_SINCE "\n接続時間: " diff --git a/res/openvpn-gui-res-kr.rc b/res/openvpn-gui-res-kr.rc index 2a64f29..dbeef10 100644 --- a/res/openvpn-gui-res-kr.rc +++ b/res/openvpn-gui-res-kr.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "한국어 - Korean" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\n연결됨: " IDS_TIP_CONNECTING "\n연결중: " IDS_TIP_CONNECTED_SINCE "\n연결 시간: " diff --git a/res/openvpn-gui-res-nl.rc b/res/openvpn-gui-res-nl.rc index 819b399..123b86c 100644 --- a/res/openvpn-gui-res-nl.rc +++ b/res/openvpn-gui-res-nl.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Nederlands - Dutch" /* Tray – Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nVerbonden met: " IDS_TIP_CONNECTING "\nVerbinden met: " IDS_TIP_CONNECTED_SINCE "\nVerbonden sinds: " diff --git a/res/openvpn-gui-res-no.rc b/res/openvpn-gui-res-no.rc index b23dbbb..08029ab 100644 --- a/res/openvpn-gui-res-no.rc +++ b/res/openvpn-gui-res-no.rc @@ -309,7 +309,6 @@ BEGIN IDS_LANGUAGE_NAME "Norsk - Norwegian" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN Brukergrensesnitt" IDS_TIP_CONNECTED "\nTilkoblet: " IDS_TIP_CONNECTING "\nKobler til: " IDS_TIP_CONNECTED_SINCE "\nTilkoblet siden: " diff --git a/res/openvpn-gui-res-pl.rc b/res/openvpn-gui-res-pl.rc index cc6337b..99b8018 100644 --- a/res/openvpn-gui-res-pl.rc +++ b/res/openvpn-gui-res-pl.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Polski - Polish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nPołączony z: " IDS_TIP_CONNECTING "\nŁączenie z: " IDS_TIP_CONNECTED_SINCE "\nPołączony od: " diff --git a/res/openvpn-gui-res-pt.rc b/res/openvpn-gui-res-pt.rc index 43d7829..2230960 100644 --- a/res/openvpn-gui-res-pt.rc +++ b/res/openvpn-gui-res-pt.rc @@ -308,7 +308,6 @@ BEGIN IDS_LANGUAGE_NAME "Português - Portuguese" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nConectado a: " IDS_TIP_CONNECTING "\nConectando a: " IDS_TIP_CONNECTED_SINCE "\nConectado desde: " diff --git a/res/openvpn-gui-res-ru.rc b/res/openvpn-gui-res-ru.rc index 2213a03..b994d7a 100644 --- a/res/openvpn-gui-res-ru.rc +++ b/res/openvpn-gui-res-ru.rc @@ -311,7 +311,6 @@ BEGIN IDS_LANGUAGE_NAME "Русский - Russian" /* Tray - Resources */ - IDS_TIP_DEFAULT "Графический интерфейс OpenVPN" IDS_TIP_CONNECTED "\nПодключен к: " IDS_TIP_CONNECTING "\nПодключение к: " IDS_TIP_CONNECTED_SINCE "\nПодключен с: " diff --git a/res/openvpn-gui-res-se.rc b/res/openvpn-gui-res-se.rc index be83c80..baaca10 100644 --- a/res/openvpn-gui-res-se.rc +++ b/res/openvpn-gui-res-se.rc @@ -308,7 +308,6 @@ BEGIN IDS_LANGUAGE_NAME "Svenska - Swedish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI" IDS_TIP_CONNECTED "\nAnsluten till: " IDS_TIP_CONNECTING "\nAnsluter till: " IDS_TIP_CONNECTED_SINCE "\nAnsluten sedan: " diff --git a/res/openvpn-gui-res-tr.rc b/res/openvpn-gui-res-tr.rc index 3877e78..65d8e8a 100644 --- a/res/openvpn-gui-res-tr.rc +++ b/res/openvpn-gui-res-tr.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Türkçe - Turkish" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nBağlanıldı: " IDS_TIP_CONNECTING "\nBağlanılıyor: " IDS_TIP_CONNECTED_SINCE "\nBağlanıldı: " diff --git a/res/openvpn-gui-res-ua.rc b/res/openvpn-gui-res-ua.rc index 15fdf8e..267e530 100644 --- a/res/openvpn-gui-res-ua.rc +++ b/res/openvpn-gui-res-ua.rc @@ -310,7 +310,6 @@ BEGIN IDS_LANGUAGE_NAME "Українська - Ukrainian" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI " IDS_TIP_CONNECTED "\nЗ'єднано з узлом: " IDS_TIP_CONNECTING "\nЗ'єднання з: " IDS_TIP_CONNECTED_SINCE "\nЗ'єднано з такого часу: " diff --git a/res/openvpn-gui-res-zh-hans.rc b/res/openvpn-gui-res-zh-hans.rc index b7ece58..1084947 100644 --- a/res/openvpn-gui-res-zh-hans.rc +++ b/res/openvpn-gui-res-zh-hans.rc @@ -312,7 +312,6 @@ BEGIN IDS_LANGUAGE_NAME "简体中文 - Chinese (Simplified)" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI" IDS_TIP_CONNECTED "\n已连接至: " IDS_TIP_CONNECTING "\n正在连接至: " IDS_TIP_CONNECTED_SINCE "\n连接自: " diff --git a/res/openvpn-gui-res-zh-hant.rc b/res/openvpn-gui-res-zh-hant.rc index f792536..eb1105c 100644 --- a/res/openvpn-gui-res-zh-hant.rc +++ b/res/openvpn-gui-res-zh-hant.rc @@ -312,7 +312,6 @@ BEGIN IDS_LANGUAGE_NAME "繁體中文 - Chinese (Traditional)" /* Tray - Resources */ - IDS_TIP_DEFAULT "OpenVPN GUI" IDS_TIP_CONNECTED "\n已連線至: " IDS_TIP_CONNECTING "\n正在連線至: " IDS_TIP_CONNECTED_SINCE "\n連線自: " diff --git a/tray.c b/tray.c index 2c645b1..a5e4890 100644 --- a/tray.c +++ b/tray.c @@ -434,7 +434,7 @@ ShowTrayIcon() ni.uFlags = NIF_MESSAGE | NIF_TIP | NIF_ICON; ni.uCallbackMessage = WM_NOTIFYICONTRAY; ni.hIcon = LoadLocalizedSmallIcon(ID_ICO_DISCONNECTED); - _tcsncpy(ni.szTip, LoadLocalizedString(IDS_TIP_DEFAULT), _countof(ni.szTip)); + _tcsncpy(ni.szTip, _T(PACKAGE_NAME), _countof(_T(PACKAGE_NAME))); Shell_NotifyIcon(NIM_ADD, &ni); } @@ -449,7 +449,7 @@ SetTrayIcon(conn_state_t state) UINT icon_id; connection_t *cc = NULL; /* a connected config */ - _tcsncpy(msg, LoadLocalizedString(IDS_TIP_DEFAULT), _countof(ni.szTip)); + _tcsncpy(msg, _T(PACKAGE_NAME), _countof(_T(PACKAGE_NAME))); _tcsncpy(msg_connected, LoadLocalizedString(IDS_TIP_CONNECTED), _countof(msg_connected)); _tcsncpy(msg_connecting, LoadLocalizedString(IDS_TIP_CONNECTING), _countof(msg_connecting));