From 0e90365ae5041cd8daf5590c217d4dd13d6a2549 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Sat, 29 Nov 2025 19:42:17 +0800
Subject: [PATCH 01/19] readme i18n
---
.gitignore | 1 +
readme.md | 289 +++++++++++++++++++++++++++------------------------
readme_en.md | 244 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 400 insertions(+), 134 deletions(-)
create mode 100644 readme_en.md
diff --git a/.gitignore b/.gitignore
index 6143666..0c18523 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ bin
obj
*.user
packages/
+/.history
diff --git a/readme.md b/readme.md
index 4883156..ea86b72 100644
--- a/readme.md
+++ b/readme.md
@@ -1,219 +1,240 @@
-# Browser Picker
-A default browser replacement for windows to let you pick your preferred browser on the fly or in accordance with your own rules.
+# 浏览器选择器(Browser Picker)
-
+[English](/readme_en.md) | 中文
-You can easily configure it to use Firefox for `github.com` and `slashdot.org`, but leave Edge to handle `microsoft.com`
-and even let Internet Explorer handle that old internal LOB app you'd rather not use but must.
+一款适用于 Windows 系统的默认浏览器替代工具,可让你选择偏好的浏览器,或根据自定义规则自动选择浏览器。
-## Installation
-You can find the latest release on [github](https://github.com/mortenn/BrowserPicker/releases).
+
-### Default browser
-To enable the browser picker window, you need to set Browser Picker as your default browser.
+你可以轻松配置规则:例如用 Firefox 打开 `GitHub.com` 和 `slashdot.org`,用 Edge 处理 `microsoft.com`,甚至可以让 Internet Explorer 打开那款你不想用但又必须使用的旧版内部业务线(LOB)应用。
-### .NET Runtime dependent binary
-BrowserPicker.msi and Dependent.zip are JIT compiled and require you have the [.NET 9.0 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) installed.
-Direct links: [64bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer), [32bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer).
+## 安装
-#### Native image generation
-As part of installation, `BrowserPicker.msi` will execute ngen to build a native image for your computer.
-This significantly enhances launch times for the executable.
-If you prefer the bundle, you may run `ngen install BrowserPicker.exe` to get the same benefit.
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker/releases) 上获取最新版本。
-### Portable binary
-If you do not want to have the .net runtime installed on your computer, you may download the Portable version, which includes the runtime.
+### 设置默认浏览器
-`BrowserPicker-Portable.msi` and `Portable.zip` contain a win-x64 binary executable with embedded .NET runtime.
-This makes the file sizes quite significantly larger, but you do not need an additional runtime to use these.
+要启用浏览器选择器窗口,需将 “浏览器选择器” 设为系统默认浏览器。
-### Signing certificate
-To avoid warnings about unknown publisher, you may [import](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates) the provided certificate into your certificate store first.
+### 依赖 .NET 运行时的安装包
-### Manual steps
-You need to open the settings app from the start menu, navigate into Apps, select Default apps, then change the Web browser to BrowserPicker.
-Please ensure BrowserPicker can be started before you do this.
+BrowserPicker.msi 和 Dependent.zip 为即时编译(JIT)版本,需安装 [.NET 9.0 桌面运行时](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) 才能使用。直接下载链接:[64 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer)、[32 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer)。
-## Usage
+#### 原生镜像生成
-When you open a link outside a browser, one of these things will happen, in order:
+安装过程中,`BrowserPicker.msi` 会执行 ngen 工具为你的电脑生成原生镜像,这能显著提升可执行文件的启动速度。若你选择压缩包版本,可运行命令 `ngen install BrowserPicker.exe` 以获得相同优化效果。
-1. If you have previously selected `Always ask`, the browser selection window is shown.
-2. If you have set up a configuration rule matching the url being opened, the selected browser will be launched with the url.
-3. If you only have one browser running, the link will be opened in that browser.
-4. If you have configured a default browser, it will be asked to open the url.
-3. Otherwise, you will be presented with a simple window asking you which browser you want to use.
+### 便携版安装包
-The url is shown at the top of the window, and if it matches a list of known url shorteners, BrowserPicker will expand this address and show you the real one after a short delay.
-If you do not want BrowserPicker to perform this operation (it will call the internet), you may disable this feature in the settings.
+若不想在电脑上安装 .NET 运行时,可下载包含运行时的便携版。
-### Copy url
-You can click the clipboard icon at the top to copy the url without opening it
+`BrowserPicker-Portable.msi` 和 `Portable.zip` 包含适用于 win-x64 系统的可执行文件,且已嵌入 .NET 运行时。该版本文件体积会显著增大,但无需额外安装运行时即可使用。
-### Edit url
-You can click the pencil icon at the top of the window to edit or copy the url before visiting it or cancelling:
+### 签名证书
-
-
+为避免 “未知发布者” 警告,可先将提供的证书导入你的证书存储区,导入方法参考 [此处](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates)。
-### Keyboard shortcuts
+### 手动设置步骤
-When this window is open and has focus, you can use the following keyboard shortcuts:
+1.从开始菜单打开 “设置” 应用;
+2.进入 “应用” 选项;
+3.选择 “默认应用”;
+4.将 “网页浏览器” 改为 “浏览器选择器”。
+ **注意**:执行此操作前,请确保 “浏览器选择器” 可正常启动。
-`[enter]` or `[1]` Pick the first browser in the list
+## 使用方法
-`[2]` Pick the second browser in the list
+当你在浏览器外打开链接时,会按以下优先级触发操作:
-...
+1. 若此前选择过 **始终询问**,则显示浏览器选择窗口
+2. 若已配置与当前链接匹配的规则,则用指定浏览器打开该链接
+3. 若仅有一个浏览器处于运行状态,则在该浏览器中打开链接
+4. 若已配置默认浏览器,则调用默认浏览器打开链接
+5. 若以上情况均不满足,则显示简易窗口,让你选择要使用的浏览器
-`[9]` Pick the ninth browser in the list
+链接地址会显示在窗口顶部:若该地址属于已知短链接服务,浏览器选择器会在短暂延迟后解析真实地址并显示。
+若你不希望浏览器选择器执行此操作(该操作需连接网络),可在设置中禁用此功能。
-If you keep `[alt]` pressed while hitting one of these, the browser will be opened in privacy mode.
+### 复制链接
-`[esc]` Abort and close window
+点击窗口顶部的剪贴板图标,可复制链接地址而不打开链接。
-If you click outside the window such that it loses focus, it will close without opening the url in any browser.
+### 编辑链接
-Each browser that supports it, has a blue shield button on the right side.
-Browsers currently supporting privacy mode are firefox, internet explorer, chrome, and edge.
+点击窗口顶部的铅笔图标,可在访问或取消访问链接前编辑或复制链接地址:
-Currently running browsers will have their name in bold, whilst browsers not currently running will have their names in cursive.
+
+
-As you use the application, it keeps count of how many times you selected each browser. This information is used to show you your browsers in your preferred order automatically.
+### 键盘快捷键
-At the bottom of the window, there is a checkbox to enable "always ask" and a hyperlink to open settings.
+当浏览器选择窗口处于打开并获得焦点的状态时,可使用以下快捷键:
+按住 [Alt] 键并按下数字键,可在隐私模式下打开对应浏览器。
-## Settings
-By simply launching BrowserPicker from the start menu or double clicking the `BrowserPicker.exe` file, you will be presented with a GUI to configure the behaviour.
-The configuration is saved in the Windows registry: `HKEY_CURRENT_USER\Software\BrowserPicker`, if you ever need to manually edit it or make a backup.
+- [Enter] 或 [1]:选择列表中的第一个浏览器
+- [2]:选择列表中的第二个浏览器
+- ...
+- [9]:选择列表中的第九个浏览器
+- [Esc]:取消操作并关闭窗口
-
+若点击窗口外部导致窗口失去焦点,窗口会关闭且不会用任何浏览器打开链接。
-### Browsers
+当前处于运行状态的浏览器,其名称会以粗体显示;未运行的浏览器,名称会以斜体显示。
-The browser list shows you the browsers BrowserPicker has been configured or detected to use.
+在你使用该应用的过程中,它会统计你选择各浏览器的次数,并根据这些数据自动按你的偏好顺序排列浏览器列表。
-#### Disabling browsers
-You can disable a browser by clicking `Enabled`, this will hide the browser from the selection list.
+窗口底部有一个 **始终询问** 复选框,以及一个用于打开设置界面的超链接。
-
+## 设置
-#### Removing browsers
-If you click the red X, you may remove a browser.
+从开始菜单启动 “浏览器选择器”,或双击 `BrowserPicker.exe` 文件,即可打开图形化界面(GUI)配置其行为。
-Do note that if it was automatically detected, it will return to the list the next time auto configuration is performed.
+配置信息保存在 Windows 注册表中,路径为 `HKEY_CURRENT_USER\Software\BrowserPicker`,你可在此路径下手动编辑配置或创建备份。
-#### Automatic configuration
-The `Refresh broser list` function gets automatically executed in the background when you use BrowserPicker.
-This helps it discovering newly installed browsers, in case a new browser has been installed,
+
-#### Manually adding browser
-You may click the hyperlink `Add browser` to open a popup where you may manually add a browser that has not been detected - or some other tool that isn't a browser.
+### 浏览器
-You can click the buttons behind the input boxes to bring up the file picker interface of windows to select the executable or icon file you want to use.
+浏览器列表显示 “浏览器选择器” 已配置或检测到的可用浏览器。
-
-
+#### 禁用浏览器
-
+点击 **已启用(Enabled)** 可禁用对应浏览器,禁用后该浏览器会从选择列表中隐藏。
-If you browse for the command first, the application will assume the executable also has an icon, and prefill that box.
+
-The name of the application will be attempted to be set automatically based on information in the executable.
+#### 删除浏览器
-##### Chrome profiles
+点击红色 “X” 图标可删除对应浏览器。
-Tip for Chrome Users: If you are using multiple Chrome profiles, by default if you choose Chrome it will launch in the last
-profile you launched Chrome with. To make it possibe for browser picker to select a profile you can create a new browser
-for each profile, set the program to the chrome executable, and add a command line argument to specify which profile to launch:
-`--profile-directory=Default` for the first profile, `--profile-directory="Profile 1"` for the second profile, and so on.
+注意:若该浏览器是自动检测到的,下次执行自动配置时会重新出现在列表中。
-Please note that arguments with spaces do require "" around them to be properly passed to chrome.
+#### 自动配置
-##### Firefox profiles
+使用 “浏览器选择器” 时,**刷新浏览器列表** 功能会在后台自动执行,帮助检测新安装的浏览器。
-Similar configuration should be possible for firefox.
+#### 手动添加浏览器
-### Behaviour
-This tab contains various settings that govern how BrowserPicker operates.
+点击 **添加浏览器** 超链接,会弹出一个窗口,你可在此手动添加未被检测到的浏览器,或添加非浏览器类工具。
+点击输入框后方的按钮,可打开 Windows 文件选择界面,选择要使用的可执行文件或图标文件。
-
+
+
-> [ ] Turn off transparency
+
-This will make BrowserPicker have a simple black background, to help with legibility
+若你先选择可执行文件,应用会默认该文件包含图标,并自动填充图标文件输入框。
-> [ ] Always show browser selection window
+应用名称会尝试根据可执行文件中的信息自动设置。
-This option is also available on the browser selection window. When enabled, BrowserPicker will always ask the user to make a choice.
+##### Chrome 配置文件
-> [ ] When no default is configured matching the url, use: [__v]
+Chrome 用户提示:若你使用多个 Chrome 配置文件,默认情况下选择 Chrome 时,会使用上次启动 Chrome 时的配置文件。
-When configured, BrowserPicker will always use this browser unless a default browser has been configured for that url.
+若想让浏览器选择器能指定配置文件,可为每个配置文件创建一个 “新浏览器” 条目:将程序路径设为 Chrome 可执行文件,并添加命令行参数指定要启动的配置文件,例如:
-> [ ] Always ask when no default is matching url
+- 第一个配置文件:--profile-directory=Default
+- 第二个配置文件:--profile-directory="Profile 1"
+- 第三个配置文件:--profile-directory="Profile 2"
+ 以此类推。
-This option makes it so BrowserPicker will only pick matched default browsers and otherwise show the selection window.
+注意:含空格的参数需用英文双引号(" ")包裹,才能正确传递给 Chrome。
-> [ ] Disable url resolution
+##### Firefox 配置文件
+Firefox 也支持类似的配置文件设置。
-> [ ] Ignore defaults when browser is not running
+### 行为
-When enabled, configured default browsers only apply when they are already running.
+此标签页包含控制 “浏览器选择器” 运行方式的各类设置。
-> [ ] Update order in browser list based on usage
+
-This option will make your list of browsers automatically sorted by how often you pick them.
+> [ ] 关闭透明度
-> [ ] Disallow network activity
+勾选后,浏览器选择器会使用纯色黑色背景,提升文字可读性。
-BrowserPicker may perform DNS and HTTP calls to probe the specified url in order to check if the url redirects elsewhere.
-This option turns this feature off, preventing BrowserPicker to call the network when you launch a url.
+> [ ] 始终显示浏览器选择窗口
-> URL resolution timeout: [_____]
+此选项在浏览器选择窗口中也可设置。启用后,浏览器选择器会始终提示你选择浏览器。
-You may adjust for how long BrowserPicker attempts to resolve an url here.
+> [ ] 当无匹配链接的默认浏览器时,使用:[__v]
-### Defaults
-The defaults tab lets you configure rules to map certain urls to certain browsers.
+配置后,除非为当前链接设置了默认浏览器,否则浏览器选择器会始终使用此处指定的浏览器。
-
+> [ ] 无匹配默认浏览器时始终询问
-##### Match types
-There exists four different match types, but you cannot use Default, that is reserved for use elsewhere.
-The option will eventually get hidden in the interface, but for now it becomes Hostname when selected.
+启用此选项后,浏览器选择器仅会使用匹配的默认浏览器;若无匹配项,则显示选择窗口。
-
+> [ ] 禁用链接解析
+>
+> [ ] 浏览器未运行时忽略默认设置
-###### Hostname match
-The pattern will match the end of the hostname part of the url, ie. `hub.com` would match `https://www.github.com/mortenn/BrowserPicker`, but not `https://example.com/cgi-bin/hub.com`
+启用后,已配置的默认浏览器仅在处于运行状态时才生效。
-###### Prefix match
-The pattern will match the beginning of the url, ie. `https://github.com/mortenn` would match `https://github.com/mortenn/BrowserPicker` but not `https://www.github.com/mortenn/BrowserPicker`
+> [ ] 根据使用情况更新浏览器列表顺序
-###### Regex match
-The pattern is a .NET regular expression and will be executed against the url, see [.NET regular expressions](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions) for details.
+启用后,浏览器列表会根据你的选择频率自动排序。
-##### Browser
-The selected browser will be the one to launch for matched urls.
+> [ ] 禁止网络活动
-
+浏览器选择器可能会通过 DNS 查询和 HTTP 请求探测链接,以检查该链接是否存在重定向。
-### Test defaults
-There is even a handy dandy tool for verifying your settings,
-just paste that url into the big white text box and get instant feedback on the browser selection process:
+勾选此选项可关闭该功能,避免浏览器选择器在打开链接时连接网络。
-
+> 链接解析超时时间:[___]
-### Logging
-BrowserPicker uses ILogger with EventLog support.
+在此处调整浏览器选择器尝试解析链接的最长时间。
-To get detailed logs, please either change appsettings.json or set the environment variable `Logging__EventLog__LogLevel__BrowserPicker` to either `Information` or `Debug`
-By default, only warnings or higher level events get logged.
+### 默认规则
-If you are using the archived version rather than the installer package,
-you will need to run this powershell command before logs will appear:
+此标签页可配置规则,将特定链接与指定浏览器关联。
-```New-EventLog -LogName Application -Source BrowserPicker```
-`
+
+
+#### 匹配类型
+
+共有四种匹配类型,其中 **默认(Default)** 类型为预留选项,暂不可用。该选项最终会从界面中隐藏,目前选择后会自动转为 **主机名(Hostname)** 匹配类型。
+
+
+
+##### 主机名匹配
+
+规则会匹配链接 **主机名** 部分的末尾。
+
+例如,`hub.com` 会匹配 `https://www.github.com/mortenn/BrowserPicker`,但不会匹配 `https://example.com/cgi-bin/hub.com`
+
+##### 前缀匹配
+
+规则会匹配链接的开头。例如,`https://github.com/mortenn` 会匹配 `https://github.com/mortenn/BrowserPicker`,但不会匹配 `https://www.github.com/mortenn/BrowserPicker`
+
+##### 正则表达式匹配
+
+规则使用 .NET 正则表达式,会对整个链接执行匹配。详情可参考 [.NET 正则表达式文档](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions)。
+
+#### 匹配浏览器
+
+选择匹配链接后要启动的浏览器。
+
+
+
+### 测试默认规则
+
+界面提供了便捷的规则验证工具:
+在白色文本框中粘贴链接,即可即时查看浏览器选择结果(验证规则是否生效):
+
+
+
+### 日志
+
+浏览器选择器使用 ILogger 记录日志,并支持事件日志(EventLog)功能。
+
+如需详细日志,可通过以下两种方式操作:
+
+- 修改 appsettings.json 文件
+- 将环境变量 `Logging__EventLog__LogLevel__BrowserPicker` 设置为 **Information(信息级)** 或 **Debug(调试级)**。
+
+默认情况下,仅记录警告(Warning)及更高级别的事件。
+
+若你使用的是压缩包版本(非安装包),需先运行以下 PowerShell 命令,日志才能正常显示:
+`New-EventLog -LogName Application -Source BrowserPicker`
diff --git a/readme_en.md b/readme_en.md
new file mode 100644
index 0000000..7879af7
--- /dev/null
+++ b/readme_en.md
@@ -0,0 +1,244 @@
+# Browser Picker
+
+English | [中文](/readme.md)
+
+A default browser replacement for windows to let you pick your preferred browser on the fly or in accordance with your own rules.
+
+
+
+You can easily configure it to use Firefox for `github.com` and `slashdot.org`, but leave Edge to handle `microsoft.com`
+and even let Internet Explorer handle that old internal LOB app you'd rather not use but must.
+
+## Installation
+
+You can find the latest release on [github](https://github.com/mortenn/BrowserPicker/releases).
+
+### Default browser
+
+To enable the browser picker window, you need to set Browser Picker as your default browser.
+
+### .NET Runtime dependent binary
+
+BrowserPicker.msi and Dependent.zip are JIT compiled and require you have the [.NET 9.0 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) installed.
+Direct links: [64bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer), [32bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer).
+
+#### Native image generation
+
+As part of installation, `BrowserPicker.msi` will execute ngen to build a native image for your computer.
+This significantly enhances launch times for the executable.
+If you prefer the bundle, you may run `ngen install BrowserPicker.exe` to get the same benefit.
+
+### Portable binary
+
+If you do not want to have the .net runtime installed on your computer, you may download the Portable version, which includes the runtime.
+
+`BrowserPicker-Portable.msi` and `Portable.zip` contain a win-x64 binary executable with embedded .NET runtime.
+This makes the file sizes quite significantly larger, but you do not need an additional runtime to use these.
+
+### Signing certificate
+
+To avoid warnings about unknown publisher, you may [import](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates) the provided certificate into your certificate store first.
+
+### Manual steps
+
+You need to open the settings app from the start menu, navigate into Apps, select Default apps, then change the Web browser to BrowserPicker.
+Please ensure BrowserPicker can be started before you do this.
+
+## Usage
+
+When you open a link outside a browser, one of these things will happen, in order:
+
+1. If you have previously selected `Always ask`, the browser selection window is shown.
+2. If you have set up a configuration rule matching the url being opened, the selected browser will be launched with the url.
+3. If you only have one browser running, the link will be opened in that browser.
+4. If you have configured a default browser, it will be asked to open the url.
+5. Otherwise, you will be presented with a simple window asking you which browser you want to use.
+
+The url is shown at the top of the window, and if it matches a list of known url shorteners, BrowserPicker will expand this address and show you the real one after a short delay.
+If you do not want BrowserPicker to perform this operation (it will call the internet), you may disable this feature in the settings.
+
+### Copy url
+
+You can click the clipboard icon at the top to copy the url without opening it
+
+### Edit url
+
+You can click the pencil icon at the top of the window to edit or copy the url before visiting it or cancelling:
+
+
+
+
+### Keyboard shortcuts
+
+When this window is open and has focus, you can use the following keyboard shortcuts:
+
+`[enter]` or `[1]` Pick the first browser in the list
+
+`[2]` Pick the second browser in the list
+
+...
+
+`[9]` Pick the ninth browser in the list
+
+If you keep `[alt]` pressed while hitting one of these, the browser will be opened in privacy mode.
+
+`[esc]` Abort and close window
+
+If you click outside the window such that it loses focus, it will close without opening the url in any browser.
+
+Each browser that supports it, has a blue shield button on the right side.
+Browsers currently supporting privacy mode are firefox, internet explorer, chrome, and edge.
+
+Currently running browsers will have their name in bold, whilst browsers not currently running will have their names in cursive.
+
+As you use the application, it keeps count of how many times you selected each browser. This information is used to show you your browsers in your preferred order automatically.
+
+At the bottom of the window, there is a checkbox to enable "always ask" and a hyperlink to open settings.
+
+## Settings
+
+By simply launching BrowserPicker from the start menu or double clicking the `BrowserPicker.exe` file, you will be presented with a GUI to configure the behaviour.
+The configuration is saved in the Windows registry: `HKEY_CURRENT_USER\Software\BrowserPicker`, if you ever need to manually edit it or make a backup.
+
+
+
+### Browsers
+
+The browser list shows you the browsers BrowserPicker has been configured or detected to use.
+
+#### Disabling browsers
+
+You can disable a browser by clicking `Enabled`, this will hide the browser from the selection list.
+
+
+
+#### Removing browsers
+
+If you click the red X, you may remove a browser.
+
+Do note that if it was automatically detected, it will return to the list the next time auto configuration is performed.
+
+#### Automatic configuration
+
+The `Refresh broser list` function gets automatically executed in the background when you use BrowserPicker.
+This helps it discovering newly installed browsers, in case a new browser has been installed,
+
+#### Manually adding browser
+
+You may click the hyperlink `Add browser` to open a popup where you may manually add a browser that has not been detected - or some other tool that isn't a browser.
+
+You can click the buttons behind the input boxes to bring up the file picker interface of windows to select the executable or icon file you want to use.
+
+
+
+
+
+
+If you browse for the command first, the application will assume the executable also has an icon, and prefill that box.
+
+The name of the application will be attempted to be set automatically based on information in the executable.
+
+##### Chrome profiles
+
+Tip for Chrome Users: If you are using multiple Chrome profiles, by default if you choose Chrome it will launch in the last
+profile you launched Chrome with. To make it possibe for browser picker to select a profile you can create a new browser
+for each profile, set the program to the chrome executable, and add a command line argument to specify which profile to launch:
+`--profile-directory=Default` for the first profile, `--profile-directory="Profile 1"` for the second profile, and so on.
+
+Please note that arguments with spaces do require "" around them to be properly passed to chrome.
+
+##### Firefox profiles
+
+Similar configuration should be possible for firefox.
+
+### Behaviour
+
+This tab contains various settings that govern how BrowserPicker operates.
+
+
+
+> [ ] Turn off transparency
+
+This will make BrowserPicker have a simple black background, to help with legibility
+
+> [ ] Always show browser selection window
+
+This option is also available on the browser selection window. When enabled, BrowserPicker will always ask the user to make a choice.
+
+> [ ] When no default is configured matching the url, use: [__v]
+
+When configured, BrowserPicker will always use this browser unless a default browser has been configured for that url.
+
+> [ ] Always ask when no default is matching url
+
+This option makes it so BrowserPicker will only pick matched default browsers and otherwise show the selection window.
+
+> [ ] Disable url resolution
+>
+> [ ] Ignore defaults when browser is not running
+
+When enabled, configured default browsers only apply when they are already running.
+
+> [ ] Update order in browser list based on usage
+
+This option will make your list of browsers automatically sorted by how often you pick them.
+
+> [ ] Disallow network activity
+
+BrowserPicker may perform DNS and HTTP calls to probe the specified url in order to check if the url redirects elsewhere.
+This option turns this feature off, preventing BrowserPicker to call the network when you launch a url.
+
+> URL resolution timeout: [_____]
+
+You may adjust for how long BrowserPicker attempts to resolve an url here.
+
+### Defaults
+
+The defaults tab lets you configure rules to map certain urls to certain browsers.
+
+
+
+#### Match types
+
+There exists four different match types, but you cannot use Default, that is reserved for use elsewhere.
+The option will eventually get hidden in the interface, but for now it becomes Hostname when selected.
+
+
+
+##### Hostname match
+
+The pattern will match the end of the hostname part of the url, ie. `hub.com` would match `https://www.github.com/mortenn/BrowserPicker`, but not `https://example.com/cgi-bin/hub.com`
+
+##### Prefix match
+
+The pattern will match the beginning of the url, ie. `https://github.com/mortenn` would match `https://github.com/mortenn/BrowserPicker` but not `https://www.github.com/mortenn/BrowserPicker`
+
+##### Regex match
+
+The pattern is a .NET regular expression and will be executed against the url, see [.NET regular expressions](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions) for details.
+
+#### Browser
+
+The selected browser will be the one to launch for matched urls.
+
+
+
+### Test defaults
+
+There is even a handy dandy tool for verifying your settings,
+just paste that url into the big white text box and get instant feedback on the browser selection process:
+
+
+
+### Logging
+
+BrowserPicker uses ILogger with EventLog support.
+
+To get detailed logs, please either change appsettings.json or set the environment variable `Logging__EventLog__LogLevel__BrowserPicker` to either `Information` or `Debug`
+By default, only warnings or higher level events get logged.
+
+If you are using the archived version rather than the installer package,
+you will need to run this powershell command before logs will appear:
+
+```New-EventLog -LogName Application -Source BrowserPicker```
+`
From 08540840612c51a44afdf28c7d4eef36b23948b4 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Sat, 29 Nov 2025 23:29:25 +0800
Subject: [PATCH 02/19] interface i18n
---
.gitignore | 1 +
readme.md | 29 +++---
src/BrowserPicker.App/View/BrowserEditor.xaml | 28 +++---
src/BrowserPicker.App/View/BrowserList.xaml | 11 +--
.../View/BrowserList.xaml.cs | 5 +
src/BrowserPicker.App/View/Configuration.xaml | 98 +++++++++----------
.../View/ExceptionReport.xaml.cs | 5 +
src/BrowserPicker.App/View/MainWindow.xaml.cs | 5 +
.../ViewModel/ConfigurationViewModel.cs | 4 +-
9 files changed, 100 insertions(+), 86 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0c18523..38bc95f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ obj
*.user
packages/
/.history
+*.pubxml
diff --git a/readme.md b/readme.md
index ea86b72..62bc931 100644
--- a/readme.md
+++ b/readme.md
@@ -10,7 +10,7 @@
## 安装
-你可在 [GitHub](https://github.com/XTsat/BrowserPicker/releases) 上获取最新版本。
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker_zh/releases) 上获取最新版本。
### 设置默认浏览器
@@ -18,7 +18,8 @@
### 依赖 .NET 运行时的安装包
-BrowserPicker.msi 和 Dependent.zip 为即时编译(JIT)版本,需安装 [.NET 9.0 桌面运行时](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) 才能使用。直接下载链接:[64 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer)、[32 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer)。
+BrowserPicker.msi 和 Dependent.zip 为即时编译(JIT)版本,需安装 [.NET 9.0 桌面运行时](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) 才能使用。
+直接下载链接:[64 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer)、[32 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer)。
#### 原生镜像生成
@@ -127,15 +128,15 @@ BrowserPicker.msi 和 Dependent.zip 为即时编译(JIT)版本,需安装 [
应用名称会尝试根据可执行文件中的信息自动设置。
-##### Chrome 配置文件
+##### chromium 配置文件
-Chrome 用户提示:若你使用多个 Chrome 配置文件,默认情况下选择 Chrome 时,会使用上次启动 Chrome 时的配置文件。
+chromium 内核浏览器用户提示:若你使用多个配置文件,默认情况下选择浏览器时,会使用上次启动时的配置文件。
-若想让浏览器选择器能指定配置文件,可为每个配置文件创建一个 “新浏览器” 条目:将程序路径设为 Chrome 可执行文件,并添加命令行参数指定要启动的配置文件,例如:
+若想让浏览器选择器能指定配置文件,可为每个配置文件创建一个 “新浏览器” 条目:将程序路径设为 Chrome / Edge 可执行文件,并添加命令行参数指定要启动的配置文件,例如:
-- 第一个配置文件:--profile-directory=Default
-- 第二个配置文件:--profile-directory="Profile 1"
-- 第三个配置文件:--profile-directory="Profile 2"
+- 第一个配置文件:`--profile-directory=Default`
+- 第二个配置文件:`--profile-directory="Profile 1"`
+- 第三个配置文件:`--profile-directory="Profile 2"`
以此类推。
注意:含空格的参数需用英文双引号(" ")包裹,才能正确传递给 Chrome。
@@ -150,9 +151,9 @@ Firefox 也支持类似的配置文件设置。

-> [ ] 关闭透明度
+> [ ] 切换纯黑边框
-勾选后,浏览器选择器会使用纯色黑色背景,提升文字可读性。
+勾选后,浏览器选择器会使用纯色黑色边框。
> [ ] 始终显示浏览器选择窗口
@@ -162,7 +163,7 @@ Firefox 也支持类似的配置文件设置。
配置后,除非为当前链接设置了默认浏览器,否则浏览器选择器会始终使用此处指定的浏览器。
-> [ ] 无匹配默认浏览器时始终询问
+> [ ] 即使浏览器未运行也使用默认设置
启用此选项后,浏览器选择器仅会使用匹配的默认浏览器;若无匹配项,则显示选择窗口。
@@ -198,17 +199,17 @@ Firefox 也支持类似的配置文件设置。

-##### 主机名匹配
+##### 主机名匹配(Hostname match)
规则会匹配链接 **主机名** 部分的末尾。
例如,`hub.com` 会匹配 `https://www.github.com/mortenn/BrowserPicker`,但不会匹配 `https://example.com/cgi-bin/hub.com`
-##### 前缀匹配
+##### 前缀匹配(Prefix match)
规则会匹配链接的开头。例如,`https://github.com/mortenn` 会匹配 `https://github.com/mortenn/BrowserPicker`,但不会匹配 `https://www.github.com/mortenn/BrowserPicker`
-##### 正则表达式匹配
+##### 正则表达式匹配(Regex match)
规则使用 .NET 正则表达式,会对整个链接执行匹配。详情可参考 [.NET 正则表达式文档](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions)。
diff --git a/src/BrowserPicker.App/View/BrowserEditor.xaml b/src/BrowserPicker.App/View/BrowserEditor.xaml
index 5f05eeb..e056813 100644
--- a/src/BrowserPicker.App/View/BrowserEditor.xaml
+++ b/src/BrowserPicker.App/View/BrowserEditor.xaml
@@ -46,35 +46,35 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
- Welcome to Browser Picker, hope you enjoy my little app!
- I've gone ahead and opened up the settings window,
- so you can have a look around before you get started :)
+ 欢迎使用浏览器选择器,希望你喜欢这个应用!
+ 我已经打开了设置窗口,
+ 这样你就可以开始前先看看周围啦 :)
- Please give it a ⭐ on github, so you will get notified when a new release is made.
+ 请在 GitHub 上给它点个 star ⭐,这样当有新版本发布时你就会收到通知。
- Should you run into any kind of trouble or get an idea,
- please visit github.com/mortenn/BrowserPicker and file an issue!
+ 如果您遇到任何问题或有了什么想法,
+ 请访问 github.com/XTsat/BrowserPicker_zh 提交问题!
- Be seeing you!
+ 回头见!
- This message will self destruct in 10 seconds
+ 这条消息将在 10 秒后自动销毁
-
+
@@ -177,11 +177,11 @@
@@ -191,12 +191,12 @@
-
+
-
+
@@ -207,20 +207,20 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
@@ -265,21 +265,21 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -367,19 +367,19 @@
-
+
-
+
-
+
-
+
@@ -387,16 +387,16 @@
-
-
-
+
+
+
-
+
@@ -408,13 +408,13 @@
-
-
-
+
+
+
-
+
-
+
@@ -424,8 +424,8 @@
-
-
+
+
@@ -461,7 +461,7 @@
-
+
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml.cs b/src/BrowserPicker.App/View/ExceptionReport.xaml.cs
index 31421aa..0c559e8 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml.cs
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml.cs
@@ -9,4 +9,9 @@ public ExceptionReport()
{
InitializeComponent();
}
+
+ private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+
+ }
}
diff --git a/src/BrowserPicker.App/View/MainWindow.xaml.cs b/src/BrowserPicker.App/View/MainWindow.xaml.cs
index 11006bc..c95ac03 100644
--- a/src/BrowserPicker.App/View/MainWindow.xaml.cs
+++ b/src/BrowserPicker.App/View/MainWindow.xaml.cs
@@ -112,4 +112,9 @@ private void DragWindow(object sender, MouseButtonEventArgs args)
{
DragMove();
}
+
+ private void BrowserList_Loaded(object sender, RoutedEventArgs e)
+ {
+
+ }
}
diff --git a/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs b/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
index bf20363..d4c5930 100644
--- a/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
+++ b/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
@@ -500,7 +500,7 @@ public string TestDefaultsResult
{
get
{
- return ParentViewModel.GetBrowserToLaunchForUrl(test_defaults_url) ?? "User choice";
+ return ParentViewModel.GetBrowserToLaunchForUrl(test_defaults_url) ?? "用户选择";
}
}
@@ -508,7 +508,7 @@ public string TestActualResult
{
get
{
- return ParentViewModel.GetBrowserToLaunch(test_defaults_url)?.Model.Name ?? "User choice";
+ return ParentViewModel.GetBrowserToLaunch(test_defaults_url)?.Model.Name ?? "用户选择";
}
}
}
From 841716e25b96411502dab35e80ac50b052f62440 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Sun, 30 Nov 2025 00:01:38 +0800
Subject: [PATCH 03/19] workflow dispatch
---
.github/workflows/ci.yml | 1 +
.github/workflows/release.yml | 1 +
2 files changed, 2 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0195fa6..aa0dbf7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,6 +3,7 @@ name: CI
on:
push:
branches: [ "main" ]
+ workflow_dispatch:
jobs:
prepare:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e80aa27..818f724 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,6 +4,7 @@ on:
push:
tags:
- "v*.*.*"
+ workflow_dispatch:
jobs:
From 73af0a19d13ed0648caf4286bd0488da0cc1f84a Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Sun, 30 Nov 2025 00:26:27 +0800
Subject: [PATCH 04/19] choose version
---
choose_version.md | 20 ++++++++++++++++++++
readme.md | 21 +--------------------
2 files changed, 21 insertions(+), 20 deletions(-)
create mode 100644 choose_version.md
diff --git a/choose_version.md b/choose_version.md
new file mode 100644
index 0000000..64892a7
--- /dev/null
+++ b/choose_version.md
@@ -0,0 +1,20 @@
+# 我应该选择哪个版本?
+
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker_zh/releases) 上获取最新版本
+
+## 依赖 .NET 运行时的安装包
+
+`NoDeps` 版本为即时编译(JIT)版本,需安装 [.NET 9.0 桌面运行时](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) 才能使用。
+直接下载链接:[64 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer)、[32 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer)。
+
+## 便携版安装包
+
+`Portable` 版本包含适用于 win-x64 系统的可执行文件。可以不用安装直接使用。
+
+## 原生镜像生成
+
+安装过程中,`BrowserPicker.msi` 会执行 ngen 工具为你的电脑生成原生镜像,这能显著提升可执行文件的启动速度。若你选择压缩包版本,可运行命令 `ngen install BrowserPicker.exe` 以获得相同优化效果。
+
+
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 62bc931..7c37700 100644
--- a/readme.md
+++ b/readme.md
@@ -16,26 +16,7 @@
要启用浏览器选择器窗口,需将 “浏览器选择器” 设为系统默认浏览器。
-### 依赖 .NET 运行时的安装包
-
-BrowserPicker.msi 和 Dependent.zip 为即时编译(JIT)版本,需安装 [.NET 9.0 桌面运行时](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) 才能使用。
-直接下载链接:[64 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer)、[32 位系统](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer)。
-
-#### 原生镜像生成
-
-安装过程中,`BrowserPicker.msi` 会执行 ngen 工具为你的电脑生成原生镜像,这能显著提升可执行文件的启动速度。若你选择压缩包版本,可运行命令 `ngen install BrowserPicker.exe` 以获得相同优化效果。
-
-### 便携版安装包
-
-若不想在电脑上安装 .NET 运行时,可下载包含运行时的便携版。
-
-`BrowserPicker-Portable.msi` 和 `Portable.zip` 包含适用于 win-x64 系统的可执行文件,且已嵌入 .NET 运行时。该版本文件体积会显著增大,但无需额外安装运行时即可使用。
-
-### 签名证书
-
-为避免 “未知发布者” 警告,可先将提供的证书导入你的证书存储区,导入方法参考 [此处](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates)。
-
-### 手动设置步骤
+手动设置步骤:
1.从开始菜单打开 “设置” 应用;
2.进入 “应用” 选项;
From 1fe5c5211126c39eecec0fa5961f054e5a233714 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Sun, 30 Nov 2025 01:08:16 +0800
Subject: [PATCH 05/19] release version
fix text
---
.github/workflows/release.yml | 160 ++++++++++----------
src/BrowserPicker.App/View/BrowserList.xaml | 6 +-
2 files changed, 83 insertions(+), 83 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 818f724..e0fbcdc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -3,32 +3,30 @@ name: Release
on:
push:
tags:
- - "v*.*.*"
+ - "v*.*.*.*"
workflow_dispatch:
jobs:
-
prepare:
-
runs-on: ubuntu-latest
steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Determine version
- id: version
- uses: paulhatch/semantic-version@v5.4.0
- with:
- version_format: "${major}.${minor}.${patch}"
-
- - name: Upload certificate
- uses: actions/upload-artifact@v4
- with:
- name: dist
- path: dist/code_signing.cer
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Determine version
+ id: version
+ uses: paulhatch/semantic-version@v5.4.0
+ with:
+ version_format: "${major}.${minor}.${patch}"
+
+ - name: Upload certificate
+ uses: actions/upload-artifact@v4
+ with:
+ name: dist
+ path: dist/code_signing.cer
outputs:
version: ${{ steps.version.outputs.version}}
@@ -38,76 +36,78 @@ jobs:
needs: prepare
steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Build runtime dependent binaries
- uses: "./.github/template/build-signed"
- with:
- dotnet_args: "-p VersionPrefix=${{ needs.prepare.outputs.version }}"
- package_project: dist/Dependent/Dependent.wixproj
- package_version: ${{ needs.prepare.outputs.version }}
- package: dist\Dependent\bin\Release\BrowserPicker.msi
- package_name: DependentSetup-${{ needs.prepare.outputs.version }}-Release
- package_path: dist/Dependent/bin/Release
- binaries: |
- src\BrowserPicker.App\bin\Release\net9.0-windows\publish\BrowserPicker*.dll src\BrowserPicker.App\bin\Release\net9.0-windows\publish\BrowserPicker*.exe
- bundle_name: Dependent-${{ needs.prepare.outputs.version }}-Release
- bundle_path: src/BrowserPicker.App/bin/Release/net9.0-windows/publish
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Build runtime dependent binaries
+ uses: "./.github/template/build-signed"
+ with:
+ dotnet_args: "-p VersionPrefix=${{ needs.prepare.outputs.version }}"
+ package_project: dist/Dependent/Dependent.wixproj
+ package_version: ${{ needs.prepare.outputs.version }}
+ package: dist\Dependent\bin\Release\BrowserPicker.msi
+ package_name: DependentSetup-${{ needs.prepare.outputs.version }}-Release
+ package_path: dist/Dependent/bin/Release
+ binaries: |
+ src\BrowserPicker.App\bin\Release\net9.0-windows\publish\BrowserPicker*.dll src\BrowserPicker.App\bin\Release\net9.0-windows\publish\BrowserPicker*.exe
+ bundle_name: Dependent-${{ needs.prepare.outputs.version }}-Release
+ bundle_path: src/BrowserPicker.App/bin/Release/net9.0-windows/publish
portable:
runs-on: windows-latest
needs: prepare
steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Build runtime independent binaries
- uses: "./.github/template/build-signed"
- with:
- dotnet_args: "-p VersionPrefix=${{ needs.prepare.outputs.version }} -r win-x64 -p:PublishSingleFile=true"
- package_project: dist/Portable/Portable.wixproj
- package_version: ${{ needs.prepare.outputs.version }}
- package: dist\Portable\bin\Release\BrowserPicker-Portable.msi
- package_name: PortableSetup-${{ needs.prepare.outputs.version }}-Release
- package_path: dist/Portable/bin/Release
- binaries: src\BrowserPicker.App\bin\Release\net9.0-windows\win-x64\publish\BrowserPicker.exe
- bundle_name: Portable-${{ needs.prepare.outputs.version }}-Release
- bundle_path: src/BrowserPicker.App/bin/Release/net9.0-windows/win-x64/publish
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Build runtime independent binaries
+ uses: "./.github/template/build-signed"
+ with:
+ dotnet_args: "-p VersionPrefix=${{ needs.prepare.outputs.version }} -r win-x64 -p:PublishSingleFile=true"
+ package_project: dist/Portable/Portable.wixproj
+ package_version: ${{ needs.prepare.outputs.version }}
+ package: dist\Portable\bin\Release\BrowserPicker-Portable.msi
+ package_name: PortableSetup-${{ needs.prepare.outputs.version }}-Release
+ package_path: dist/Portable/bin/Release
+ binaries: src\BrowserPicker.App\bin\Release\net9.0-windows\win-x64\publish\BrowserPicker.exe
+ bundle_name: Portable-${{ needs.prepare.outputs.version }}-Release
+ bundle_path: src/BrowserPicker.App/bin/Release/net9.0-windows/win-x64/publish
publish:
runs-on: ubuntu-latest
needs: [prepare, dependent, portable]
steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Retrieve artifacts
- uses: actions/download-artifact@v4
-
- - name: Package bundles
- run: |
- rm -rf *.zip
- for bundle in Dependent Portable; do
- (cd $bundle-${{ needs.prepare.outputs.version }}-Release; zip -r ../$bundle.zip *)
- done
-
- - name: Release
- uses: softprops/action-gh-release@v2
- with:
- generate_release_notes: true
- draft: true
- prerelease: true
- files: |
- DependentSetup-${{ needs.prepare.outputs.version }}-Release/BrowserPicker.msi
- PortableSetup-${{ needs.prepare.outputs.version }}-Release/BrowserPicker-Portable.msi
- Dependent.zip
- Portable.zip
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Retrieve artifacts
+ uses: actions/download-artifact@v4
+
+ - name: Package bundles
+ run: |
+ rm -rf *.zip
+ for bundle in Dependent Portable; do
+ (cd $bundle-${{ needs.prepare.outputs.version }}-Release; zip -r ../$bundle.zip *)
+ done
+
+ - name: Release
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: ${{ github.ref_name }} # 显式指定Tag名称
+ name: Release ${{ github.ref_name }} # 可选:设置Release标题
+ generate_release_notes: true
+ draft: true
+ prerelease: true
+ files: |
+ DependentSetup-${{ needs.prepare.outputs.version }}-Release/BrowserPicker.msi
+ PortableSetup-${{ needs.prepare.outputs.version }}-Release/BrowserPicker-Portable.msi
+ Dependent.zip
+ Portable.zip
diff --git a/src/BrowserPicker.App/View/BrowserList.xaml b/src/BrowserPicker.App/View/BrowserList.xaml
index 875e59c..2dc7d98 100644
--- a/src/BrowserPicker.App/View/BrowserList.xaml
+++ b/src/BrowserPicker.App/View/BrowserList.xaml
@@ -23,7 +23,7 @@
-
+
-
+
-
+
@@ -445,7 +445,7 @@
-
+
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml b/src/BrowserPicker.App/View/ExceptionReport.xaml
index 960716b..fef3cd0 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml
@@ -7,7 +7,7 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModel:ExceptionViewModel,d:IsDesignTimeCreatable=True}"
- Title="An unhandled exception has occurred" SizeToContent="WidthAndHeight">
+ Title="发生了一个未处理的异常" SizeToContent="WidthAndHeight">
@@ -74,16 +74,16 @@
-
-
-
+
+
+
-
-
+
+
diff --git a/src/BrowserPicker.App/View/LoadingWindow.xaml b/src/BrowserPicker.App/View/LoadingWindow.xaml
index cafbee9..e213bac 100644
--- a/src/BrowserPicker.App/View/LoadingWindow.xaml
+++ b/src/BrowserPicker.App/View/LoadingWindow.xaml
@@ -23,7 +23,7 @@
- Scanning URL...
+ 扫描 URL...
diff --git a/src/BrowserPicker/WellKnownBrowsers.cs b/src/BrowserPicker/WellKnownBrowsers.cs
index 558a658..8e55653 100644
--- a/src/BrowserPicker/WellKnownBrowsers.cs
+++ b/src/BrowserPicker/WellKnownBrowsers.cs
@@ -79,7 +79,7 @@ public sealed class Chrome : IWellKnownBrowser
public string PrivacyArgs => "--incognito ";
- public string PrivacyMode => "Open incognito";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class ChromeDevEdition : IWellKnownBrowser
@@ -94,7 +94,7 @@ public sealed class ChromeDevEdition : IWellKnownBrowser
public string PrivacyArgs => "--incognito ";
- public string PrivacyMode => "Open incognito";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class MicrosoftEdge : IWellKnownBrowser
@@ -109,7 +109,7 @@ public sealed class MicrosoftEdge : IWellKnownBrowser
public string PrivacyArgs => "-inprivate ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class Edge : IWellKnownBrowser
@@ -124,7 +124,7 @@ public sealed class Edge : IWellKnownBrowser
public string PrivacyArgs => "-private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class InternetExplorer : IWellKnownBrowser
@@ -139,7 +139,7 @@ public sealed class InternetExplorer : IWellKnownBrowser
public string PrivacyArgs => "-private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class OperaStable : IWellKnownBrowser
@@ -154,5 +154,5 @@ public sealed class OperaStable : IWellKnownBrowser
public string PrivacyArgs => "--private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
\ No newline at end of file
From 79ec561a185c2486b53a79652b37f25693d540db Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Mon, 1 Dec 2025 02:39:42 +0800
Subject: [PATCH 08/19] interface i18n
---
readme.md | 4 ++--
src/BrowserPicker.App/View/BrowserEditor.xaml | 4 ++--
src/BrowserPicker.App/View/Configuration.xaml | 6 +++---
src/BrowserPicker.App/View/ExceptionReport.xaml | 12 ++++++------
src/BrowserPicker.App/View/LoadingWindow.xaml | 2 +-
src/BrowserPicker.Windows/AppSettings.cs | 10 +++++-----
src/BrowserPicker/WellKnownBrowsers.cs | 12 ++++++------
7 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/readme.md b/readme.md
index 7c37700..77c43dd 100644
--- a/readme.md
+++ b/readme.md
@@ -132,9 +132,9 @@ Firefox 也支持类似的配置文件设置。

-> [ ] 切换纯黑边框
+> [ ] 使用纯黑背景
-勾选后,浏览器选择器会使用纯色黑色边框。
+勾选后,浏览器选择器会使用纯色黑色背景。
> [ ] 始终显示浏览器选择窗口
diff --git a/src/BrowserPicker.App/View/BrowserEditor.xaml b/src/BrowserPicker.App/View/BrowserEditor.xaml
index e056813..a536967 100644
--- a/src/BrowserPicker.App/View/BrowserEditor.xaml
+++ b/src/BrowserPicker.App/View/BrowserEditor.xaml
@@ -66,10 +66,10 @@
-
+
-
+
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index 17b3426..75ee1c6 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -88,7 +88,7 @@
-
+
-
+
@@ -445,7 +445,7 @@
-
+
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml b/src/BrowserPicker.App/View/ExceptionReport.xaml
index 960716b..fef3cd0 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml
@@ -7,7 +7,7 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModel:ExceptionViewModel,d:IsDesignTimeCreatable=True}"
- Title="An unhandled exception has occurred" SizeToContent="WidthAndHeight">
+ Title="发生了一个未处理的异常" SizeToContent="WidthAndHeight">
@@ -74,16 +74,16 @@
-
-
-
+
+
+
-
-
+
+
diff --git a/src/BrowserPicker.App/View/LoadingWindow.xaml b/src/BrowserPicker.App/View/LoadingWindow.xaml
index cafbee9..e213bac 100644
--- a/src/BrowserPicker.App/View/LoadingWindow.xaml
+++ b/src/BrowserPicker.App/View/LoadingWindow.xaml
@@ -23,7 +23,7 @@
- Scanning URL...
+ 扫描 URL...
diff --git a/src/BrowserPicker.Windows/AppSettings.cs b/src/BrowserPicker.Windows/AppSettings.cs
index d9a1215..46f8f4d 100644
--- a/src/BrowserPicker.Windows/AppSettings.cs
+++ b/src/BrowserPicker.Windows/AppSettings.cs
@@ -301,11 +301,11 @@ public async Task SaveAsync(string fileName)
await Task.CompletedTask;
await using var fileStream = File.Open(fileName, FileMode.Create, FileAccess.Write);
await JsonSerializer.SerializeAsync(fileStream, settings, JsonOptions);
- BackupLog += $"Exported configuration to {fileName}\n";
+ BackupLog += $"配置导出至 {fileName}\n";
}
catch(Exception e)
{
- BackupLog += $"Unable to parse backup file: {e.Message}";
+ BackupLog += $"无法解析备份文件: {e.Message}";
}
}
@@ -320,12 +320,12 @@ public async Task LoadAsync(string fileName)
}
catch (Exception ex)
{
- BackupLog += $"Unable to parse backup file: {ex.Message}";
+ BackupLog += $"无法解析备份文件: {ex.Message}";
return;
}
if (settings == null)
{
- BackupLog += "Unable to load backup";
+ BackupLog += "无法加载备份";
return;
}
@@ -334,7 +334,7 @@ public async Task LoadAsync(string fileName)
UpdateDefaults(settings.Defaults);
UpdateKeybinds(settings.KeyBindings);
- BackupLog += $"Imported configuration from {fileName}\n";
+ BackupLog += $"导入配置自 {fileName}\n";
}
private void UpdateSettings(SerializableSettings settings)
diff --git a/src/BrowserPicker/WellKnownBrowsers.cs b/src/BrowserPicker/WellKnownBrowsers.cs
index 558a658..8e55653 100644
--- a/src/BrowserPicker/WellKnownBrowsers.cs
+++ b/src/BrowserPicker/WellKnownBrowsers.cs
@@ -79,7 +79,7 @@ public sealed class Chrome : IWellKnownBrowser
public string PrivacyArgs => "--incognito ";
- public string PrivacyMode => "Open incognito";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class ChromeDevEdition : IWellKnownBrowser
@@ -94,7 +94,7 @@ public sealed class ChromeDevEdition : IWellKnownBrowser
public string PrivacyArgs => "--incognito ";
- public string PrivacyMode => "Open incognito";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class MicrosoftEdge : IWellKnownBrowser
@@ -109,7 +109,7 @@ public sealed class MicrosoftEdge : IWellKnownBrowser
public string PrivacyArgs => "-inprivate ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class Edge : IWellKnownBrowser
@@ -124,7 +124,7 @@ public sealed class Edge : IWellKnownBrowser
public string PrivacyArgs => "-private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class InternetExplorer : IWellKnownBrowser
@@ -139,7 +139,7 @@ public sealed class InternetExplorer : IWellKnownBrowser
public string PrivacyArgs => "-private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
public sealed class OperaStable : IWellKnownBrowser
@@ -154,5 +154,5 @@ public sealed class OperaStable : IWellKnownBrowser
public string PrivacyArgs => "--private ";
- public string PrivacyMode => "Open in private mode";
+ public string PrivacyMode => "无痕模式打开";
}
\ No newline at end of file
From f7d919fa1af92d8e8a0f6f13bb48fab7c713e0db Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Mon, 1 Dec 2025 10:11:13 +0800
Subject: [PATCH 09/19] defaultapps
---
src/BrowserPicker.App/View/Configuration.xaml | 1 +
src/BrowserPicker.App/View/Configuration.xaml.cs | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index 75ee1c6..cd7e653 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -269,6 +269,7 @@
+
diff --git a/src/BrowserPicker.App/View/Configuration.xaml.cs b/src/BrowserPicker.App/View/Configuration.xaml.cs
index a816cc1..33ff26e 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml.cs
+++ b/src/BrowserPicker.App/View/Configuration.xaml.cs
@@ -1,4 +1,8 @@
-namespace BrowserPicker.View;
+using System;
+using System.Diagnostics;
+using System.Windows;
+
+namespace BrowserPicker.View;
///
/// Interaction logic for Configuration.xaml
@@ -14,4 +18,12 @@ private void CheckBox_Checked(object sender, System.Windows.RoutedEventArgs e)
{
}
+ private void OpenDefaultAppsSettings_Click(object sender, RoutedEventArgs e)
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = "ms-settings:defaultapps",
+ UseShellExecute = true
+ });
+ }
}
From 9fabe6aad523ff29545f254c0eae5eabf11d23ff Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Mon, 1 Dec 2025 14:19:18 +0800
Subject: [PATCH 10/19] quick set
---
src/BrowserPicker.App/View/Configuration.xaml | 22 +-
.../View/Configuration.xaml.cs | 502 +++++++++++++++++-
2 files changed, 518 insertions(+), 6 deletions(-)
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index cd7e653..648237f 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -220,7 +220,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/BrowserList.xaml b/src/BrowserPicker.App/View/BrowserList.xaml
index 2dc7d98..05df4a9 100644
--- a/src/BrowserPicker.App/View/BrowserList.xaml
+++ b/src/BrowserPicker.App/View/BrowserList.xaml
@@ -1,239 +1,330 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 📌
-
-
-
-
-
- 📋
-
-
-
-
-
- ✏
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ✔️
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 📌
+
+
+
+
+
+ 📋
+
+
+
+
+
+ ✏
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ✔️
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index 648237f..c2f8c16 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -1,490 +1,695 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 欢迎使用浏览器选择器,希望你喜欢这个应用!
- 我已经打开了设置窗口,
- 这样你就可以开始前先看看周围啦 :)
-
-
- 请在 GitHub 上给它点个 star ⭐,这样当有新版本发布时你就会收到通知。
-
-
- 如果您遇到任何问题或有了什么想法,
- 请访问 github.com/XTsat/BrowserPicker_zh 提交问题!
-
- 回头见!
-
-
- 这条消息将在 10 秒后自动销毁
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 🔼
- 🔽
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "{x:Static properties:i18n.NameWelcomeText1}"
+ "{x:Static properties:i18n.NameWelcomeText2}"
+ "{x:Static properties:i18n.NameWelcomeText3}"
+
+ "{x:Static properties:i18n.NameWelcomeText4}"
+
+ "{x:Static properties:i18n.NameWelcomeText5}"
+ "{x:Static properties:i18n.NameWelcomeText6}""{x:Static properties:i18n.NameWelcomeText7}"
+ "{x:Static properties:i18n.NameWelcomeText8}"
+
+ "{x:Static properties:i18n.NameWelcomeText9}"
+
+ "{x:Static properties:i18n.NameWelcomeText10}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 🔼
+ 🔽
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml b/src/BrowserPicker.App/View/ExceptionReport.xaml
index fef3cd0..5bf8c9b 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml
@@ -1,89 +1,113 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/LoadingWindow.xaml b/src/BrowserPicker.App/View/LoadingWindow.xaml
index e213bac..3beedc0 100644
--- a/src/BrowserPicker.App/View/LoadingWindow.xaml
+++ b/src/BrowserPicker.App/View/LoadingWindow.xaml
@@ -1,30 +1,51 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- 扫描 URL...
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/MainWindow.xaml b/src/BrowserPicker.App/View/MainWindow.xaml
index d0c4361..f0d8ac5 100644
--- a/src/BrowserPicker.App/View/MainWindow.xaml
+++ b/src/BrowserPicker.App/View/MainWindow.xaml
@@ -1,67 +1,81 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From b8c2a993be99714a32e749df94d553af2efdab58 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Mon, 15 Dec 2025 01:20:22 +0800
Subject: [PATCH 14/19] Csharp i18n text
---
.../BrowserPicker.App.csproj | 1 +
.../Resources/i18n.Designer.cs | 56 +++++---
src/BrowserPicker.App/Resources/i18n.resx | 35 +++--
.../Resources/i18n.zh-CN.resx | 40 +++---
src/BrowserPicker.App/View/BrowserEditor.xaml | 2 +-
src/BrowserPicker.App/View/Configuration.xaml | 48 ++++---
.../View/Configuration.xaml.cs | 62 +++++++-
.../View/ExceptionReport.xaml | 2 +-
src/BrowserPicker.App/View/LoadingWindow.xaml | 2 +-
.../ViewModel/ApplicationViewModel.cs | 1 +
.../ViewModel/ConfigurationViewModel.cs | 3 +
src/BrowserPicker.Windows/AppSettings.cs | 21 +--
src/BrowserPicker/BrowserPicker.csproj | 13 ++
.../Resources/csi18n.Designer.cs | 99 +++++++++++++
src/BrowserPicker/Resources/csi18n.resx | 132 ++++++++++++++++++
src/BrowserPicker/Resources/csi18n.zh-CN.resx | 132 ++++++++++++++++++
16 files changed, 569 insertions(+), 80 deletions(-)
create mode 100644 src/BrowserPicker/Resources/csi18n.Designer.cs
create mode 100644 src/BrowserPicker/Resources/csi18n.resx
create mode 100644 src/BrowserPicker/Resources/csi18n.zh-CN.resx
diff --git a/src/BrowserPicker.App/BrowserPicker.App.csproj b/src/BrowserPicker.App/BrowserPicker.App.csproj
index 35b3ce6..0c33ee5 100644
--- a/src/BrowserPicker.App/BrowserPicker.App.csproj
+++ b/src/BrowserPicker.App/BrowserPicker.App.csproj
@@ -10,6 +10,7 @@
Resources\web_icon.ico
False
enable
+
diff --git a/src/BrowserPicker.App/Resources/i18n.Designer.cs b/src/BrowserPicker.App/Resources/i18n.Designer.cs
index afeed81..df70d1c 100644
--- a/src/BrowserPicker.App/Resources/i18n.Designer.cs
+++ b/src/BrowserPicker.App/Resources/i18n.Designer.cs
@@ -186,15 +186,6 @@ public static string BoxCrashedTextInfo {
}
}
- ///
- /// 查找类似 An unhandled exception has occurred 的本地化字符串。
- ///
- public static string BoxCrashedTitle {
- get {
- return ResourceManager.GetString("BoxCrashedTitle", resourceCulture);
- }
- }
-
///
/// 查找类似 Scanning URL... 的本地化字符串。
///
@@ -303,6 +294,15 @@ public static string BtnRemove {
}
}
+ ///
+ /// 查找类似 无法获取应用程序文件名 的本地化字符串。
+ ///
+ public static string CsConfigConfigurationNameErorr {
+ get {
+ return ResourceManager.GetString("CsConfigConfigurationNameErorr", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Export BrowserPicker settings 的本地化字符串。
///
@@ -628,7 +628,7 @@ public static string NameUrlShortenersTextTitle {
}
///
- /// 查找类似 Welcome to Browser Picker, hope you enjoy my little app! 的本地化字符串。
+ /// 查找类似 Welcome to BrowserPicker! 的本地化字符串。
///
public static string NameWelcomeText1 {
get {
@@ -637,7 +637,7 @@ public static string NameWelcomeText1 {
}
///
- /// 查找类似 This message will self destruct in 10 seconds 的本地化字符串。
+ /// 查找类似 This message will automatically disappear after 10 seconds 的本地化字符串。
///
public static string NameWelcomeText10 {
get {
@@ -646,7 +646,7 @@ public static string NameWelcomeText10 {
}
///
- /// 查找类似 I've gone ahead and opened up the settings window, 的本地化字符串。
+ /// 查找类似 Here is the software settings window, 的本地化字符串。
///
public static string NameWelcomeText2 {
get {
@@ -655,7 +655,7 @@ public static string NameWelcomeText2 {
}
///
- /// 查找类似 so you can have a look around before you get started :) 的本地化字符串。
+ /// 查找类似 This software can select a customized browser when opening a link 的本地化字符串。
///
public static string NameWelcomeText3 {
get {
@@ -664,7 +664,7 @@ public static string NameWelcomeText3 {
}
///
- /// 查找类似 Please give it a ⭐ on github, so you will get notified when a new release is made. 的本地化字符串。
+ /// 查找类似 If you think this software is helpful to you 的本地化字符串。
///
public static string NameWelcomeText4 {
get {
@@ -673,7 +673,7 @@ public static string NameWelcomeText4 {
}
///
- /// 查找类似 Should you run into any kind of trouble or get an idea, 的本地化字符串。
+ /// 查找类似 Welcome to GitHub give a star☆ 的本地化字符串。
///
public static string NameWelcomeText5 {
get {
@@ -682,7 +682,7 @@ public static string NameWelcomeText5 {
}
///
- /// 查找类似 please visit 的本地化字符串。
+ /// 查找类似 If you encounter software problems or have new ideas, please visit the project to submit an issue! 的本地化字符串。
///
public static string NameWelcomeText6 {
get {
@@ -691,7 +691,7 @@ public static string NameWelcomeText6 {
}
///
- /// 查找类似 github.com/mortenn/BrowserPicker 的本地化字符串。
+ /// 查找类似 www.github.com/mortenn/BrowserPicker 的本地化字符串。
///
public static string NameWelcomeText7 {
get {
@@ -700,7 +700,7 @@ public static string NameWelcomeText7 {
}
///
- /// 查找类似 and file an issue! 的本地化字符串。
+ /// 查找类似 If you want to contribute to i18n, you can star this project and create a Resource.resx resource file in your own language. 的本地化字符串。
///
public static string NameWelcomeText8 {
get {
@@ -709,7 +709,7 @@ public static string NameWelcomeText8 {
}
///
- /// 查找类似 Be seeing you! 的本地化字符串。
+ /// 查找类似 www.github.com/XTsat/BrowserPicker_i18n 的本地化字符串。
///
public static string NameWelcomeText9 {
get {
@@ -806,5 +806,23 @@ public static string WindowsTitle {
return ResourceManager.GetString("WindowsTitle", resourceCulture);
}
}
+
+ ///
+ /// 查找类似 An unhandled exception has occurred 的本地化字符串。
+ ///
+ public static string WindowsTitleCrashed {
+ get {
+ return ResourceManager.GetString("WindowsTitleCrashed", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Edit Browser 的本地化字符串。
+ ///
+ public static string WindowsTitleEdit {
+ get {
+ return ResourceManager.GetString("WindowsTitleEdit", resourceCulture);
+ }
+ }
}
}
diff --git a/src/BrowserPicker.App/Resources/i18n.resx b/src/BrowserPicker.App/Resources/i18n.resx
index 7fa8823..86bd8f5 100644
--- a/src/BrowserPicker.App/Resources/i18n.resx
+++ b/src/BrowserPicker.App/Resources/i18n.resx
@@ -117,12 +117,12 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Browsers
-
Browser Picker
+
+ Browsers
+
Welcome
@@ -142,43 +142,43 @@
URL shorteners
- Welcome to Browser Picker, hope you enjoy my little app!
+ Welcome to BrowserPicker!
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- I've gone ahead and opened up the settings window,
+ Here is the software settings window,
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- so you can have a look around before you get started :)
+ This software can select a customized browser when opening a link
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- Please give it a ⭐ on github, so you will get notified when a new release is made.
+ If you think this software is helpful to you
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- Should you run into any kind of trouble or get an idea,
+ Welcome to GitHub give a star☆
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- please visit
+ If you encounter software problems or have new ideas, please visit the project to submit an issue!
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- github.com/mortenn/BrowserPicker
+ https://github.com/mortenn/BrowserPicker
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- and file an issue!
+ If you want to contribute to i18n, you can star this project and create a Resource.resx resource file in your own language.
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- Be seeing you!
+ https://github.com/XTsat/BrowserPicker_i18n
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
- This message will self destruct in 10 seconds
+ This message will automatically disappear after 10 seconds
@MutedRule(PunctuationLead)@MutedRule(StringFormat)@MutedRule(WhiteSpaceLead)@MutedRule(WhiteSpaceTail)@MutedRule(PunctuationTail)
@@ -249,6 +249,7 @@
Match by
+ @MutedRule(WhiteSpaceTail)
Pattern
@@ -358,7 +359,7 @@
Remember my choice for
-
+
An unhandled exception has occurred
@@ -376,4 +377,10 @@
Scanning URL...
+
+ Edit Browser
+
+
+ 无法获取应用程序文件名
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
index 0122fe5..038e368 100644
--- a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
+++ b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
@@ -117,12 +117,12 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 浏览器
-
浏览器选择器
+
+ 浏览器
+
欢迎
@@ -142,28 +142,31 @@
URL 缩短器
- 欢迎使用中文版浏览器选择器!
+ 欢迎使用浏览器选择器!
- 这里是设置窗口,
+ 这里是软件的设置窗口,
- 欢迎使用我汉化的中文版的软件
+ 本软件可以在打开链接的时候选择自定义的浏览器
- 请在 GitHub 上为汉化点个 star ⭐。
+ 如果你认为这个软件对你有帮助
+
+
+ 欢迎在 GitHub 上为汉化和原始仓库点个 star☆
- 下面是汉化仓库
+ 如果你对多语言有什么意见也可以反馈,
- github.com/XTsat/BrowserPicker_zh
+ https://github.com/XTsat/BrowserPicker_i18n
- 如果您遇到任何问题或有什么想法,请访问原始项目提交问题!
+ 如果您遇到软件问题或有什么新想法,请访问原始项目提交问题!
- github.com/mortenn/BrowserPicker
+ https://github.com/mortenn/BrowserPicker
这条消息将在 10 秒后自动消失
@@ -235,7 +238,7 @@
按域名设置默认浏览器
- 匹 配
+ 匹配
模式
@@ -253,7 +256,7 @@
当前浏览器选择:
- 备份或恢复您的 BrowserPicker 配置:
+ 备份或恢复您的浏览器选择器配置:
导出设置
@@ -345,11 +348,11 @@
记住我的选择
-
+
发生了一个未处理的异常
- 很抱歉,BrowserPicker 崩溃了。
+ 很抱歉,浏览器选择器崩溃了。
请在 https://github.com/mortenn/BrowserPicker 提交错误报告。
@@ -363,7 +366,10 @@
扫描 URL...
-
- 如果你对汉化有什么意见或是想要 star,
+
+ 编辑浏览器
+
+
+ 无法获取应用程序文件名
\ No newline at end of file
diff --git a/src/BrowserPicker.App/View/BrowserEditor.xaml b/src/BrowserPicker.App/View/BrowserEditor.xaml
index c1b6f6c..f363db4 100644
--- a/src/BrowserPicker.App/View/BrowserEditor.xaml
+++ b/src/BrowserPicker.App/View/BrowserEditor.xaml
@@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:properties="clr-namespace:BrowserPicker.Resources"
xmlns:viewModel="clr-namespace:BrowserPicker.ViewModel"
- Title="Browser Picker"
+ Title="{x:Static properties:i18n.WindowsTitleEdit}"
d:DataContext="{d:DesignInstance viewModel:BrowserViewModel,
d:IsDesignTimeCreatable=true}"
AllowsTransparency="True"
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index c2f8c16..42500e1 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -118,8 +118,8 @@
-
-
-
+ -->
- "{x:Static properties:i18n.NameWelcomeText1}"
- "{x:Static properties:i18n.NameWelcomeText2}"
- "{x:Static properties:i18n.NameWelcomeText3}"
-
- "{x:Static properties:i18n.NameWelcomeText4}"
-
- "{x:Static properties:i18n.NameWelcomeText5}"
- "{x:Static properties:i18n.NameWelcomeText6}""{x:Static properties:i18n.NameWelcomeText7}"
- "{x:Static properties:i18n.NameWelcomeText8}"
-
- "{x:Static properties:i18n.NameWelcomeText9}"
-
- "{x:Static properties:i18n.NameWelcomeText10}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/View/Configuration.xaml.cs b/src/BrowserPicker.App/View/Configuration.xaml.cs
index a3b1dd0..0ea809d 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml.cs
+++ b/src/BrowserPicker.App/View/Configuration.xaml.cs
@@ -4,12 +4,69 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
+using System.Windows.Documents;
+using System.Windows.Input;
using Microsoft.Win32;
namespace BrowserPicker.View;
public partial class Configuration
{
+
+ private void OnMouseEnter(object sender, MouseEventArgs e)
+ {
+ var hyperlink = sender as Hyperlink;
+ if (hyperlink != null)
+ {
+ hyperlink.TextDecorations = TextDecorations.Underline;
+ }
+ }
+
+ private void OnMouseLeave(object sender, MouseEventArgs e)
+ {
+ var hyperlink = sender as Hyperlink;
+ if (hyperlink != null)
+ {
+ hyperlink.TextDecorations = null;
+ }
+ }
+
+ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+ try
+ {
+ string url = e.Uri.ToString();
+
+ // 相对 URL 自动补充
+ if (!e.Uri.IsAbsoluteUri)
+ {
+ if (url.StartsWith("/"))
+ {
+ url = "https://github.com" + url;
+ }
+ else
+ {
+ url = "https://" + url;
+ }
+ }
+ else if (!url.StartsWith("http://") && !url.StartsWith("https://"))
+ {
+ url = "https://" + url;
+ }
+
+ Process.Start(new ProcessStartInfo(url)
+ {
+ UseShellExecute = true
+ });
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"无法打开链接 '{e.Uri}': {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+
+
// 外壳刷新API
[DllImport("shell32.dll", SetLastError = true)]
private static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2);
@@ -33,11 +90,12 @@ public Configuration()
{
InitializeComponent();
// 确保路径非空
+ string msg = BrowserPicker.Resources.i18n.CsConfigConfigurationNameErorr;
var entryAssembly = Assembly.GetEntryAssembly();
_appPath = !string.IsNullOrEmpty(Environment.ProcessPath)
? Environment.ProcessPath
: Path.Combine(AppContext.BaseDirectory, Path.GetFileName(AppName + ".exe"));
- _appExeName = Path.GetFileName(_appPath) ?? throw new InvalidOperationException("无法获取应用程序文件名");
+ _appExeName = Path.GetFileName(_appPath) ?? throw new InvalidOperationException(msg);
}
// 注册按钮点击事件
@@ -49,7 +107,7 @@ private void RegisterOpenWith_Click(object sender, RoutedEventArgs e)
CreateProgId(ProgIdHtml, "HTML文件", isUrl: false);
CreateProgId(ProgIdUrl, "URL链接", isUrl: true);
- // 2. 注册文件类型(仅操作CurrentUser路径)
+ // 2. 注册文件类型(仅User)
foreach (var ext in _fileTypes)
{
RegisterFileType(ext, ext == ".url" ? ProgIdUrl : ProgIdHtml);
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml b/src/BrowserPicker.App/View/ExceptionReport.xaml
index 5bf8c9b..9b9f5d0 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml
@@ -7,7 +7,7 @@
xmlns:properties="clr-namespace:BrowserPicker.Resources"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:viewModel="clr-namespace:BrowserPicker.ViewModel"
- Title="{x:Static properties:i18n.BoxCrashedTitle}"
+ Title="{x:Static properties:i18n.WindowsTitleCrashed}"
d:DataContext="{d:DesignInstance viewModel:ExceptionViewModel,
d:IsDesignTimeCreatable=True}"
SizeToContent="WidthAndHeight"
diff --git a/src/BrowserPicker.App/View/LoadingWindow.xaml b/src/BrowserPicker.App/View/LoadingWindow.xaml
index 3beedc0..e9644fe 100644
--- a/src/BrowserPicker.App/View/LoadingWindow.xaml
+++ b/src/BrowserPicker.App/View/LoadingWindow.xaml
@@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:properties="clr-namespace:BrowserPicker.Resources"
xmlns:viewModel="clr-namespace:BrowserPicker.ViewModel"
- Title="Browser Picker"
+ Title="{x:Static properties:i18n.WindowsTitle}"
d:DataContext="{d:DesignInstance viewModel:ApplicationViewModel,
d:IsDesignTimeCreatable=true}"
AllowsTransparency="True"
diff --git a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
index 2ad98b8..ef7f4fb 100644
--- a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
+++ b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
@@ -10,6 +10,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
+using BrowserPicker.Resources;
#if DEBUG
using JetBrains.Annotations;
#endif
diff --git a/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs b/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
index d4c5930..a38dd83 100644
--- a/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
+++ b/src/BrowserPicker.App/ViewModel/ConfigurationViewModel.cs
@@ -10,6 +10,7 @@
using Microsoft.Win32;
using System;
using System.Diagnostics;
+using BrowserPicker.Resources;
#if DEBUG
using System.Threading.Tasks;
@@ -18,6 +19,8 @@
namespace BrowserPicker.ViewModel;
+
+
///
/// Represents the view model for configuring browser behavior and default settings
/// in the BrowserPicker application.
diff --git a/src/BrowserPicker.Windows/AppSettings.cs b/src/BrowserPicker.Windows/AppSettings.cs
index 46f8f4d..1af555d 100644
--- a/src/BrowserPicker.Windows/AppSettings.cs
+++ b/src/BrowserPicker.Windows/AppSettings.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
@@ -10,6 +10,7 @@
using BrowserPicker.Framework;
using Microsoft.Extensions.Logging;
using Microsoft.Win32;
+using BrowserPicker;
namespace BrowserPicker.Windows;
@@ -298,14 +299,16 @@ public async Task SaveAsync(string fileName)
var settings = new SerializableSettings(this);
try
{
- await Task.CompletedTask;
+ string msg = BrowserPicker.Resources.csi18n.CsAppSettingsExport;
+ await Task.CompletedTask;
await using var fileStream = File.Open(fileName, FileMode.Create, FileAccess.Write);
await JsonSerializer.SerializeAsync(fileStream, settings, JsonOptions);
- BackupLog += $"配置导出至 {fileName}\n";
+ BackupLog += $"{msg} {fileName}\n";
}
catch(Exception e)
- {
- BackupLog += $"无法解析备份文件: {e.Message}";
+ {
+ string msg = BrowserPicker.Resources.csi18n.CsAppSettingsBackupError;
+ BackupLog += $"{msg} {e.Message}";
}
}
@@ -320,12 +323,13 @@ public async Task LoadAsync(string fileName)
}
catch (Exception ex)
{
- BackupLog += $"无法解析备份文件: {ex.Message}";
+ string msg1 = BrowserPicker.Resources.csi18n.CsAppSettingsBackupError;
+ BackupLog += $"{msg1} {ex.Message}";
return;
}
if (settings == null)
{
- BackupLog += "无法加载备份";
+ BackupLog += BrowserPicker.Resources.csi18n.CsAppSettingsBackupLoadError;
return;
}
@@ -334,7 +338,8 @@ public async Task LoadAsync(string fileName)
UpdateDefaults(settings.Defaults);
UpdateKeybinds(settings.KeyBindings);
- BackupLog += $"导入配置自 {fileName}\n";
+ string msg = BrowserPicker.Resources.csi18n.CsAppSettingsImport;
+ BackupLog += $"{msg} {fileName}\n";
}
private void UpdateSettings(SerializableSettings settings)
diff --git a/src/BrowserPicker/BrowserPicker.csproj b/src/BrowserPicker/BrowserPicker.csproj
index 5ddd395..aeae9dd 100644
--- a/src/BrowserPicker/BrowserPicker.csproj
+++ b/src/BrowserPicker/BrowserPicker.csproj
@@ -7,4 +7,17 @@
+
+
+ csi18n.resx
+ True
+ True
+
+
+
+
+ csi18n.Designer.cs
+ PublicResXFileCodeGenerator
+
+
\ No newline at end of file
diff --git a/src/BrowserPicker/Resources/csi18n.Designer.cs b/src/BrowserPicker/Resources/csi18n.Designer.cs
new file mode 100644
index 0000000..53e6b37
--- /dev/null
+++ b/src/BrowserPicker/Resources/csi18n.Designer.cs
@@ -0,0 +1,99 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace BrowserPicker.Resources {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class csi18n {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal csi18n() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BrowserPicker.Resources.csi18n", typeof(csi18n).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 查找类似 Unable to parse backup file: 的本地化字符串。
+ ///
+ public static string CsAppSettingsBackupError {
+ get {
+ return ResourceManager.GetString("CsAppSettingsBackupError", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Unable to load backup 的本地化字符串。
+ ///
+ public static string CsAppSettingsBackupLoadError {
+ get {
+ return ResourceManager.GetString("CsAppSettingsBackupLoadError", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Exported configuration to 的本地化字符串。
+ ///
+ public static string CsAppSettingsExport {
+ get {
+ return ResourceManager.GetString("CsAppSettingsExport", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Imported configuration from 的本地化字符串。
+ ///
+ public static string CsAppSettingsImport {
+ get {
+ return ResourceManager.GetString("CsAppSettingsImport", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/BrowserPicker/Resources/csi18n.resx b/src/BrowserPicker/Resources/csi18n.resx
new file mode 100644
index 0000000..34595d2
--- /dev/null
+++ b/src/BrowserPicker/Resources/csi18n.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Exported configuration to
+
+
+ Unable to parse backup file:
+
+
+ Unable to load backup
+
+
+ Imported configuration from
+
+
\ No newline at end of file
diff --git a/src/BrowserPicker/Resources/csi18n.zh-CN.resx b/src/BrowserPicker/Resources/csi18n.zh-CN.resx
new file mode 100644
index 0000000..7797f53
--- /dev/null
+++ b/src/BrowserPicker/Resources/csi18n.zh-CN.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 配置导出至
+
+
+ 无法解析备份文件:
+
+
+ 导入配置自
+
+
+ 无法加载备份
+
+
\ No newline at end of file
From 2935caff1cc25a5e0332ac160f14f5ad167d0c85 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Mon, 15 Dec 2025 23:13:22 +0800
Subject: [PATCH 15/19] Csharp i18n text
---
BrowserPicker.sln | 2 +-
.../Resources/i18n.Designer.cs | 221 ++++++++++++++++--
src/BrowserPicker.App/Resources/i18n.resx | 78 ++++++-
.../Resources/i18n.zh-CN.resx | 75 +++++-
src/BrowserPicker.App/View/BrowserEditor.xaml | 4 +-
src/BrowserPicker.App/View/Configuration.xaml | 6 +-
.../View/Configuration.xaml.cs | 76 +++---
.../View/ExceptionReport.xaml | 2 +-
8 files changed, 401 insertions(+), 63 deletions(-)
diff --git a/BrowserPicker.sln b/BrowserPicker.sln
index 77d29b4..e3ede8a 100644
--- a/BrowserPicker.sln
+++ b/BrowserPicker.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
-VisualStudioVersion = 18.1.11304.174 d18.0
+VisualStudioVersion = 18.1.11304.174
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F46B5958-C607-4E07-9C2C-F63538149287}"
ProjectSection(SolutionItems) = preProject
diff --git a/src/BrowserPicker.App/Resources/i18n.Designer.cs b/src/BrowserPicker.App/Resources/i18n.Designer.cs
index df70d1c..f8fc78a 100644
--- a/src/BrowserPicker.App/Resources/i18n.Designer.cs
+++ b/src/BrowserPicker.App/Resources/i18n.Designer.cs
@@ -259,47 +259,153 @@ public static string BoxOpenBrowserTipPin {
}
///
- /// 查找类似 Add 的本地化字符串。
+ /// 查找类似 Permission prompt 的本地化字符串。
///
- public static string BtnAdd {
+ public static string CsConfigAdminTip {
get {
- return ResourceManager.GetString("BtnAdd", resourceCulture);
+ return ResourceManager.GetString("CsConfigAdminTip", resourceCulture);
}
}
///
- /// 查找类似 Cancel 的本地化字符串。
+ /// 查找类似 Normal user permission restricted: {0}
+ ///Please turn off the security software and try again (no admin required) 的本地化字符串。
///
- public static string BtnCancel {
+ public static string CsConfigAdminTipText {
get {
- return ResourceManager.GetString("BtnCancel", resourceCulture);
+ return ResourceManager.GetString("CsConfigAdminTipText", resourceCulture);
}
}
///
- /// 查找类似 Ok 的本地化字符串。
+ /// 查找类似 Unable to get application filename 的本地化字符串。
///
- public static string BtnOk {
+ public static string CsConfigConfigurationNameErorr {
get {
- return ResourceManager.GetString("BtnOk", resourceCulture);
+ return ResourceManager.GetString("CsConfigConfigurationNameErorr", resourceCulture);
}
}
///
- /// 查找类似 Remove 的本地化字符串。
+ /// 查找类似 Web link selector 的本地化字符串。
///
- public static string BtnRemove {
+ public static string CsConfigDefaultProgramRegistration {
get {
- return ResourceManager.GetString("BtnRemove", resourceCulture);
+ return ResourceManager.GetString("CsConfigDefaultProgramRegistration", resourceCulture);
}
}
///
- /// 查找类似 无法获取应用程序文件名 的本地化字符串。
+ /// 查找类似 Extension or ProgID cannot be empty 的本地化字符串。
///
- public static string CsConfigConfigurationNameErorr {
+ public static string CsConfigFileTypeRegistration {
get {
- return ResourceManager.GetString("CsConfigConfigurationNameErorr", resourceCulture);
+ return ResourceManager.GetString("CsConfigFileTypeRegistration", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Open{0}file 的本地化字符串。
+ ///
+ public static string CsConfigFileTypeRegistrationSuccessful {
+ get {
+ return ResourceManager.GetString("CsConfigFileTypeRegistrationSuccessful", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Unable to open link 的本地化字符串。
+ ///
+ public static string CsConfigHyperlinkError {
+ get {
+ return ResourceManager.GetString("CsConfigHyperlinkError", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Open with {0} 的本地化字符串。
+ ///
+ public static string CsConfigProgramRegistrationOpen {
+ get {
+ return ResourceManager.GetString("CsConfigProgramRegistrationOpen", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Open{0}link with{1} 的本地化字符串。
+ ///
+ public static string CsConfigProgramRegistrationOpen2 {
+ get {
+ return ResourceManager.GetString("CsConfigProgramRegistrationOpen2", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Registration failed: {0}
+ ///Please check if the app is blocked by security software 的本地化字符串。
+ ///
+ public static string CsConfigRegistrationFailed {
+ get {
+ return ResourceManager.GetString("CsConfigRegistrationFailed", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Registration successful!
+ ///1. Create a→ new desktop→ shortcut→ Enter the URL→ Right-click to→ open the method→ Select another app→ Find this program
+ ///2. Right click any .html file→ Choose another app→ More apps→ Find this program
+ ///3. If it is not displayed, it will take effect automatically after restarting the computer 的本地化字符串。
+ ///
+ public static string CsConfigRegistrationSuccessful {
+ get {
+ return ResourceManager.GetString("CsConfigRegistrationSuccessful", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Failed to restart the explorer, it is recommended to restart the computer to take effect 的本地化字符串。
+ ///
+ public static string CsConfigRestartExplorerFailTip {
+ get {
+ return ResourceManager.GetString("CsConfigRestartExplorerFailTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Do you want to restart Explorer for immediate effect?
+ ///The desktop icon will disappear temporarily during the restart process and resume automatically after a few seconds. 的本地化字符串。
+ ///
+ public static string CsConfigRestartExplorerTip {
+ get {
+ return ResourceManager.GetString("CsConfigRestartExplorerTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Remove failure: 的本地化字符串。
+ ///
+ public static string CsConfigUnregisterFailed {
+ get {
+ return ResourceManager.GetString("CsConfigUnregisterFailed", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Successfully removed all open method associations! 的本地化字符串。
+ ///
+ public static string CsConfigUnregisterSuccessful {
+ get {
+ return ResourceManager.GetString("CsConfigUnregisterSuccessful", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Are you sure you want to remove all open method associations?
+ ///Once removed, it will not be possible to quickly open the webpage through this program. 的本地化字符串。
+ ///
+ public static string CsConfigUnregisterTip {
+ get {
+ return ResourceManager.GetString("CsConfigUnregisterTip", resourceCulture);
}
}
@@ -691,7 +797,7 @@ public static string NameWelcomeText6 {
}
///
- /// 查找类似 www.github.com/mortenn/BrowserPicker 的本地化字符串。
+ /// 查找类似 https://github.com/mortenn/BrowserPicker 的本地化字符串。
///
public static string NameWelcomeText7 {
get {
@@ -709,7 +815,7 @@ public static string NameWelcomeText8 {
}
///
- /// 查找类似 www.github.com/XTsat/BrowserPicker_i18n 的本地化字符串。
+ /// 查找类似 https://github.com/XTsat/BrowserPicker_i18n 的本地化字符串。
///
public static string NameWelcomeText9 {
get {
@@ -798,6 +904,87 @@ public static string TopNameWelcome {
}
}
+ ///
+ /// 查找类似 Add 的本地化字符串。
+ ///
+ public static string UniAdd {
+ get {
+ return ResourceManager.GetString("UniAdd", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Cancel 的本地化字符串。
+ ///
+ public static string UniCancel {
+ get {
+ return ResourceManager.GetString("UniCancel", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Complete 的本地化字符串。
+ ///
+ public static string UniCompleted {
+ get {
+ return ResourceManager.GetString("UniCompleted", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Incorrect 的本地化字符串。
+ ///
+ public static string UniError {
+ get {
+ return ResourceManager.GetString("UniError", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Ok 的本地化字符串。
+ ///
+ public static string UniOk {
+ get {
+ return ResourceManager.GetString("UniOk", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Open 的本地化字符串。
+ ///
+ public static string UniOpen {
+ get {
+ return ResourceManager.GetString("UniOpen", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Remove 的本地化字符串。
+ ///
+ public static string UniRemove {
+ get {
+ return ResourceManager.GetString("UniRemove", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Restart 的本地化字符串。
+ ///
+ public static string UniRestart {
+ get {
+ return ResourceManager.GetString("UniRestart", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Prompts 的本地化字符串。
+ ///
+ public static string UniTip {
+ get {
+ return ResourceManager.GetString("UniTip", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Browser Picker 的本地化字符串。
///
diff --git a/src/BrowserPicker.App/Resources/i18n.resx b/src/BrowserPicker.App/Resources/i18n.resx
index 86bd8f5..cc6f252 100644
--- a/src/BrowserPicker.App/Resources/i18n.resx
+++ b/src/BrowserPicker.App/Resources/i18n.resx
@@ -290,10 +290,10 @@
Some pages, such as outlook safelinks, have special handling where the target url is in the query string, these are not listed in this list, as they require additional information in code.
-
+
Add
-
+
Remove
@@ -332,10 +332,10 @@
(Automatic)
-
+
Ok
-
+
Cancel
@@ -381,6 +381,74 @@
Edit Browser
- 无法获取应用程序文件名
+ Unable to get application filename
+
+
+ Incorrect
+
+
+ Unable to open link
+
+
+ Complete
+
+
+ Registration successful!
+1. Create a→ new desktop→ shortcut→ Enter the URL→ Right-click to→ open the method→ Select another app→ Find this program
+2. Right click any .html file→ Choose another app→ More apps→ Find this program
+3. If it is not displayed, it will take effect automatically after restarting the computer
+
+
+ Permission prompt
+
+
+ Normal user permission restricted: {0}
+Please turn off the security software and try again (no admin required)
+
+
+ Registration failed: {0}
+Please check if the app is blocked by security software
+
+
+ Are you sure you want to remove all open method associations?
+Once removed, it will not be possible to quickly open the webpage through this program.
+
+
+ Successfully removed all open method associations!
+
+
+ Remove failure:
+
+
+ Extension or ProgID cannot be empty
+
+
+ Open{0}file
+
+
+ Web link selector
+
+
+ Open with {0}
+
+
+ Open{0}link with{1}
+
+
+ Open
+
+
+ Restart
+
+
+ Do you want to restart Explorer for immediate effect?
+The desktop icon will disappear temporarily during the restart process and resume automatically after a few seconds.
+ Default no restart
+
+
+ Prompts
+
+
+ Failed to restart the explorer, it is recommended to restart the computer to take effect
\ No newline at end of file
diff --git a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
index 038e368..8fb98e0 100644
--- a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
+++ b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
@@ -279,10 +279,10 @@
有些页面(例如 Outlook 安全链接)有特殊的处理方式,目标 URL 位于查询字符串中,这些页面未列入此列表,因为它们需要在代码中提供额外的信息。
-
+
添加
-
+
移除
@@ -321,10 +321,10 @@
(自动)
-
+
确认
-
+
取消
@@ -372,4 +372,71 @@
无法获取应用程序文件名
+
+ 错误
+
+
+ 无法打开链接
+
+
+ 完成
+
+
+ 注册成功!
+1. 桌面→新建→快捷方式→输入网址→右键→打开方式→选择其他应用→找到本程序
+2. 任意.html文件→右键→打开方式→选择其他应用→更多应用→找到本程序
+3. 若未显示,重启电脑后自动生效
+
+
+ 权限提示
+
+
+ 普通用户权限受限:{0}
+请关闭安全软件后重试(无需管理员)
+
+
+ 注册失败:{0}
+请检查应用是否被安全软件拦截
+
+
+ 确定要移除所有打开方式关联吗?
+移除后将无法通过本程序快速打开网页。
+
+
+ 已成功移除所有打开方式关联!
+
+
+ 移除失败:
+
+
+ 扩展名或ProgID不能为空
+
+
+ 打开{0}文件
+
+
+ 网页链接选择器
+
+
+ 用{0}打开
+
+
+ 用{0}打开{1}链接
+
+
+ 打开
+
+
+ 重启
+
+
+ 是否重启资源管理器以立即生效?
+重启过程中桌面图标会暂时消失,几秒后自动恢复。
+
+
+ 提示
+
+
+ 重启资源管理器失败,建议重启电脑以生效
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/View/BrowserEditor.xaml b/src/BrowserPicker.App/View/BrowserEditor.xaml
index f363db4..4992f7b 100644
--- a/src/BrowserPicker.App/View/BrowserEditor.xaml
+++ b/src/BrowserPicker.App/View/BrowserEditor.xaml
@@ -221,12 +221,12 @@
+ Content="{x:Static properties:i18n.UniCancel}" />
+ Content="{x:Static properties:i18n.UniOk}" />
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index 42500e1..735006d 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -500,7 +500,7 @@
Grid.Column="3"
Padding="5,0"
Command="{Binding AddDefault}"
- Content="{x:Static properties:i18n.BtnAdd}" />
+ Content="{x:Static properties:i18n.UniAdd}" />
@@ -652,14 +652,14 @@
Padding="10,0"
Command="{Binding AddShortener}"
CommandParameter="{Binding Text, ElementName=NewShortener}"
- Content="{x:Static properties:i18n.BtnAdd}" />
+ Content="{x:Static properties:i18n.UniAdd}" />
+ Content="{x:Static properties:i18n.UniRemove}" />
diff --git a/src/BrowserPicker.App/View/Configuration.xaml.cs b/src/BrowserPicker.App/View/Configuration.xaml.cs
index 0ea809d..99e933a 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml.cs
+++ b/src/BrowserPicker.App/View/Configuration.xaml.cs
@@ -61,7 +61,9 @@ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.
}
catch (Exception ex)
{
- MessageBox.Show($"无法打开链接 '{e.Uri}': {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
+ string msg = BrowserPicker.Resources.i18n.CsConfigHyperlinkError;
+ string error = BrowserPicker.Resources.i18n.UniError;
+ MessageBox.Show($"{msg} '{e.Uri}': {ex.Message}", error, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
@@ -132,31 +134,33 @@ private void RegisterOpenWith_Click(object sender, RoutedEventArgs e)
// 6. 无感知刷新(不重启资源管理器)
RefreshSystemAssociations(false);
- MessageBox.Show(
- "注册成功!\n" +
- "1. 桌面→新建→快捷方式→输入网址→右键→打开方式→选择其他应用→找到本程序\n" +
- "2. 任意.html文件→右键→打开方式→选择其他应用→更多应用→找到本程序\n" +
- "3. 若未显示,重启电脑后自动生效",
- "完成", MessageBoxButton.OK, MessageBoxImage.Information);
+
+ string msg = BrowserPicker.Resources.i18n.CsConfigRegistrationSuccessful;
+ string Completed = BrowserPicker.Resources.i18n.UniCompleted;
+
+ MessageBox.Show(msg, Completed, MessageBoxButton.OK, MessageBoxImage.Information);
}
catch (UnauthorizedAccessException ex)
{
- MessageBox.Show($"普通用户权限受限:{ex.Message}\n请关闭安全软件后重试(无需管理员)", "权限提示",
- MessageBoxButton.OK, MessageBoxImage.Warning);
+ string msg = BrowserPicker.Resources.i18n.CsConfigAdminTipText;
+ string tip = BrowserPicker.Resources.i18n.CsConfigAdminTip;
+ MessageBox.Show($"{msg}{ex.Message}", tip, MessageBoxButton.OK, MessageBoxImage.Warning);
}
catch (Exception ex)
{
- MessageBox.Show($"注册失败:{ex.Message}\n请检查应用是否被安全软件拦截", "错误",
- MessageBoxButton.OK, MessageBoxImage.Error);
+ string msg = BrowserPicker.Resources.i18n.CsConfigRegistrationFailed;
+ string error = BrowserPicker.Resources.i18n.UniError;
+ MessageBox.Show($"{msg}{ex.Message}", error, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
// 移除按钮点击事件
private void UnregisterOpenWith_Click(object sender, RoutedEventArgs e)
{
- var result = MessageBox.Show(
- "确定要移除所有打开方式关联吗?\n移除后将无法通过本程序快速打开网页。",
- "确认移除", MessageBoxButton.YesNo, MessageBoxImage.Warning);
+
+ string msg = BrowserPicker.Resources.i18n.CsConfigUnregisterTip;
+ string remove = BrowserPicker.Resources.i18n.UniRemove;
+ var result = MessageBox.Show(msg, remove, MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
@@ -191,12 +195,16 @@ private void UnregisterOpenWith_Click(object sender, RoutedEventArgs e)
// 6. 无感知刷新
RefreshSystemAssociations(false);
- MessageBox.Show("已成功移除所有打开方式关联!", "完成",
- MessageBoxButton.OK, MessageBoxImage.Information);
+
+ string msg1 = BrowserPicker.Resources.i18n.CsConfigUnregisterSuccessful;
+ string Completed = BrowserPicker.Resources.i18n.UniCompleted;
+ MessageBox.Show(msg1, Completed, MessageBoxButton.OK, MessageBoxImage.Information);
}
catch (Exception ex)
{
- MessageBox.Show($"移除失败:{ex.Message}", "错误",
+ string msg1 = BrowserPicker.Resources.i18n.CsConfigUnregisterFailed;
+ string error = BrowserPicker.Resources.i18n.UniError;
+ MessageBox.Show($"{msg1}{ex.Message}", error,
MessageBoxButton.OK, MessageBoxImage.Error);
}
}
@@ -204,14 +212,16 @@ private void UnregisterOpenWith_Click(object sender, RoutedEventArgs e)
// 文件类型注册
private void RegisterFileType(string extension, string progId)
{
+ string msg = BrowserPicker.Resources.i18n.CsConfigFileTypeRegistration;
if (string.IsNullOrEmpty(extension) || string.IsNullOrEmpty(progId))
- throw new ArgumentNullException("扩展名或ProgID不能为空");
+ throw new ArgumentNullException(msg);
// 仅操作 CurrentUser\Software\Classes\扩展名
using (var extKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{extension}"))
{
+ string msg1 = BrowserPicker.Resources.i18n.CsConfigFileTypeRegistrationSuccessful;
extKey.SetValue("", progId, RegistryValueKind.String);
- extKey.SetValue("FriendlyTypeName", $"{AppName} - 打开{extension}文件", RegistryValueKind.String);
+ extKey.SetValue("FriendlyTypeName", $"{AppName} - {msg}{extension}", RegistryValueKind.String);
// OpenWithList(右键打开方式核心)
using (var openWithList = extKey.CreateSubKey(@"OpenWithList\" + AppName))
@@ -280,7 +290,8 @@ private void RegisterAsDefaultProgram()
// 功能描述
using (var capabilitiesKey = appKey.CreateSubKey("Capabilities"))
{
- capabilitiesKey.SetValue("ApplicationDescription", $"{AppName} - 网页链接选择器", RegistryValueKind.String);
+ string msg = BrowserPicker.Resources.i18n.CsConfigDefaultProgramRegistration;
+ capabilitiesKey.SetValue("ApplicationDescription", $"{AppName} - {msg}", RegistryValueKind.String);
capabilitiesKey.SetValue("ApplicationName", AppName, RegistryValueKind.String);
// 文件关联
@@ -302,7 +313,8 @@ private void RegisterAsDefaultProgram()
// 打开命令
using (var shellKey = appKey.CreateSubKey(@"shell\open"))
{
- shellKey.SetValue("FriendlyName", $"用 {AppName} 打开", RegistryValueKind.String);
+ string msg = BrowserPicker.Resources.i18n.CsConfigProgramRegistrationOpen;
+ shellKey.SetValue("FriendlyName", $"{msg} {AppName} ", RegistryValueKind.String);
shellKey.SetValue("Icon", $"\"{_appPath}\",0", RegistryValueKind.String);
using (var cmdKey = shellKey.CreateSubKey("command"))
{
@@ -322,11 +334,11 @@ private void RegisterAsDefaultProgram()
private void RegisterUrlProtocol(string protocol, string progId)
{
if (string.IsNullOrEmpty(protocol) || string.IsNullOrEmpty(progId))
- throw new ArgumentNullException("协议或ProgID不能为空");
+ throw new ArgumentNullException("The protocol or ProgID cannot be empty");
using (var protoKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{protocol}"))
{
- protoKey.SetValue("", $"{AppName} - {protocol}协议", RegistryValueKind.String);
+ protoKey.SetValue("", $"{AppName} - {protocol}Agreement", RegistryValueKind.String);
protoKey.SetValue("URL Protocol", string.Empty, RegistryValueKind.String);
protoKey.SetValue("EditFlags", 0x00000002, RegistryValueKind.DWord);
protoKey.SetValue("AlwaysShowExt", "yes", RegistryValueKind.String); // 强制显示
@@ -357,10 +369,11 @@ private void RegisterUrlProtocol(string protocol, string progId)
// 直接添加右键菜单
private void AddProtocolContextMenu(string protocol)
{
+ string open = BrowserPicker.Resources.i18n.CsConfigProgramRegistrationOpen2;
// 直接添加协议右键菜单
using (var shellKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{protocol}\shell\{AppName}"))
{
- shellKey.SetValue("", $"用 {AppName} 打开{protocol.ToUpper()}链接", RegistryValueKind.String);
+ shellKey.SetValue("", $"{open} {AppName} {protocol.ToUpper()}", RegistryValueKind.String);
shellKey.SetValue("Position", "Top", RegistryValueKind.String); // 置顶
shellKey.SetValue("Icon", $"\"{_appPath}\",0", RegistryValueKind.String);
}
@@ -375,7 +388,7 @@ private void AddProtocolContextMenu(string protocol)
{
using (var shellKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{fileType}\shell\{AppName}_{protocol}"))
{
- shellKey.SetValue("", $"用 {AppName} 打开{protocol.ToUpper()}链接", RegistryValueKind.String);
+ shellKey.SetValue("", $"{open} {AppName} {protocol.ToUpper()}", RegistryValueKind.String);
}
using (var cmdKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{fileType}\shell\{AppName}_{protocol}\command"))
{
@@ -408,8 +421,9 @@ private void CreateProgId(string progId, string description, bool isUrl)
{
using (var progKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{progId}"))
{
+ string open = BrowserPicker.Resources.i18n.UniOpen;
progKey.SetValue("", $"{AppName} - {description}", RegistryValueKind.String);
- progKey.SetValue("FriendlyTypeName", $"{AppName} - 打开{description}", RegistryValueKind.String);
+ progKey.SetValue("FriendlyTypeName", $"{AppName} - {open}{description}", RegistryValueKind.String);
if (isUrl) progKey.SetValue("URL Protocol", string.Empty, RegistryValueKind.String);
// 打开命令
@@ -546,9 +560,9 @@ private void RefreshSystemAssociations(bool forceRestart = false)
// 仅当用户主动选择时才重启(默认不重启)
if (forceRestart)
{
- var confirmResult = MessageBox.Show(
- "是否重启资源管理器以立即生效?\n重启过程中桌面图标会暂时消失,几秒后自动恢复。",
- "确认重启", MessageBoxButton.YesNo, MessageBoxImage.Question);
+ string restart = BrowserPicker.Resources.i18n.UniRestart;
+ string msg = BrowserPicker.Resources.i18n.CsConfigRestartExplorerTip;
+ var confirmResult = MessageBox.Show(msg, restart, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (confirmResult == MessageBoxResult.Yes)
{
@@ -562,7 +576,9 @@ private void RefreshSystemAssociations(bool forceRestart = false)
}
catch
{
- MessageBox.Show("重启资源管理器失败,建议重启电脑以生效", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ string tip = BrowserPicker.Resources.i18n.UniTip;
+ string msg1 = BrowserPicker.Resources.i18n.CsConfigRestartExplorerFailTip;
+ MessageBox.Show(msg1, tip, MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
}
diff --git a/src/BrowserPicker.App/View/ExceptionReport.xaml b/src/BrowserPicker.App/View/ExceptionReport.xaml
index 9b9f5d0..217e1a3 100644
--- a/src/BrowserPicker.App/View/ExceptionReport.xaml
+++ b/src/BrowserPicker.App/View/ExceptionReport.xaml
@@ -107,7 +107,7 @@
Margin="4"
Padding="10,0"
Command="{Binding Ok}"
- Content="{x:Static properties:i18n.BtnOk}" />
+ Content="{x:Static properties:i18n.UniOk}" />
From 25613109d9a2a549a8d28a0e45c00ab0c7b5de56 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Tue, 16 Dec 2025 00:04:13 +0800
Subject: [PATCH 16/19] i18n button
---
.../Resources/i18n.Designer.cs | 9 +++++
src/BrowserPicker.App/Resources/i18n.resx | 3 ++
.../Resources/i18n.zh-CN.resx | 3 ++
src/BrowserPicker.App/View/Configuration.xaml | 35 +++++++++++++------
.../ViewModel/ApplicationViewModel.cs | 33 +++++++++++++++++
5 files changed, 73 insertions(+), 10 deletions(-)
diff --git a/src/BrowserPicker.App/Resources/i18n.Designer.cs b/src/BrowserPicker.App/Resources/i18n.Designer.cs
index f8fc78a..63322e7 100644
--- a/src/BrowserPicker.App/Resources/i18n.Designer.cs
+++ b/src/BrowserPicker.App/Resources/i18n.Designer.cs
@@ -868,6 +868,15 @@ public static string TopNameExit {
}
}
+ ///
+ /// 查找类似 语言 的本地化字符串。
+ ///
+ public static string TopNameLanguage {
+ get {
+ return ResourceManager.GetString("TopNameLanguage", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Behaviour 的本地化字符串。
///
diff --git a/src/BrowserPicker.App/Resources/i18n.resx b/src/BrowserPicker.App/Resources/i18n.resx
index cc6f252..dbe13e0 100644
--- a/src/BrowserPicker.App/Resources/i18n.resx
+++ b/src/BrowserPicker.App/Resources/i18n.resx
@@ -451,4 +451,7 @@ The desktop icon will disappear temporarily during the restart process and resum
Failed to restart the explorer, it is recommended to restart the computer to take effect
+
+ 语言
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
index 8fb98e0..28b82b2 100644
--- a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
+++ b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
@@ -439,4 +439,7 @@
重启资源管理器失败,建议重启电脑以生效
+
+ Language
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/View/Configuration.xaml b/src/BrowserPicker.App/View/Configuration.xaml
index 735006d..1dca819 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml
+++ b/src/BrowserPicker.App/View/Configuration.xaml
@@ -672,7 +672,7 @@
VerticalAlignment="Bottom"
Orientation="Horizontal">
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
index ef7f4fb..058a40c 100644
--- a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
+++ b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
@@ -11,6 +11,10 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using BrowserPicker.Resources;
+using System.Globalization;
+using System.Text.RegularExpressions;
+
+
#if DEBUG
using JetBrains.Annotations;
#endif
@@ -23,6 +27,35 @@ namespace BrowserPicker.ViewModel;
///
public sealed class ApplicationViewModel : ModelBase
{
+
+ private DelegateCommand? changeLanguage;
+ public ICommand ChangeLanguage => changeLanguage ??= new DelegateCommand(OnChangeLanguage);
+
+ private void OnChangeLanguage()
+ {
+ // 获取当前语言
+ var currentCulture = Thread.CurrentThread.CurrentUICulture;
+
+ // 定义支持的语言列表 (这里以英文和中文为例)
+ var supportedCultures = new[]
+ {
+ new CultureInfo("en"),
+ new CultureInfo("zh")
+ };
+
+ // 循环切换到下一个语言
+ var currentIndex = Array.IndexOf(supportedCultures,
+ supportedCultures.FirstOrDefault(c => c.Name.StartsWith(currentCulture.TwoLetterISOLanguageName)) ?? supportedCultures[0]);
+ var nextIndex = (currentIndex + 1) % supportedCultures.Length;
+
+ // 更改语言
+ Thread.CurrentThread.CurrentUICulture = supportedCultures[nextIndex];
+ Thread.CurrentThread.CurrentCulture = supportedCultures[nextIndex];
+
+ // 刷新界面
+ OnPropertyChanged(string.Empty); // 通知所有属性更改以刷新界面
+ }
+
private static readonly ILogger Logger = App.Services.GetRequiredService>();
#if DEBUG
From 157fee849dd6f60b70f0c8b350163d7a82c00990 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Tue, 16 Dec 2025 02:08:50 +0800
Subject: [PATCH 17/19] i18n change button
---
src/BrowserPicker.App/App.config | 6 ++
src/BrowserPicker.App/App.xaml.cs | 34 ++++++--
.../Resources/i18n.Designer.cs | 9 ++
src/BrowserPicker.App/Resources/i18n.resx | 3 +
.../Resources/i18n.zh-CN.resx | 3 +
.../View/Configuration.xaml.cs | 4 +-
.../ViewModel/ApplicationViewModel.cs | 82 +++++++++++++++----
7 files changed, 115 insertions(+), 26 deletions(-)
create mode 100644 src/BrowserPicker.App/App.config
diff --git a/src/BrowserPicker.App/App.config b/src/BrowserPicker.App/App.config
new file mode 100644
index 0000000..d5ce1ff
--- /dev/null
+++ b/src/BrowserPicker.App/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/App.xaml.cs b/src/BrowserPicker.App/App.xaml.cs
index 082e9e8..e9af28e 100644
--- a/src/BrowserPicker.App/App.xaml.cs
+++ b/src/BrowserPicker.App/App.xaml.cs
@@ -1,5 +1,9 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Diagnostics;
+using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
@@ -8,9 +12,7 @@
using System.Windows.Threading;
using BrowserPicker.View;
using BrowserPicker.ViewModel;
-using System.Configuration;
-using System.Data;
-using System.Globalization;
+using static BrowserPicker.ViewModel.ApplicationViewModel;
namespace BrowserPicker;
@@ -44,9 +46,9 @@ private class InvalidUTF8Patch : EncodingProvider
public App()
{
- var culture = new CultureInfo("en-US");
- Thread.CurrentThread.CurrentCulture = culture;
- //Thread.CurrentThread.CurrentUIculture = culture;
+ //var culture = new CultureInfo("en-US");
+ //Thread.CurrentThread.CurrentCulture = culture;
+ //Thread.CurrentThread.CurrentUICulture = culture;
Encoding.RegisterProvider(new InvalidUTF8Patch());
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -74,10 +76,28 @@ public App()
protected override void OnStartup(StartupEventArgs e)
{
+ base.OnStartup(e);
+ LoadSavedLanguage();
var worker = StartupBackgroundTasks();
worker.ContinueWith(CheckBackgroundTasks);
}
-
+ private void LoadSavedLanguage()
+ {
+ try
+ {
+ var savedLanguage = AppConfigHelper.ReadAppConfig("language");
+ if (!string.IsNullOrEmpty(savedLanguage))
+ {
+ var culture = new CultureInfo(savedLanguage);
+ Thread.CurrentThread.CurrentUICulture = culture;
+ Thread.CurrentThread.CurrentCulture = culture;
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Failed to load saved language: {ex.Message}");
+ }
+ }
///
/// This method should never be called, as the StartupBackgroundTasks has robust exception handling
///
diff --git a/src/BrowserPicker.App/Resources/i18n.Designer.cs b/src/BrowserPicker.App/Resources/i18n.Designer.cs
index 63322e7..4d9eb3c 100644
--- a/src/BrowserPicker.App/Resources/i18n.Designer.cs
+++ b/src/BrowserPicker.App/Resources/i18n.Designer.cs
@@ -322,6 +322,15 @@ public static string CsConfigHyperlinkError {
}
}
+ ///
+ /// 查找类似 The application needs to restart to apply the new language settings. 的本地化字符串。
+ ///
+ public static string CsConfigLanguageChangeRestartMessage {
+ get {
+ return ResourceManager.GetString("CsConfigLanguageChangeRestartMessage", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Open with {0} 的本地化字符串。
///
diff --git a/src/BrowserPicker.App/Resources/i18n.resx b/src/BrowserPicker.App/Resources/i18n.resx
index dbe13e0..d93f4c8 100644
--- a/src/BrowserPicker.App/Resources/i18n.resx
+++ b/src/BrowserPicker.App/Resources/i18n.resx
@@ -454,4 +454,7 @@ The desktop icon will disappear temporarily during the restart process and resum
语言
+
+ The application needs to restart to apply the new language settings.
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
index 28b82b2..ee7cdf0 100644
--- a/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
+++ b/src/BrowserPicker.App/Resources/i18n.zh-CN.resx
@@ -442,4 +442,7 @@
Language
+
+ 应用程序需要重启以应用新的语言设置。
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/View/Configuration.xaml.cs b/src/BrowserPicker.App/View/Configuration.xaml.cs
index 99e933a..9bf753d 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml.cs
+++ b/src/BrowserPicker.App/View/Configuration.xaml.cs
@@ -106,8 +106,8 @@ private void RegisterOpenWith_Click(object sender, RoutedEventArgs e)
try
{
// 1. 优先创建ProgID(系统核心识别项)
- CreateProgId(ProgIdHtml, "HTML文件", isUrl: false);
- CreateProgId(ProgIdUrl, "URL链接", isUrl: true);
+ CreateProgId(ProgIdHtml, "HTML", isUrl: false);
+ CreateProgId(ProgIdUrl, "URL", isUrl: true);
// 2. 注册文件类型(仅User)
foreach (var ext in _fileTypes)
diff --git a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
index 058a40c..da86b53 100644
--- a/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
+++ b/src/BrowserPicker.App/ViewModel/ApplicationViewModel.cs
@@ -13,6 +13,7 @@
using BrowserPicker.Resources;
using System.Globalization;
using System.Text.RegularExpressions;
+using BrowserPicker.View;
#if DEBUG
@@ -33,31 +34,78 @@ public sealed class ApplicationViewModel : ModelBase
private void OnChangeLanguage()
{
- // 获取当前语言
var currentCulture = Thread.CurrentThread.CurrentUICulture;
-
- // 定义支持的语言列表 (这里以英文和中文为例)
var supportedCultures = new[]
{
- new CultureInfo("en"),
- new CultureInfo("zh")
- };
+ new CultureInfo("en-US"),
+ new CultureInfo("zh-CN")
+ };
- // 循环切换到下一个语言
+ // 查找当前语言索引
var currentIndex = Array.IndexOf(supportedCultures,
supportedCultures.FirstOrDefault(c => c.Name.StartsWith(currentCulture.TwoLetterISOLanguageName)) ?? supportedCultures[0]);
+
+ // 计算下一个语言索引
var nextIndex = (currentIndex + 1) % supportedCultures.Length;
+ var nextCulture = supportedCultures[nextIndex];
+
+ // 保存语言设置到配置文件中
+ AppConfigHelper.WriteAppConfig("language", nextCulture.Name);
- // 更改语言
- Thread.CurrentThread.CurrentUICulture = supportedCultures[nextIndex];
- Thread.CurrentThread.CurrentCulture = supportedCultures[nextIndex];
+ ApplyLanguageAndRestart(nextCulture);
+ }
+
+ private void ApplyLanguageAndRestart(CultureInfo culture)
+ {
+ Thread.CurrentThread.CurrentUICulture = culture;
+ Thread.CurrentThread.CurrentCulture = culture;
- // 刷新界面
- OnPropertyChanged(string.Empty); // 通知所有属性更改以刷新界面
+ RestartApplication();
+ }
+
+ private void RestartApplication()
+ {
+ var msg = BrowserPicker.Resources.i18n.CsConfigLanguageChangeRestartMessage;
+ var restart = BrowserPicker.Resources.i18n.UniRestart;
+
+ var result = MessageBox.Show(
+ msg,
+ restart,
+ MessageBoxButton.OK,
+ MessageBoxImage.Information);
+
+ Application.Current.Shutdown();
+ }
+
+ public class AppConfigHelper
+ {
+ public static string ReadAppConfig(string key)
+ {
+ try
+ {
+ System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
+ return config.AppSettings.Settings[key].Value;
+ }
+ catch(Exception)
+ {
+ throw;
+ }
+ }
+
+ public static void WriteAppConfig(string key, string value)
+ {
+ System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
+ if(config.AppSettings.Settings[key] != null)
+ config.AppSettings.Settings[key].Value = value;
+ else
+ config.AppSettings.Settings.Add(key, value);
+ config.Save(System.Configuration.ConfigurationSaveMode.Modified);
+ System.Configuration.ConfigurationManager.RefreshSection("appSettings");
+ }
}
private static readonly ILogger Logger = App.Services.GetRequiredService>();
-
+
#if DEBUG
///
/// Default constructor used for WPF designer support.
@@ -205,7 +253,7 @@ public void Initialize()
.ToList();
Logger.LogAutomationMatchesFound(auto.Count);
-
+
return auto.Count <= 0
? null
: auto.OrderByDescending(o => o.matchLength).First().rule.Browser;
@@ -235,7 +283,7 @@ public void Initialize()
/// Closes the URL editor, saving any changes made to the targeted URL.
///
public ICommand EndEdit => new DelegateCommand(CloseURLEditor);
-
+
///
/// Gets the view model responsible for managing application configuration settings.
/// Provides access to user preferences and saved browser configurations.
@@ -293,7 +341,7 @@ public bool AltPressed
get => alt_pressed;
set => SetProperty(ref alt_pressed, value);
}
-
+
///
/// Pins the window, keeping it around while the user does something else.
///
@@ -308,7 +356,7 @@ public bool Pinned
get => pinned;
private set => SetProperty(ref pinned, value);
}
-
+
///
/// Event triggered to initiate application shutdown.
/// It is wired to the method to terminate the application.
From d0eb7c9a9a24ca84720e635af18377ec35a88dae Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Tue, 16 Dec 2025 02:14:13 +0800
Subject: [PATCH 18/19] 2.2.4.4
---
choose_version.md | 2 +-
readme.md | 2 +-
src/BrowserPicker.App/View/Configuration.xaml.cs | 2 +-
src/BrowserPicker.Windows/BrowserPicker.Windows.csproj | 2 +-
src/Directory.Build.props | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/choose_version.md b/choose_version.md
index 650abef..a687452 100644
--- a/choose_version.md
+++ b/choose_version.md
@@ -1,6 +1,6 @@
# 我应该选择哪个版本?
-你可在 [GitHub](https://github.com/XTsat/BrowserPicker_zh/releases) 上获取最新版本
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker_i18n/releases) 上获取最新版本
## 依赖 .NET 运行时的安装包
diff --git a/readme.md b/readme.md
index e4ab512..5c5f69a 100644
--- a/readme.md
+++ b/readme.md
@@ -10,7 +10,7 @@
## 安装
-你可在 [GitHub](https://github.com/XTsat/BrowserPicker_zh/releases) 上获取最新版本。
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker_i18n/releases) 上获取最新版本。
### 设置默认浏览器
diff --git a/src/BrowserPicker.App/View/Configuration.xaml.cs b/src/BrowserPicker.App/View/Configuration.xaml.cs
index 9bf753d..1a80d91 100644
--- a/src/BrowserPicker.App/View/Configuration.xaml.cs
+++ b/src/BrowserPicker.App/View/Configuration.xaml.cs
@@ -79,7 +79,7 @@ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.
private readonly string _appPath;
private readonly string _appExeName;
- private const string AppName = "BrowserPicker_zh";
+ private const string AppName = "BrowserPicker";
private const string ProgIdHtml = $"{AppName}.html";
private const string ProgIdUrl = $"{AppName}.url";
diff --git a/src/BrowserPicker.Windows/BrowserPicker.Windows.csproj b/src/BrowserPicker.Windows/BrowserPicker.Windows.csproj
index a5d636a..1f7ee73 100644
--- a/src/BrowserPicker.Windows/BrowserPicker.Windows.csproj
+++ b/src/BrowserPicker.Windows/BrowserPicker.Windows.csproj
@@ -1,6 +1,6 @@
- 2.0.0.3
+ 2.2.4.4
enable
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index f50ae7d..b60ce4c 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,10 +1,10 @@
net9.0-windows
- 2.0.0.4
+ 2.2.4.4
-beta1
Runsafe
- Copyright © 2017-2024
+ Copyright © 2017-2025
Debug;Release
x64
True
From 2e23ae35a0b33986166d46bcb781c7a1c9de2e14 Mon Sep 17 00:00:00 2001
From: XTsat <44708609+XTsat@users.noreply.github.com>
Date: Tue, 16 Dec 2025 13:52:42 +0800
Subject: [PATCH 19/19] en-US First
---
readme.md | 267 ++++++++++--------
readme_en.md | 244 ----------------
readme_zh.md | 216 ++++++++++++++
src/BrowserPicker.App/App.config | 2 +-
src/BrowserPicker.App/App.xaml.cs | 7 +-
.../Resources/i18n.Designer.cs | 2 +-
src/BrowserPicker.App/Resources/i18n.resx | 2 +-
7 files changed, 370 insertions(+), 370 deletions(-)
delete mode 100644 readme_en.md
create mode 100644 readme_zh.md
diff --git a/readme.md b/readme.md
index 5c5f69a..046aeb2 100644
--- a/readme.md
+++ b/readme.md
@@ -1,217 +1,244 @@
-# 浏览器选择器(Browser Picker)
+# Browser Picker
-[English](/readme_en.md) | 中文
+English | [中文](/readme_zh.md)
-一款适用于 Windows 系统的默认浏览器替代工具,可让你选择偏好的浏览器,或根据自定义规则自动选择浏览器。
+A default browser replacement for windows to let you pick your preferred browser on the fly or in accordance with your own rules.
-
+
-你可以轻松配置规则:例如用 Firefox 打开 `GitHub.com` 和 `slashdot.org`,用 Edge 处理 `microsoft.com`,甚至可以让 Internet Explorer 打开那款你不想用但又必须使用的旧版内部业务线(LOB)应用。
+You can easily configure it to use Firefox for `github.com` and `slashdot.org`, but leave Edge to handle `microsoft.com`
+and even let Internet Explorer handle that old internal LOB app you'd rather not use but must.
-## 安装
+## Installation
-你可在 [GitHub](https://github.com/XTsat/BrowserPicker_i18n/releases) 上获取最新版本。
+You can find the latest release on [github](https://github.com/mortenn/BrowserPicker/releases).
-### 设置默认浏览器
+### Default browser
-要启用浏览器选择器窗口,需将 “浏览器选择器” 设为系统默认浏览器。
+To enable the browser picker window, you need to set Browser Picker as your default browser.
-手动设置步骤:
+### .NET Runtime dependent binary
-1.从开始菜单打开 “设置” 应用;
-2.进入 “应用” 选项;
-3.选择 “默认应用”;
-4.将 “网页浏览器” 改为 “浏览器选择器”。
- **注意**:执行此操作前,请确保 “浏览器选择器” 可正常启动。
+BrowserPicker.msi and Dependent.zip are JIT compiled and require you have the [.NET 9.0 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) installed.
+Direct links: [64bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer), [32bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer).
-## 使用方法
+#### Native image generation
-当你在浏览器外打开链接时,会按以下优先级触发操作:
+As part of installation, `BrowserPicker.msi` will execute ngen to build a native image for your computer.
+This significantly enhances launch times for the executable.
+If you prefer the bundle, you may run `ngen install BrowserPicker.exe` to get the same benefit.
-1. 若此前选择过 **始终询问**,则显示浏览器选择窗口
-2. 若已配置与当前链接匹配的规则,则用指定浏览器打开该链接
-3. 若仅有一个浏览器处于运行状态,则在该浏览器中打开链接
-4. 若已配置默认浏览器,则调用默认浏览器打开链接
-5. 若以上情况均不满足,则显示简易窗口,让你选择要使用的浏览器
+### Portable binary
-链接地址会显示在窗口顶部:若该地址属于已知短链接服务,浏览器选择器会在短暂延迟后解析真实地址并显示。
-若你不希望浏览器选择器执行此操作(该操作需连接网络),可在设置中禁用此功能。
+If you do not want to have the .net runtime installed on your computer, you may download the Portable version, which includes the runtime.
-### 复制链接
+`BrowserPicker-Portable.msi` and `Portable.zip` contain a win-x64 binary executable with embedded .NET runtime.
+This makes the file sizes quite significantly larger, but you do not need an additional runtime to use these.
-点击窗口顶部的剪贴板图标,可复制链接地址而不打开链接。
+### Signing certificate
-### 编辑链接
+To avoid warnings about unknown publisher, you may [import](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates) the provided certificate into your certificate store first.
-点击窗口顶部的铅笔图标,可在访问或取消访问链接前编辑或复制链接地址:
+### Manual steps
-
+You need to open the settings app from the start menu, navigate into Apps, select Default apps, then change the Web browser to BrowserPicker.
+Please ensure BrowserPicker can be started before you do this.
-### 键盘快捷键
+## Usage
-当浏览器选择窗口处于打开并获得焦点的状态时,可使用以下快捷键:
-按住 [Alt] 键并按下数字键,可在隐私模式下打开对应浏览器。
+When you open a link outside a browser, one of these things will happen, in order:
-- [Enter] 或 [1]:选择列表中的第一个浏览器
-- [2]:选择列表中的第二个浏览器
-- ...
-- [9]:选择列表中的第九个浏览器
-- [Esc]:取消操作并关闭窗口
+1. If you have previously selected `Always ask`, the browser selection window is shown.
+2. If you have set up a configuration rule matching the url being opened, the selected browser will be launched with the url.
+3. If you only have one browser running, the link will be opened in that browser.
+4. If you have configured a default browser, it will be asked to open the url.
+5. Otherwise, you will be presented with a simple window asking you which browser you want to use.
-若点击窗口外部导致窗口失去焦点,窗口会关闭且不会用任何浏览器打开链接。
+The url is shown at the top of the window, and if it matches a list of known url shorteners, BrowserPicker will expand this address and show you the real one after a short delay.
+If you do not want BrowserPicker to perform this operation (it will call the internet), you may disable this feature in the settings.
-当前处于运行状态的浏览器,其名称会以粗体显示;未运行的浏览器,名称会以斜体显示。
+### Copy url
-在你使用该应用的过程中,它会统计你选择各浏览器的次数,并根据这些数据自动按你的偏好顺序排列浏览器列表。
+You can click the clipboard icon at the top to copy the url without opening it
-窗口底部有一个 **始终询问** 复选框,以及一个用于打开设置界面的超链接。
+### Edit url
-## 设置
+You can click the pencil icon at the top of the window to edit or copy the url before visiting it or cancelling:
-从开始菜单启动 “浏览器选择器”,或双击 `BrowserPicker.exe` 文件,即可打开图形化界面(GUI)配置其行为。
+
+
-配置信息保存在 Windows 注册表中,路径为 `HKEY_CURRENT_USER\Software\BrowserPicker`,你可在此路径下手动编辑配置或创建备份。
+### Keyboard shortcuts
-
+When this window is open and has focus, you can use the following keyboard shortcuts:
-### 浏览器
+`[enter]` or `[1]` Pick the first browser in the list
-浏览器列表显示 “浏览器选择器” 已配置或检测到的可用浏览器。
+`[2]` Pick the second browser in the list
-#### 禁用浏览器
+...
-点击 **已启用(Enabled)** 可禁用对应浏览器,禁用后该浏览器会从选择列表中隐藏。
+`[9]` Pick the ninth browser in the list
-#### 删除浏览器
+If you keep `[alt]` pressed while hitting one of these, the browser will be opened in privacy mode.
-点击红色 “X” 图标可删除对应浏览器。
+`[esc]` Abort and close window
-注意:若该浏览器是自动检测到的,下次执行自动配置时会重新出现在列表中。
+If you click outside the window such that it loses focus, it will close without opening the url in any browser.
-#### 自动配置
+Each browser that supports it, has a blue shield button on the right side.
+Browsers currently supporting privacy mode are firefox, internet explorer, chrome, and edge.
-使用 “浏览器选择器” 时,**刷新浏览器列表** 功能会在后台自动执行,帮助检测新安装的浏览器。
+Currently running browsers will have their name in bold, whilst browsers not currently running will have their names in cursive.
-#### 手动添加浏览器
+As you use the application, it keeps count of how many times you selected each browser. This information is used to show you your browsers in your preferred order automatically.
-点击 **添加浏览器** 超链接,会弹出一个窗口,你可在此手动添加未被检测到的浏览器,或添加非浏览器类工具。
-点击输入框后方的按钮,可打开 Windows 文件选择界面,选择要使用的可执行文件或图标文件。
+At the bottom of the window, there is a checkbox to enable "always ask" and a hyperlink to open settings.
-
+## Settings
+By simply launching BrowserPicker from the start menu or double clicking the `BrowserPicker.exe` file, you will be presented with a GUI to configure the behaviour.
+The configuration is saved in the Windows registry: `HKEY_CURRENT_USER\Software\BrowserPicker`, if you ever need to manually edit it or make a backup.
-若你先选择可执行文件,应用会默认该文件包含图标,并自动填充图标文件输入框。
+
-应用名称会尝试根据可执行文件中的信息自动设置。
+### Browsers
-##### chromium 配置文件
+The browser list shows you the browsers BrowserPicker has been configured or detected to use.
-chromium 内核浏览器用户提示:若你使用多个配置文件,默认情况下选择浏览器时,会使用上次启动时的配置文件。
+#### Disabling browsers
-若想让浏览器选择器能指定配置文件,可为每个配置文件创建一个 “新浏览器” 条目:将程序路径设为 Chrome / Edge 可执行文件,并添加命令行参数指定要启动的配置文件,例如:
+You can disable a browser by clicking `Enabled`, this will hide the browser from the selection list.
-- 第一个配置文件:`--profile-directory=Default`
-- 第二个配置文件:`--profile-directory="Profile 1"`
-- 第三个配置文件:`--profile-directory="Profile 2"`
- 以此类推。
+
-注意:含空格的参数需用英文双引号(" ")包裹,才能正确传递给 Chrome。
+#### Removing browsers
-##### Firefox 配置文件
+If you click the red X, you may remove a browser.
-Firefox 也支持类似的配置文件设置。
+Do note that if it was automatically detected, it will return to the list the next time auto configuration is performed.
-### 设置
+#### Automatic configuration
-此标签页包含控制 “浏览器选择器” 运行方式的各类设置。
+The `Refresh broser list` function gets automatically executed in the background when you use BrowserPicker.
+This helps it discovering newly installed browsers, in case a new browser has been installed,
-
+#### Manually adding browser
-> [ ] 使用纯黑背景
+You may click the hyperlink `Add browser` to open a popup where you may manually add a browser that has not been detected - or some other tool that isn't a browser.
-勾选后,浏览器选择器会使用纯色黑色背景。
+You can click the buttons behind the input boxes to bring up the file picker interface of windows to select the executable or icon file you want to use.
-> [ ] 始终显示浏览器选择窗口
+
+
-此选项在浏览器选择窗口中也可设置。启用后,浏览器选择器会始终提示你选择浏览器。
+
-> [ ] 当无匹配链接的默认浏览器时,使用:[__v]
+If you browse for the command first, the application will assume the executable also has an icon, and prefill that box.
-配置后,除非为当前链接设置了默认浏览器,否则浏览器选择器会始终使用此处指定的浏览器。
+The name of the application will be attempted to be set automatically based on information in the executable.
-> [ ] 即使浏览器未运行也使用默认设置
+##### Chrome profiles
-启用此选项后,浏览器选择器仅会使用匹配的默认浏览器;若无匹配项,则显示选择窗口。
+Tip for Chrome Users: If you are using multiple Chrome profiles, by default if you choose Chrome it will launch in the last
+profile you launched Chrome with. To make it possibe for browser picker to select a profile you can create a new browser
+for each profile, set the program to the chrome executable, and add a command line argument to specify which profile to launch:
+`--profile-directory=Default` for the first profile, `--profile-directory="Profile 1"` for the second profile, and so on.
-> [ ] 禁用链接解析
->
-> [ ] 浏览器未运行时忽略默认设置
+Please note that arguments with spaces do require "" around them to be properly passed to chrome.
+
+##### Firefox profiles
+
+Similar configuration should be possible for firefox.
+
+### Behaviour
+
+This tab contains various settings that govern how BrowserPicker operates.
+
+
+
+> [ ] Turn off transparency
-启用后,已配置的默认浏览器仅在处于运行状态时才生效。
+This will make BrowserPicker have a simple black background, to help with legibility
-> [ ] 根据使用情况更新浏览器列表顺序
+> [ ] Always show browser selection window
-启用后,浏览器列表会根据你的选择频率自动排序。
+This option is also available on the browser selection window. When enabled, BrowserPicker will always ask the user to make a choice.
+
+> [ ] When no default is configured matching the url, use: [__v]
+
+When configured, BrowserPicker will always use this browser unless a default browser has been configured for that url.
+
+> [ ] Always ask when no default is matching url
+
+This option makes it so BrowserPicker will only pick matched default browsers and otherwise show the selection window.
+
+> [ ] Disable url resolution
+>
+> [ ] Ignore defaults when browser is not running
-> [ ] 禁止网络活动
+When enabled, configured default browsers only apply when they are already running.
-浏览器选择器可能会通过 DNS 查询和 HTTP 请求探测链接,以检查该链接是否存在重定向。
+> [ ] Update order in browser list based on usage
-勾选此选项可关闭该功能,避免浏览器选择器在打开链接时连接网络。
+This option will make your list of browsers automatically sorted by how often you pick them.
-> 链接解析超时时间:[___]
+> [ ] Disallow network activity
-在此处调整浏览器选择器尝试解析链接的最长时间。
+BrowserPicker may perform DNS and HTTP calls to probe the specified url in order to check if the url redirects elsewhere.
+This option turns this feature off, preventing BrowserPicker to call the network when you launch a url.
-### 浏览器匹配
+> URL resolution timeout: [_____]
-此标签页可配置规则,将特定链接与指定浏览器关联。
+You may adjust for how long BrowserPicker attempts to resolve an url here.
-
+### Defaults
-#### 匹配类型
+The defaults tab lets you configure rules to map certain urls to certain browsers.
-共有四种匹配类型,其中 **默认(Default)** 类型为预留选项,暂不可用。该选项最终会从界面中隐藏,目前选择后会自动转为 **主机名(Hostname)** 匹配类型。
+
-
+#### Match types
-##### 主机名匹配(Hostname match)
+There exists four different match types, but you cannot use Default, that is reserved for use elsewhere.
+The option will eventually get hidden in the interface, but for now it becomes Hostname when selected.
-规则会匹配链接 **主机名** 部分的末尾。
+
-例如,`hub.com` 会匹配 `https://www.github.com/mortenn/BrowserPicker`,但不会匹配 `https://example.com/cgi-bin/hub.com`
+##### Hostname match
-##### 前缀匹配(Prefix match)
+The pattern will match the end of the hostname part of the url, ie. `hub.com` would match `https://www.github.com/mortenn/BrowserPicker`, but not `https://example.com/cgi-bin/hub.com`
-规则会匹配链接的开头。例如,`https://github.com/mortenn` 会匹配 `https://github.com/mortenn/BrowserPicker`,但不会匹配 `https://www.github.com/mortenn/BrowserPicker`
+##### Prefix match
-##### 正则表达式匹配(Regex match)
+The pattern will match the beginning of the url, ie. `https://github.com/mortenn` would match `https://github.com/mortenn/BrowserPicker` but not `https://www.github.com/mortenn/BrowserPicker`
-规则使用 .NET 正则表达式,会对整个链接执行匹配。详情可参考 [.NET 正则表达式文档](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions)。
+##### Regex match
-#### 匹配浏览器
+The pattern is a .NET regular expression and will be executed against the url, see [.NET regular expressions](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions) for details.
-选择匹配链接后要启动的浏览器。
+#### Browser
-
+The selected browser will be the one to launch for matched urls.
-### 测试默认规则
+
-界面提供了便捷的规则验证工具:
-在白色文本框中粘贴链接,即可即时查看浏览器选择结果(验证规则是否生效):
+### Test defaults
-
+There is even a handy dandy tool for verifying your settings,
+just paste that url into the big white text box and get instant feedback on the browser selection process:
-### 日志
+
-浏览器选择器使用 ILogger 记录日志,并支持事件日志(EventLog)功能。
+### Logging
-如需详细日志,可通过以下两种方式操作:
+BrowserPicker uses ILogger with EventLog support.
-- 修改 appsettings.json 文件
-- 将环境变量 `Logging__EventLog__LogLevel__BrowserPicker` 设置为 **Information(信息级)** 或 **Debug(调试级)**。
+To get detailed logs, please either change appsettings.json or set the environment variable `Logging__EventLog__LogLevel__BrowserPicker` to either `Information` or `Debug`
+By default, only warnings or higher level events get logged.
-默认情况下,仅记录警告(Warning)及更高级别的事件。
+If you are using the archived version rather than the installer package,
+you will need to run this powershell command before logs will appear:
-若你使用的是压缩包版本(非安装包),需先运行以下 PowerShell 命令,日志才能正常显示:
-`New-EventLog -LogName Application -Source BrowserPicker`
+```New-EventLog -LogName Application -Source BrowserPicker```
+`
diff --git a/readme_en.md b/readme_en.md
deleted file mode 100644
index cbc1cca..0000000
--- a/readme_en.md
+++ /dev/null
@@ -1,244 +0,0 @@
-# Browser Picker
-
-English | [中文](/readme.md)
-
-A default browser replacement for windows to let you pick your preferred browser on the fly or in accordance with your own rules.
-
-
-
-You can easily configure it to use Firefox for `github.com` and `slashdot.org`, but leave Edge to handle `microsoft.com`
-and even let Internet Explorer handle that old internal LOB app you'd rather not use but must.
-
-## Installation
-
-You can find the latest release on [github](https://github.com/mortenn/BrowserPicker/releases).
-
-### Default browser
-
-To enable the browser picker window, you need to set Browser Picker as your default browser.
-
-### .NET Runtime dependent binary
-
-BrowserPicker.msi and Dependent.zip are JIT compiled and require you have the [.NET 9.0 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) installed.
-Direct links: [64bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x64-installer), [32bit systems](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-9.0.3-windows-x86-installer).
-
-#### Native image generation
-
-As part of installation, `BrowserPicker.msi` will execute ngen to build a native image for your computer.
-This significantly enhances launch times for the executable.
-If you prefer the bundle, you may run `ngen install BrowserPicker.exe` to get the same benefit.
-
-### Portable binary
-
-If you do not want to have the .net runtime installed on your computer, you may download the Portable version, which includes the runtime.
-
-`BrowserPicker-Portable.msi` and `Portable.zip` contain a win-x64 binary executable with embedded .NET runtime.
-This makes the file sizes quite significantly larger, but you do not need an additional runtime to use these.
-
-### Signing certificate
-
-To avoid warnings about unknown publisher, you may [import](https://stackoverflow.com/questions/49039136/powershell-script-to-install-trusted-publisher-certificates) the provided certificate into your certificate store first.
-
-### Manual steps
-
-You need to open the settings app from the start menu, navigate into Apps, select Default apps, then change the Web browser to BrowserPicker.
-Please ensure BrowserPicker can be started before you do this.
-
-## Usage
-
-When you open a link outside a browser, one of these things will happen, in order:
-
-1. If you have previously selected `Always ask`, the browser selection window is shown.
-2. If you have set up a configuration rule matching the url being opened, the selected browser will be launched with the url.
-3. If you only have one browser running, the link will be opened in that browser.
-4. If you have configured a default browser, it will be asked to open the url.
-5. Otherwise, you will be presented with a simple window asking you which browser you want to use.
-
-The url is shown at the top of the window, and if it matches a list of known url shorteners, BrowserPicker will expand this address and show you the real one after a short delay.
-If you do not want BrowserPicker to perform this operation (it will call the internet), you may disable this feature in the settings.
-
-### Copy url
-
-You can click the clipboard icon at the top to copy the url without opening it
-
-### Edit url
-
-You can click the pencil icon at the top of the window to edit or copy the url before visiting it or cancelling:
-
-
-
-
-### Keyboard shortcuts
-
-When this window is open and has focus, you can use the following keyboard shortcuts:
-
-`[enter]` or `[1]` Pick the first browser in the list
-
-`[2]` Pick the second browser in the list
-
-...
-
-`[9]` Pick the ninth browser in the list
-
-If you keep `[alt]` pressed while hitting one of these, the browser will be opened in privacy mode.
-
-`[esc]` Abort and close window
-
-If you click outside the window such that it loses focus, it will close without opening the url in any browser.
-
-Each browser that supports it, has a blue shield button on the right side.
-Browsers currently supporting privacy mode are firefox, internet explorer, chrome, and edge.
-
-Currently running browsers will have their name in bold, whilst browsers not currently running will have their names in cursive.
-
-As you use the application, it keeps count of how many times you selected each browser. This information is used to show you your browsers in your preferred order automatically.
-
-At the bottom of the window, there is a checkbox to enable "always ask" and a hyperlink to open settings.
-
-## Settings
-
-By simply launching BrowserPicker from the start menu or double clicking the `BrowserPicker.exe` file, you will be presented with a GUI to configure the behaviour.
-The configuration is saved in the Windows registry: `HKEY_CURRENT_USER\Software\BrowserPicker`, if you ever need to manually edit it or make a backup.
-
-
-
-### Browsers
-
-The browser list shows you the browsers BrowserPicker has been configured or detected to use.
-
-#### Disabling browsers
-
-You can disable a browser by clicking `Enabled`, this will hide the browser from the selection list.
-
-
-
-#### Removing browsers
-
-If you click the red X, you may remove a browser.
-
-Do note that if it was automatically detected, it will return to the list the next time auto configuration is performed.
-
-#### Automatic configuration
-
-The `Refresh broser list` function gets automatically executed in the background when you use BrowserPicker.
-This helps it discovering newly installed browsers, in case a new browser has been installed,
-
-#### Manually adding browser
-
-You may click the hyperlink `Add browser` to open a popup where you may manually add a browser that has not been detected - or some other tool that isn't a browser.
-
-You can click the buttons behind the input boxes to bring up the file picker interface of windows to select the executable or icon file you want to use.
-
-
-
-
-
-
-If you browse for the command first, the application will assume the executable also has an icon, and prefill that box.
-
-The name of the application will be attempted to be set automatically based on information in the executable.
-
-##### Chrome profiles
-
-Tip for Chrome Users: If you are using multiple Chrome profiles, by default if you choose Chrome it will launch in the last
-profile you launched Chrome with. To make it possibe for browser picker to select a profile you can create a new browser
-for each profile, set the program to the chrome executable, and add a command line argument to specify which profile to launch:
-`--profile-directory=Default` for the first profile, `--profile-directory="Profile 1"` for the second profile, and so on.
-
-Please note that arguments with spaces do require "" around them to be properly passed to chrome.
-
-##### Firefox profiles
-
-Similar configuration should be possible for firefox.
-
-### Behaviour
-
-This tab contains various settings that govern how BrowserPicker operates.
-
-
-
-> [ ] Turn off transparency
-
-This will make BrowserPicker have a simple black background, to help with legibility
-
-> [ ] Always show browser selection window
-
-This option is also available on the browser selection window. When enabled, BrowserPicker will always ask the user to make a choice.
-
-> [ ] When no default is configured matching the url, use: [__v]
-
-When configured, BrowserPicker will always use this browser unless a default browser has been configured for that url.
-
-> [ ] Always ask when no default is matching url
-
-This option makes it so BrowserPicker will only pick matched default browsers and otherwise show the selection window.
-
-> [ ] Disable url resolution
->
-> [ ] Ignore defaults when browser is not running
-
-When enabled, configured default browsers only apply when they are already running.
-
-> [ ] Update order in browser list based on usage
-
-This option will make your list of browsers automatically sorted by how often you pick them.
-
-> [ ] Disallow network activity
-
-BrowserPicker may perform DNS and HTTP calls to probe the specified url in order to check if the url redirects elsewhere.
-This option turns this feature off, preventing BrowserPicker to call the network when you launch a url.
-
-> URL resolution timeout: [_____]
-
-You may adjust for how long BrowserPicker attempts to resolve an url here.
-
-### Defaults
-
-The defaults tab lets you configure rules to map certain urls to certain browsers.
-
-
-
-#### Match types
-
-There exists four different match types, but you cannot use Default, that is reserved for use elsewhere.
-The option will eventually get hidden in the interface, but for now it becomes Hostname when selected.
-
-
-
-##### Hostname match
-
-The pattern will match the end of the hostname part of the url, ie. `hub.com` would match `https://www.github.com/mortenn/BrowserPicker`, but not `https://example.com/cgi-bin/hub.com`
-
-##### Prefix match
-
-The pattern will match the beginning of the url, ie. `https://github.com/mortenn` would match `https://github.com/mortenn/BrowserPicker` but not `https://www.github.com/mortenn/BrowserPicker`
-
-##### Regex match
-
-The pattern is a .NET regular expression and will be executed against the url, see [.NET regular expressions](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions) for details.
-
-#### Browser
-
-The selected browser will be the one to launch for matched urls.
-
-
-
-### Test defaults
-
-There is even a handy dandy tool for verifying your settings,
-just paste that url into the big white text box and get instant feedback on the browser selection process:
-
-
-
-### Logging
-
-BrowserPicker uses ILogger with EventLog support.
-
-To get detailed logs, please either change appsettings.json or set the environment variable `Logging__EventLog__LogLevel__BrowserPicker` to either `Information` or `Debug`
-By default, only warnings or higher level events get logged.
-
-If you are using the archived version rather than the installer package,
-you will need to run this powershell command before logs will appear:
-
-```New-EventLog -LogName Application -Source BrowserPicker```
-`
diff --git a/readme_zh.md b/readme_zh.md
new file mode 100644
index 0000000..2f3bd70
--- /dev/null
+++ b/readme_zh.md
@@ -0,0 +1,216 @@
+# 浏览器选择器(Browser Picker)
+
+[English](/readme.md) | 中文
+
+一款适用于 Windows 系统的默认浏览器替代工具,可让你选择偏好的浏览器,或根据自定义规则自动选择浏览器。
+
+
+
+你可以轻松配置规则:例如用 Firefox 打开 `GitHub.com` 和 `slashdot.org`,用 Edge 处理 `microsoft.com`,甚至可以让 Internet Explorer 打开那款你不想用但又必须使用的旧版内部业务线(LOB)应用。
+
+## 安装
+
+你可在 [GitHub](https://github.com/XTsat/BrowserPicker_i18n/releases) 上获取最新版本。
+
+### 设置默认浏览器
+
+要启用浏览器选择器窗口,需将 “浏览器选择器” 设为系统默认浏览器。
+
+手动设置步骤:
+
+1.从开始菜单打开 “设置” 应用;
+2.进入 “应用” 选项;
+3.选择 “默认应用”;
+4.将 “网页浏览器” 改为 “浏览器选择器”。
+ **注意**:执行此操作前,请确保 “浏览器选择器” 可正常启动。
+
+## 使用方法
+
+当你在浏览器外打开链接时,会按以下优先级触发操作:
+
+1. 若此前选择过 **始终询问**,则显示浏览器选择窗口
+2. 若已配置与当前链接匹配的规则,则用指定浏览器打开该链接
+3. 若仅有一个浏览器处于运行状态,则在该浏览器中打开链接
+4. 若已配置默认浏览器,则调用默认浏览器打开链接
+5. 若以上情况均不满足,则显示简易窗口,让你选择要使用的浏览器
+
+链接地址会显示在窗口顶部:若该地址属于已知短链接服务,浏览器选择器会在短暂延迟后解析真实地址并显示。
+若你不希望浏览器选择器执行此操作(该操作需连接网络),可在设置中禁用此功能。
+
+### 复制链接
+
+点击窗口顶部的剪贴板图标,可复制链接地址而不打开链接。
+
+### 编辑链接
+
+点击窗口顶部的铅笔图标,可在访问或取消访问链接前编辑或复制链接地址:
+
+
+
+### 键盘快捷键
+
+当浏览器选择窗口处于打开并获得焦点的状态时,可使用以下快捷键:
+按住 [Alt] 键并按下数字键,可在隐私模式下打开对应浏览器。
+
+- [Enter] 或 [1]:选择列表中的第一个浏览器
+- [2]:选择列表中的第二个浏览器
+- ...
+- [9]:选择列表中的第九个浏览器
+- [Esc]:取消操作并关闭窗口
+
+若点击窗口外部导致窗口失去焦点,窗口会关闭且不会用任何浏览器打开链接。
+
+当前处于运行状态的浏览器,其名称会以粗体显示;未运行的浏览器,名称会以斜体显示。
+
+在你使用该应用的过程中,它会统计你选择各浏览器的次数,并根据这些数据自动按你的偏好顺序排列浏览器列表。
+
+窗口底部有一个 **始终询问** 复选框,以及一个用于打开设置界面的超链接。
+
+## 设置
+
+从开始菜单启动 “浏览器选择器”,或双击 `BrowserPicker.exe` 文件,即可打开图形化界面(GUI)配置其行为。
+
+配置信息保存在 Windows 注册表中,路径为 `HKEY_CURRENT_USER\Software\BrowserPicker`,你可在此路径下手动编辑配置或创建备份。
+
+
+
+### 浏览器
+
+浏览器列表显示 “浏览器选择器” 已配置或检测到的可用浏览器。
+
+#### 禁用浏览器
+
+点击 **已启用(Enabled)** 可禁用对应浏览器,禁用后该浏览器会从选择列表中隐藏。
+
+#### 删除浏览器
+
+点击红色 “X” 图标可删除对应浏览器。
+
+注意:若该浏览器是自动检测到的,下次执行自动配置时会重新出现在列表中。
+
+#### 自动配置
+
+使用 “浏览器选择器” 时,**刷新浏览器列表** 功能会在后台自动执行,帮助检测新安装的浏览器。
+
+#### 手动添加浏览器
+
+点击 **添加浏览器** 超链接,会弹出一个窗口,你可在此手动添加未被检测到的浏览器,或添加非浏览器类工具。
+点击输入框后方的按钮,可打开 Windows 文件选择界面,选择要使用的可执行文件或图标文件。
+
+
+
+若你先选择可执行文件,应用会默认该文件包含图标,并自动填充图标文件输入框。
+
+应用名称会尝试根据可执行文件中的信息自动设置。
+
+##### chromium 配置文件
+
+chromium 内核浏览器用户提示:若你使用多个配置文件,默认情况下选择浏览器时,会使用上次启动时的配置文件。
+
+若想让浏览器选择器能指定配置文件,可为每个配置文件创建一个 “新浏览器” 条目:将程序路径设为 Chrome / Edge 可执行文件,并添加命令行参数指定要启动的配置文件,例如:
+
+- 第一个配置文件:`--profile-directory=Default`
+- 第二个配置文件:`--profile-directory="Profile 1"`
+- 第三个配置文件:`--profile-directory="Profile 2"`
+ 以此类推。
+
+注意:含空格的参数需用英文双引号(" ")包裹,才能正确传递给 Chrome。
+
+##### Firefox 配置文件
+
+Firefox 也支持类似的配置文件设置。
+
+### 设置
+
+此标签页包含控制 “浏览器选择器” 运行方式的各类设置。
+
+
+
+> [ ] 使用纯黑背景
+
+勾选后,浏览器选择器会使用纯色黑色背景。
+
+> [ ] 始终显示浏览器选择窗口
+
+此选项在浏览器选择窗口中也可设置。启用后,浏览器选择器会始终提示你选择浏览器。
+
+> [ ] 当无匹配链接的默认浏览器时,使用:[__v]
+
+配置后,除非为当前链接设置了默认浏览器,否则浏览器选择器会始终使用此处指定的浏览器。
+
+> [ ] 即使浏览器未运行也使用默认设置
+
+启用此选项后,浏览器选择器仅会使用匹配的默认浏览器;若无匹配项,则显示选择窗口。
+
+> [ ] 禁用链接解析
+>
+> [ ] 浏览器未运行时忽略默认设置
+
+启用后,已配置的默认浏览器仅在处于运行状态时才生效。
+
+> [ ] 根据使用情况更新浏览器列表顺序
+
+启用后,浏览器列表会根据你的选择频率自动排序。
+
+> [ ] 禁止网络活动
+
+浏览器选择器可能会通过 DNS 查询和 HTTP 请求探测链接,以检查该链接是否存在重定向。
+
+勾选此选项可关闭该功能,避免浏览器选择器在打开链接时连接网络。
+
+> 链接解析超时时间:[___]
+
+在此处调整浏览器选择器尝试解析链接的最长时间。
+
+### 浏览器匹配
+
+此标签页可配置规则,将特定链接与指定浏览器关联。
+
+
+
+#### 匹配类型
+
+共有四种匹配类型,其中 **默认(Default)** 类型为预留选项,暂不可用。该选项最终会从界面中隐藏,目前选择后会自动转为 **主机名(Hostname)** 匹配类型。
+
+
+
+##### 主机名匹配(Hostname match)
+
+规则会匹配链接 **主机名** 部分的末尾。
+
+例如,`hub.com` 会匹配 `https://www.github.com/mortenn/BrowserPicker`,但不会匹配 `https://example.com/cgi-bin/hub.com`
+
+##### 前缀匹配(Prefix match)
+
+规则会匹配链接的开头。例如,`https://github.com/mortenn` 会匹配 `https://github.com/mortenn/BrowserPicker`,但不会匹配 `https://www.github.com/mortenn/BrowserPicker`
+
+##### 正则表达式匹配(Regex match)
+
+规则使用 .NET 正则表达式,会对整个链接执行匹配。详情可参考 [.NET 正则表达式文档](https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions)。
+
+#### 匹配浏览器
+
+选择匹配链接后要启动的浏览器。
+
+
+
+### 测试默认规则
+
+界面提供了便捷的规则验证工具:
+在白色文本框中粘贴链接,即可即时查看浏览器选择结果(验证规则是否生效):
+
+
+
+### 日志
+
+浏览器选择器使用 ILogger 记录日志,并支持事件日志(EventLog)功能。
+
+如需详细日志,可通过以下两种方式操作:
+
+- 修改 appsettings.json 文件
+- 将环境变量 `Logging__EventLog__LogLevel__BrowserPicker` 设置为 **Information(信息级)** 或 **Debug(调试级)**。
+
+默认情况下,仅记录警告(Warning)及更高级别的事件。
+
+若你使用的是压缩包版本(非安装包),需先运行以下 PowerShell 命令,日志才能正常显示:
+`New-EventLog -LogName Application -Source BrowserPicker`
diff --git a/src/BrowserPicker.App/App.config b/src/BrowserPicker.App/App.config
index d5ce1ff..3be2f22 100644
--- a/src/BrowserPicker.App/App.config
+++ b/src/BrowserPicker.App/App.config
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/src/BrowserPicker.App/App.xaml.cs b/src/BrowserPicker.App/App.xaml.cs
index e9af28e..920103b 100644
--- a/src/BrowserPicker.App/App.xaml.cs
+++ b/src/BrowserPicker.App/App.xaml.cs
@@ -46,9 +46,9 @@ private class InvalidUTF8Patch : EncodingProvider
public App()
{
- //var culture = new CultureInfo("en-US");
- //Thread.CurrentThread.CurrentCulture = culture;
- //Thread.CurrentThread.CurrentUICulture = culture;
+ var culture = new CultureInfo("en-US");
+ Thread.CurrentThread.CurrentCulture = culture;
+ Thread.CurrentThread.CurrentUICulture = culture;
Encoding.RegisterProvider(new InvalidUTF8Patch());
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -81,6 +81,7 @@ protected override void OnStartup(StartupEventArgs e)
var worker = StartupBackgroundTasks();
worker.ContinueWith(CheckBackgroundTasks);
}
+
private void LoadSavedLanguage()
{
try
diff --git a/src/BrowserPicker.App/Resources/i18n.Designer.cs b/src/BrowserPicker.App/Resources/i18n.Designer.cs
index 4d9eb3c..52d9894 100644
--- a/src/BrowserPicker.App/Resources/i18n.Designer.cs
+++ b/src/BrowserPicker.App/Resources/i18n.Designer.cs
@@ -878,7 +878,7 @@ public static string TopNameExit {
}
///
- /// 查找类似 语言 的本地化字符串。
+ /// 查找类似 Language 的本地化字符串。
///
public static string TopNameLanguage {
get {
diff --git a/src/BrowserPicker.App/Resources/i18n.resx b/src/BrowserPicker.App/Resources/i18n.resx
index d93f4c8..18460ff 100644
--- a/src/BrowserPicker.App/Resources/i18n.resx
+++ b/src/BrowserPicker.App/Resources/i18n.resx
@@ -452,7 +452,7 @@ The desktop icon will disappear temporarily during the restart process and resum
Failed to restart the explorer, it is recommended to restart the computer to take effect
- 语言
+ Language
The application needs to restart to apply the new language settings.