Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

18.0 KB
Raw Blame
// loc.h - EN/ZH string table for the GUI.
//
// Win32 is natively UTF-16, so Chinese renders without any special handling. T(id) returns
// the current-language string; g_lang is 0=en, 1=zh. The .c source is saved UTF-8, so the
// wide literals below must be produced by the compiler treating the file as UTF-8 - the
// build passes /utf-8 so L"中文" is encoded correctly.
#ifndef PB_LOC_H
#define PB_LOC_H

#define APP_VERSION PB_VER_STRW   // defined in res/resource.h (single source of truth)

enum {
    S_M_PROXY, S_M_PROXY_SETTINGS, S_M_PROXY_RULES, S_M_ENABLE, S_TITLE_PAUSED,
    S_M_PROFILE, S_M_NEWPROFILE, S_M_DELPROFILE, S_M_IMPORT, S_M_EXPORT, S_M_SWITCH,
    S_M_SETTINGS, S_CHK_LOCALHOST, S_M_TRAFFIC, S_M_TRAY, S_M_LANG, S_M_LANG_EN, S_M_LANG_ZH,
    S_M_CLEARCONN, S_M_CLEARACT, S_M_HELP, S_M_ABOUT, S_M_DOCS, S_M_STARTUP,
    S_BTN_CLEARLOGS, S_SEARCH_CUE,
    S_TAB_CONN, S_TAB_ACT, S_TRAY_SHOW, S_TRAY_EXIT,
    S_DLG_SETTINGS, S_L_TYPE, S_L_HOST, S_L_PORT, S_L_USER, S_L_PASS, S_L_CFGLIST,
    S_BTN_ADD, S_BTN_UPDATE, S_BTN_DELETE, S_BTN_CLOSE,
    S_DLG_RULES, S_L_APPS, S_L_HOSTS, S_L_PORTS, S_L_PROTO, S_L_ACTION, S_L_CFGID,
    S_BTN_ADDRULE, S_BTN_TOGGLE,
    S_COL_ON, S_COL_APPS, S_COL_HOSTS, S_COL_PORTS, S_COL_PROTO, S_COL_ACTION, S_COL_CFG,
    S_DLG_NEWPROFILE, S_L_PROFNAME, S_BTN_OK, S_BTN_CANCEL,
    S_ABOUT_TITLE, S_ABOUT_BODY, S_STARTED, S_STARTFAIL,
    S_ERR_HOST, S_ERR_ADDCFG, S_ERR_ADDRULE, S_INFO_NODELDEFAULT, S_ERR_IMPORT, S_ERR_EXPORT,
    S_DLG_SERVERS, S_DLG_SERVER, S_G_SERVER, S_G_AUTH, S_L_ADDR, S_CHK_ENABLE, S_CHK_ENABLED,
    S_DLG_RULE, S_BTN_ADDDOTS, S_BTN_EDITDOTS, S_BTN_REMOVE, S_BTN_CLONE, S_BTN_UP, S_BTN_DOWN,
    S_COL_ADDR, S_COL_TYPE, S_RULES_HINT, S_RULES_SEARCH, S_RULES_COUNT,
    S_BTN_RUNNING, S_DLG_PROCPICK, S_PP_SEARCH, S_PP_REFRESH, S_PP_FULLPATH, S_PP_NOTE, S_PP_STATUS,
    S_PP_COL_NAME, S_PP_COL_PID, S_PP_COL_PATH, S_PP_FULL,
    S_TAB_FLOWS, S_FL_COL_APP, S_FL_COL_TARGET, S_FL_COL_PROTO, S_FL_COL_STATUS, S_FL_COL_PROXY, S_FL_COL_SENT, S_FL_COL_RECV, S_FL_CLOSED, S_FL_CLEAR,
    S_BTN_CHECK, S_TEST_OK, S_TEST_FAIL, S_TEST_TITLE,
    S_DLG_CHECKER, S_BTN_RETEST, S_TEST_RUNNING, S_CK_HOST, S_BTN_BROWSE,
    S_EX_APPS, S_EX_HOSTS, S_EX_PORTS, S_UDP_NOTE, S_EX_LOCALHOST,
    S_M_AUTOCLEAR, S_M_LOGALL, S_M_RENAME, S_M_LOGFILTERS, S_DLG_RENAME,
    S_DLG_FILTERS, S_DLG_FILTER, S_FL_DESC, S_L_MODE, S_L_PROC, S_L_IP,
    S_COL_MODE, S_COL_PROC, S_COL_IP, S_INFO_NORENAMEDEFAULT, S_ERR_RUNNING,
    S_AB_VERSION, S_AB_DESC, S_AB_AUTHOR, S_AB_WEB, S_AB_GITHUB, S_AB_LICENSE,
    S_M_UPDATE, S_UPD_TITLE, S_UPD_AVAIL, S_UPD_NOTES, S_UPD_NOW, S_UPD_LATER,
    S_UPD_DONTASK, S_UPD_LATEST, S_UPD_ERR, S_UPD_DLING, S_UPD_DLFAIL,
    S_L_NAME, S_COL_NAME, S_CHK_SENDDOMAIN,
    S_M_ZOOM_IN, S_M_ZOOM_OUT, S_M_ZOOM_RESET,
    S_COUNT
};

static int g_lang = 0; // 0 = en, 1 = zh

static const wchar_t* const g_strings[S_COUNT][2] = {
    /* S_M_PROXY            */ { L"&Proxy", L"代理(&P)" },
    /* S_M_PROXY_SETTINGS   */ { L"Proxy &Settings...", L"代理设置(&S)..." },
    /* S_M_PROXY_RULES      */ { L"Proxy &Rules...", L"代理规则(&R)..." },
    /* S_M_ENABLE           */ { L"&Enable ProxyBridge", L"启用 ProxyBridge(&E)" },
    /* S_TITLE_PAUSED       */ { L"  (PAUSED)", L"  (已暂停)" },
    /* S_M_PROFILE          */ { L"P&rofile", L"配置文件(&R)" },
    /* S_M_NEWPROFILE       */ { L"&New Profile...", L"新建配置(&N)..." },
    /* S_M_DELPROFILE       */ { L"&Delete Current Profile", L"删除当前配置(&D)" },
    /* S_M_IMPORT           */ { L"&Import Profile...", L"导入配置(&I)..." },
    /* S_M_EXPORT           */ { L"&Export Profile...", L"导出配置(&E)..." },
    /* S_M_SWITCH           */ { L"&Switch Profile", L"切换配置(&S)" },
    /* S_M_SETTINGS         */ { L"&Settings", L"设置(&S)" },
    /* S_CHK_LOCALHOST      */ { L"Also proxy localhost traffic", L"同时代理本地主机流量" },
    /* S_M_TRAFFIC          */ { L"Enable Traffic Logging", L"启用流量日志" },
    /* S_M_TRAY             */ { L"Close to Tray", L"关闭到系统托盘" },
    /* S_M_LANG             */ { L"Language", L"语言" },
    /* S_M_LANG_EN          */ { L"English", L"English" },
    /* S_M_LANG_ZH          */ { L"中文 (Chinese)", L"中文" },
    /* S_M_CLEARCONN        */ { L"Clear Connections Log", L"清除连接日志" },
    /* S_M_CLEARACT         */ { L"Clear Activity Log", L"清除活动日志" },
    /* S_M_HELP             */ { L"&Help", L"帮助(&H)" },
    /* S_M_ABOUT            */ { L"&About", L"关于(&A)" },
    /* S_M_DOCS             */ { L"&Documentation", L"文档(&D)" },
    /* S_M_STARTUP          */ { L"Run at Startup", L"开机时运行" },
    /* S_BTN_CLEARLOGS      */ { L"Clear All Logs", L"清除所有日志" },
    /* S_SEARCH_CUE         */ { L"Search (press Enter)...", L"搜索 (按回车)..." },
    /* S_TAB_CONN           */ { L"Connections", L"网络连接" },
    /* S_TAB_ACT            */ { L"Activity Log", L"活动日志" },
    /* S_TRAY_SHOW          */ { L"Show ProxyBridge", L"显示 ProxyBridge" },
    /* S_TRAY_EXIT          */ { L"Exit", L"退出" },
    /* S_DLG_SETTINGS       */ { L"Proxy Settings", L"代理设置" },
    /* S_L_TYPE             */ { L"Type:", L"类型:" },
    /* S_L_HOST             */ { L"Host / IP:", L"主机 / IP:" },
    /* S_L_PORT             */ { L"Port:", L"端口:" },
    /* S_L_USER             */ { L"Username:", L"用户名:" },
    /* S_L_PASS             */ { L"Password:", L"密码:" },
    /* S_L_CFGLIST          */ { L"Configured proxies (select to edit):", L"已配置的代理 (选择以编辑):" },
    /* S_BTN_ADD            */ { L"Add", L"添加" },
    /* S_BTN_UPDATE         */ { L"Update", L"更新" },
    /* S_BTN_DELETE         */ { L"Delete", L"删除" },
    /* S_BTN_CLOSE          */ { L"Close", L"关闭" },
    /* S_DLG_RULES          */ { L"Proxy Rules", L"代理规则" },
    /* S_L_APPS             */ { L"Applications:", L"应用程序:" },
    /* S_L_HOSTS            */ { L"Target Hosts:", L"目标主机:" },
    /* S_L_PORTS            */ { L"Target Ports:", L"目标端口:" },
    /* S_L_PROTO            */ { L"Protocol:", L"协议:" },
    /* S_L_ACTION           */ { L"Action:", L"操作:" },
    /* S_L_CFGID            */ { L"Proxy Config Id:", L"代理配置 ID:" },
    /* S_BTN_ADDRULE        */ { L"Add Rule", L"添加规则" },
    /* S_BTN_TOGGLE         */ { L"Enable/Disable", L"启用/禁用" },
    /* S_COL_ON             */ { L"On", L"启用" },
    /* S_COL_APPS           */ { L"Applications", L"应用程序" },
    /* S_COL_HOSTS          */ { L"Hosts", L"主机" },
    /* S_COL_PORTS          */ { L"Ports", L"端口" },
    /* S_COL_PROTO          */ { L"Proto", L"协议" },
    /* S_COL_ACTION         */ { L"Action", L"操作" },
    /* S_COL_CFG            */ { L"Proxy", L"代理" },
    /* S_DLG_NEWPROFILE     */ { L"New Profile", L"新建配置" },
    /* S_L_PROFNAME         */ { L"Profile name:", L"配置名称:" },
    /* S_BTN_OK             */ { L"OK", L"确定" },
    /* S_BTN_CANCEL         */ { L"Cancel", L"取消" },
    /* S_ABOUT_TITLE        */ { L"About ProxyBridge", L"关于 ProxyBridge" },
    /* S_ABOUT_BODY         */ { L"ProxyBridge\nUniversal proxy client for Windows.\n\n© InterceptSuite",
                                 L"ProxyBridge\nWindows 通用代理客户端。\n\n© InterceptSuite" },
    /* S_STARTED            */ { L"ProxyBridge service started.\r\n", L"ProxyBridge 服务已启动。\r\n" },
    /* S_STARTFAIL          */ { L"[error] Failed to start ProxyBridge service. Run as Administrator and ensure WinDivert64.sys is present.\r\n",
                                 L"[错误] 无法启动 ProxyBridge 服务。请以管理员身份运行,并确保 WinDivert64.sys 存在。\r\n" },
    /* S_ERR_HOST           */ { L"Host is required.", L"必须填写主机。" },
    /* S_ERR_ADDCFG         */ { L"Failed to add proxy config.", L"添加代理配置失败。" },
    /* S_ERR_ADDRULE        */ { L"Failed to add rule.", L"添加规则失败。" },
    /* S_INFO_NODELDEFAULT  */ { L"The Default profile cannot be deleted.", L"无法删除默认配置。" },
    /* S_ERR_IMPORT         */ { L"Failed to import profile.", L"导入配置失败。" },
    /* S_ERR_EXPORT         */ { L"Failed to export profile.", L"导出配置失败。" },
    /* S_DLG_SERVERS        */ { L"Proxy Servers", L"代理服务器" },
    /* S_DLG_SERVER         */ { L"Proxy Server", L"代理服务器" },
    /* S_G_SERVER           */ { L"Server", L"服务器" },
    /* S_G_AUTH             */ { L"Authentication", L"身份验证" },
    /* S_L_ADDR             */ { L"Address:", L"地址:" },
    /* S_CHK_ENABLE         */ { L"Enable", L"启用" },
    /* S_CHK_ENABLED        */ { L"Enabled", L"已启用" },
    /* S_DLG_RULE           */ { L"Proxy Rule", L"代理规则" },
    /* S_BTN_ADDDOTS        */ { L"Add...", L"添加..." },
    /* S_BTN_EDITDOTS       */ { L"Edit...", L"编辑..." },
    /* S_BTN_REMOVE         */ { L"Remove", L"移除" },
    /* S_BTN_CLONE          */ { L"Clone", L"克隆" },
    /* S_BTN_UP             */ { L"\x25B2", L"\x25B2" },
    /* S_BTN_DOWN           */ { L"\x25BC", L"\x25BC" },
    /* S_COL_ADDR           */ { L"Address", L"地址" },
    /* S_COL_TYPE           */ { L"Type", L"类型" },
    /* S_RULES_HINT         */ { L"Rules are checked top to bottom; use the check box to enable/disable a rule.",
                                 L"规则从上到下依次匹配;使用复选框启用/禁用规则。" },
    /* S_RULES_SEARCH       */ { L"Search rules (name, apps, hosts, ports, proxy)...", L"搜索规则 (名称、应用、主机、端口、代理)..." },
    /* S_RULES_COUNT        */ { L"%d of %d rules - clear the search to reorder", L"%d / %d 条规则 - 清除搜索后可调整顺序" },
    /* S_BTN_RUNNING        */ { L"Running...", L"运行中..." },
    /* S_DLG_PROCPICK       */ { L"Add running process", L"添加正在运行的进程" },
    /* S_PP_SEARCH          */ { L"Search by name or path...", L"按名称或路径搜索..." },
    /* S_PP_REFRESH         */ { L"Refresh", L"刷新" },
    /* S_PP_FULLPATH        */ { L"Use full executable path when available", L"尽可能使用完整的可执行文件路径" },
    /* S_PP_NOTE            */ { L"Rules match programs by name: only the name (or the full path, if ticked) is added. The PID is shown for reference only.",
                                 L"规则按程序名称匹配: 只会添加名称 (勾选后为完整路径)。PID 仅供参考。" },
    /* S_PP_STATUS          */ { L"%d program(s) running. Programs whose path cannot be read are listed by name.", L"%d 个程序正在运行。无法读取路径的程序仅按名称列出。" },
    /* S_PP_COL_NAME        */ { L"Process name", L"进程名称" },
    /* S_PP_COL_PID         */ { L"PID", L"PID" },
    /* S_PP_COL_PATH        */ { L"Executable path", L"可执行文件路径" },
    /* S_PP_FULL            */ { L"The Applications list is full (maximum %d characters): %d program(s) could not be added.", L"应用程序列表已满 (最多 %d 个字符): 有 %d 个程序无法添加。" },
    /* S_TAB_FLOWS         */ { L"Live Connections", L"实时连接" },
    /* S_FL_COL_APP        */ { L"Application (PID)", L"应用程序 (PID)" },
    /* S_FL_COL_TARGET     */ { L"Target", L"目标" },
    /* S_FL_COL_PROTO      */ { L"Protocol", L"协议" },
    /* S_FL_COL_STATUS     */ { L"Time / Status", L"时间 / 状态" },
    /* S_FL_COL_PROXY      */ { L"Rule : Proxy", L"规则 : 代理" },
    /* S_FL_COL_SENT       */ { L"Sent", L"已发送" },
    /* S_FL_COL_RECV       */ { L"Received", L"已接收" },
    /* S_FL_CLOSED         */ { L"Closed", L"已关闭" },
    /* S_FL_CLEAR          */ { L"Clear closed", L"清除已关闭" },
    /* S_BTN_CHECK          */ { L"Proxy Test", L"代理测试" },
    /* S_TEST_OK            */ { L"Proxy is reachable.\n\n%s", L"代理可访问。\n\n%s" },
    /* S_TEST_FAIL          */ { L"Proxy test failed.\n\n%s", L"代理测试失败。\n\n%s" },
    /* S_TEST_TITLE         */ { L"Proxy Check", L"代理测试" },
    /* S_DLG_CHECKER        */ { L"Proxy Checker", L"代理检查器" },
    /* S_BTN_RETEST         */ { L"Retest", L"重新测试" },
    /* S_TEST_RUNNING       */ { L"Testing, please wait...", L"正在测试,请稍候..." },
    /* S_CK_HOST            */ { L"Host:", L"主机:" },
    /* S_BTN_BROWSE         */ { L"Browse...", L"浏览..." },
    /* S_EX_APPS            */ { L"Example: iexplore.exe; \"C:\\some app.exe\"; fire*.exe; *.bin",
                                 L"示例: iexplore.exe; \"C:\\某个应用.exe\"; fire*.exe; *.bin" },
    /* S_EX_HOSTS           */ { L"Example: 192.168.1.*; 10.0.0.0/8; 10.1.0.0-10.5.255.255; ::1; 2001:db8::/32; github.com; *.github.com (domain names need unencrypted DNS). One entry per line is fine; separate entries with ;",
                                 L"示例: 192.168.1.*; 10.0.0.0/8; 10.1.0.0-10.5.255.255; ::1; 2001:db8::/32; github.com; *.github.com (域名需要未加密的 DNS)。可以每行一个条目,条目之间用 ; 分隔" },
    /* S_EX_PORTS           */ { L"Example: 80; 8000-9000; 3128", L"示例: 80; 8000-9000; 3128" },
    /* S_UDP_NOTE           */ { L"\x26A0 UDP only works with SOCKS5 proxy. Not all SOCKS5 proxies support UDP by default. "
                                 L"SOCKS5 UDP support does not guarantee QUIC or HTTP/3 support, verify your proxy supports these protocols separately.",
                                 L"\x26A0 UDP 仅支持 SOCKS5 代理。并非所有 SOCKS5 代理默认支持 UDP。SOCKS5 UDP 支持并不保证支持 QUIC 或 HTTP/3 -- 请单独确认您的代理是否支持这些协议。" },
    /* S_EX_LOCALHOST       */ { L"Off: this rule's connections to localhost (127.0.0.1, ::1) stay direct. On: they go through the proxy too (e.g. to intercept local traffic).",
                                 L"关闭: 此规则匹配的本地主机连接(127.0.0.1、::1)直连。开启: 同样通过代理(例如拦截本地流量)。" },
    /* S_M_AUTOCLEAR        */ { L"Auto Clear Logs", L"自动清除日志" },
    /* S_M_LOGALL           */ { L"Log Every Connection", L"记录每个连接" },
    /* S_M_RENAME           */ { L"Rename Profile", L"重命名配置" },
    /* S_M_LOGFILTERS       */ { L"Log Filters...", L"日志过滤器..." },
    /* S_DLG_RENAME         */ { L"Rename Profile", L"重命名配置" },
    /* S_DLG_FILTERS        */ { L"Log Filters", L"日志过滤器" },
    /* S_DLG_FILTER         */ { L"Log Filter Rule", L"日志过滤规则" },
    /* S_FL_DESC            */ { L"Include rules show only matching connections; Exclude rules hide matching connections (excludes run first). "
                                 L"Leave a field empty or \"All\" to ignore it. Wildcards: chrome* / *.exe / *ch*.",
                                 L"Include 规则只显示匹配的连接;Exclude 规则隐藏匹配的连接(排除优先)。留空或选\"全部\"表示忽略该字段。通配符:chrome* / *.exe / *ch*。" },
    /* S_L_MODE             */ { L"Mode:", L"模式:" },
    /* S_L_PROC             */ { L"Process:", L"进程:" },
    /* S_L_IP               */ { L"IP:", L"IP:" },
    /* S_COL_MODE           */ { L"Mode", L"模式" },
    /* S_COL_PROC           */ { L"Process", L"进程" },
    /* S_COL_IP             */ { L"IP", L"IP" },
    /* S_INFO_NORENAMEDEFAULT*/{ L"The Default profile cannot be renamed.", L"无法重命名默认配置。" },
    /* S_ERR_RUNNING        */ { L"ProxyBridge is already running (GUI or CLI).\nPlease close the other instance first.",
                                 L"ProxyBridge 已在运行 (GUI 或 CLI)。\n请先关闭另一个实例。" },
    /* S_AB_VERSION         */ { L"Version " APP_VERSION, L"版本 " APP_VERSION },
    /* S_AB_DESC            */ { L"Universal proxy client for Windows applications",
                                 L"适用于 Windows 应用程序的通用代理客户端" },
    /* S_AB_AUTHOR          */ { L"Author: Sourav Kalal / InterceptSuite", L"作者: Sourav Kalal / InterceptSuite" },
    /* S_AB_WEB             */ { L"Website: <a href=\"https://interceptsuite.com\">interceptsuite.com</a>",
                                 L"网站: <a href=\"https://interceptsuite.com\">interceptsuite.com</a>" },
    /* S_AB_GITHUB          */ { L"GitHub: <a href=\"https://github.com/InterceptSuite/ProxyBridge\">github.com/InterceptSuite/ProxyBridge</a>",
                                 L"GitHub: <a href=\"https://github.com/InterceptSuite/ProxyBridge\">github.com/InterceptSuite/ProxyBridge</a>" },
    /* S_AB_LICENSE         */ { L"License: MIT", L"许可证: MIT" },
    /* S_M_UPDATE           */ { L"Check for &Updates...", L"检查更新(&U)..." },
    /* S_UPD_TITLE          */ { L"Software Update", L"软件更新" },
    /* S_UPD_AVAIL          */ { L"A new version of ProxyBridge is available.", L"ProxyBridge 有新版本可用。" },
    /* S_UPD_NOTES          */ { L"Release notes", L"发行说明" },
    /* S_UPD_NOW            */ { L"Update Now", L"立即更新" },
    /* S_UPD_LATER          */ { L"Later", L"稍后" },
    /* S_UPD_DONTASK        */ { L"Don't Ask Again", L"不再提示" },
    /* S_UPD_LATEST         */ { L"You are running the latest version.", L"您正在使用最新版本。" },
    /* S_UPD_ERR            */ { L"Could not check for updates. Please try again later.", L"无法检查更新,请稍后重试。" },
    /* S_UPD_DLING          */ { L"Downloading update...", L"正在下载更新..." },
    /* S_UPD_DLFAIL         */ { L"Download failed.", L"下载失败。" },
    /* S_L_NAME             */ { L"Name:", L"名称:" },
    /* S_COL_NAME           */ { L"Name", L"名称" },
    /* S_CHK_SENDDOMAIN     */ { L"Let proxy resolve DNS (send hostname)", L"由代理解析 DNS (发送主机名)" },
    /* S_M_ZOOM_IN         */ { L"Increase Text Size	Ctrl++", L"放大文字	Ctrl++" },
    /* S_M_ZOOM_OUT        */ { L"Decrease Text Size	Ctrl+-", L"缩小文字	Ctrl+-" },
    /* S_M_ZOOM_RESET      */ { L"Reset Text Size	Ctrl+0", L"重置文字大小	Ctrl+0" },
};

static const wchar_t* T(int id) { return g_strings[id][g_lang ? 1 : 0]; }

#endif // PB_LOC_H