The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
feat(i18n): 改用 Crowdin 管理全部译文
XiaoYouChR2f22baffa80d
diff --git "a/.github/DISCUSSION_TEMPLATE/\347\277\273\350\257\221-translations.yml" "b/.github/DISCUSSION_TEMPLATE/\347\277\273\350\257\221-translations.yml"new file mode 100644index 00000000..df1dc180--- /dev/null+++ "b/.github/DISCUSSION_TEMPLATE/\347\277\273\350\257\221-translations.yml"@@ -0,0 +1,15 @@+title: "[Language] "+body:+- type: markdown+ attributes:+ value: |+ 译文只在 [Crowdin](https://gdi18n.xychr.com) 上修改,请不要上传 `.ts`、`messages.json` 等翻译文件。如果你的语言已经在 Crowdin 上,直接去翻译即可,不必申请。+ Translations are edited on [Crowdin](https://gdi18n.xychr.com) only, so please don't attach `.ts`, `messages.json` or other translation files. If your language is already on Crowdin, just start translating there; no request is needed.++- type: input+ id: language+ attributes:+ label: 语言 / Language+ description: 例如 Turkish (Türkçe) / e.g. Turkish (Türkçe)+ validations:+ required: truediff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex b573360b..f77b9254 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -273,18 +273,7 @@ jobs:- name: Download Inno Setup Translation Filesif: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.package_installer == 'true' }}- run: |- $langs = @(- "ChineseSimplified",- "ChineseTraditional",- "Japanese",- "Russian",- "Spanish",- "BrazilianPortuguese"- )- foreach ($lang in $langs) {- Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/${lang}.isl" -OutFile "C:\Program Files (x86)\Inno Setup 6\Languages\${lang}.isl"- }+ run: uv run --no-sync python scripts/fetch_installer_languages.py- name: Build Installerif: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.package_installer == 'true' }}diff --git a/.github/workflows/crowdin-browser.yml b/.github/workflows/crowdin-browser.ymldeleted file mode 100644index 28721eae..00000000--- a/.github/workflows/crowdin-browser.yml+++ /dev/null@@ -1,81 +0,0 @@-name: Sync Crowdin (Browser Extension)--on:- workflow_dispatch:- inputs:- operation:- description: "Choose which Crowdin sync operation to run"- required: true- default: push- type: choice- options:- - push- - pull--permissions:- contents: write- pull-requests: write--concurrency:- group: crowdin-browser-sync- cancel-in-progress: true--jobs:- sync-crowdin:- name: Sync Crowdin (Browser Extension)- runs-on: ubuntu-latest- env:- CROWDIN_BROWSER_PROJECT_ID: ${{ secrets.CROWDIN_BROWSER_PROJECT_ID }}- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}- steps:- - name: Checkout- uses: actions/checkout@v7- with:- fetch-depth: 0-- - name: Validate Crowdin secrets- run: |- test -n "$CROWDIN_BROWSER_PROJECT_ID" || (echo "Missing CROWDIN_BROWSER_PROJECT_ID secret" && exit 1)- test -n "$CROWDIN_PERSONAL_TOKEN" || (echo "Missing CROWDIN_PERSONAL_TOKEN secret" && exit 1)-- - name: Upload sources and translations- if: github.event.inputs.operation == 'push'- uses: crowdin/github-action@v2- with:- config: crowdin-browser.yml- upload_sources: true- upload_translations: true- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}-- - name: Download translations- if: github.event.inputs.operation == 'pull'- uses: crowdin/github-action@v2- with:- config: crowdin-browser.yml- download_translations: true- push_translations: false- create_pull_request: false- skip_ref_checkout: true- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}-- - name: Create translation pull request- if: github.event.inputs.operation == 'pull'- uses: peter-evans/create-pull-request@v8- with:- token: ${{ secrets.GITHUB_TOKEN }}- base: ${{ github.ref_name }}- branch: chore/crowdin-browser-translations- delete-branch: true- author: Crowdin Bot <[email protected]>- committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>- title: "chore(i18n): sync browser extension translations from Crowdin"- commit-message: "chore(i18n): sync browser extension translations from Crowdin"- body: |- This PR was created automatically by the Crowdin sync workflow.-- It updates browser extension locale files under- `browser_extension/app/public/_locales/`.- add-paths: |- browser_extension/app/public/_locales/**diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.ymldeleted file mode 100644index 327054e4..00000000--- a/.github/workflows/crowdin.yml+++ /dev/null@@ -1,123 +0,0 @@-name: Sync Crowdin--on:- workflow_dispatch:- inputs:- operation:- description: "Choose which Crowdin sync operation to run"- required: true- default: push- type: choice- options:- - push- - pull--permissions:- contents: write- pull-requests: write--concurrency:- group: crowdin-sync- cancel-in-progress: true--env:- PYTHON_VERSION: "3.11"--jobs:- sync-crowdin:- name: Sync Crowdin- runs-on: ubuntu-latest- env:- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}- steps:- - name: Checkout- uses: actions/checkout@v7- with:- fetch-depth: 0-- - name: Validate Crowdin secrets- run: |- test -n "$CROWDIN_PROJECT_ID" || (echo "Missing CROWDIN_PROJECT_ID secret" && exit 1)- test -n "$CROWDIN_PERSONAL_TOKEN" || (echo "Missing CROWDIN_PERSONAL_TOKEN secret" && exit 1)-- - name: Set up Python- uses: actions/setup-python@v6- with:- python-version: ${{ env.PYTHON_VERSION }}-- - name: Install Qt translation tools- run: |- python -m pip install --upgrade pip- pip install --timeout=300 "pyside6~=6.10.3"-- - name: Refresh Qt translation assets- run: python scripts/sync_i18n_res.py-- - name: Upload sources and translations- if: github.event.inputs.operation == 'push'- uses: crowdin/github-action@v3- with:- config: crowdin.yml- upload_sources: true- upload_translations: true- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}-- - name: Download translations- if: github.event.inputs.operation == 'pull'- uses: crowdin/github-action@v3- with:- config: crowdin.yml- download_translations: true- push_translations: false- create_pull_request: false- skip_ref_checkout: true- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}-- - name: Prepare downloaded translations- if: github.event.inputs.operation == 'pull'- run: |- sudo chown -R "$(id -u):$(id -g)" .git app/assets- rm -f .git/COMMIT_EDITMSG- python scripts/sync_i18n_res.py-- - name: Update Crowdin contributors- if: github.event.inputs.operation == 'pull'- uses: andrii-bodnar/action-crowdin-contributors@v3- with:- files: |- README.md- README_zh.md- contributors_per_line: 8- max_contributors: 32- image_size: 64- min_words_contributed: 100- env:- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}-- - name: Create translation pull request- if: github.event.inputs.operation == 'pull'- uses: peter-evans/create-pull-request@v8- with:- token: ${{ secrets.GITHUB_TOKEN }}- base: ${{ github.ref_name }}- branch: chore/crowdin-translations- delete-branch: true- author: Crowdin Bot <[email protected]>- committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>- title: "chore(i18n): sync translations from Crowdin"- commit-message: "chore(i18n): sync translations from Crowdin"- body: |- This PR was created automatically by the Crowdin sync workflow.-- It refreshes the Qt `.ts` files, compiled `.qm` files,- `app/assets/resources.py`, and Crowdin contributors in both READMEs.- add-paths: |- app/assets/i18n/*.ts- app/assets/i18n/*.qm- app/assets/resources.py- README.md- README_zh.mddiff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.ymlnew file mode 100644index 00000000..4befdef8--- /dev/null+++ b/.github/workflows/i18n.yml@@ -0,0 +1,130 @@+name: i18n++on:+ push:+ branches: [main]+ paths:+ - "app/**/*.py"+ - "features/**/*.py"+ - "browser_extension/app/public/_locales/zh_CN/messages.json"+ schedule:+ - cron: "0 2 * * 1"+ workflow_dispatch:+ inputs:+ base_url:+ description: OpenAI 兼容接口的 Base URL+ required: false+ model:+ description: 模型名+ required: false+ api_key:+ description: API Key+ required: false++permissions:+ contents: write+ pull-requests: write++concurrency:+ group: i18n+ cancel-in-progress: false++env:+ CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}+ CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}++jobs:+ sync:+ runs-on: ubuntu-24.04+ steps:+ - name: Mask API key+ if: inputs.api_key != ''+ run: echo "::add-mask::${{ inputs.api_key }}"++ - uses: actions/checkout@v7++ - uses: actions/checkout@v7+ with:+ repository: XiaoYouChR/Ghost-Downloader-Android+ token: ${{ secrets.ANDROID_REPO_TOKEN }}+ path: android++ - uses: actions/setup-python@v7+ with:+ python-version: "3.11"++ - name: Install tools+ run: |+ pip install --timeout=300 "pyside6~=6.10.3"+ npm install -g @crowdin/cli@5++ - name: Upload sources+ run: |+ python scripts/sync_i18n_res.py+ crowdin upload sources --no-progress+ (cd android && crowdin upload sources --no-progress)++ - name: Machine translate English+ if: inputs.api_key != ''+ env:+ TRANSLATE_BASE_URL: ${{ inputs.base_url }}+ TRANSLATE_MODEL: ${{ inputs.model }}+ TRANSLATE_API_KEY: ${{ inputs.api_key }}+ run: |+ crowdin download -l en-US --no-progress+ (cd android && crowdin download -l en-US --no-progress)+ python scripts/translate_i18n.py+ crowdin upload translations -l en-US --no-progress+ (cd android && crowdin upload translations -l en-US --no-progress)++ - name: Download translations+ if: github.event_name != 'push'+ run: |+ languages=$(python scripts/list_i18n_languages.py)+ crowdin download $languages --no-progress+ (cd android && crowdin download $languages --no-progress)+ python scripts/sync_i18n_res.py++ - name: Update Crowdin contributors+ if: github.event_name != 'push'+ uses: andrii-bodnar/action-crowdin-contributors@v3+ with:+ files: |+ README.md+ README_zh.md+ contributors_per_line: 8+ max_contributors: 32+ image_size: 64+ min_words_contributed: 100++ - name: Create translation pull request+ if: github.event_name != 'push'+ uses: peter-evans/create-pull-request@v8+ with:+ branch: chore/crowdin-translations+ delete-branch: true+ title: "chore(i18n): 同步 Crowdin 译文"+ commit-message: "chore(i18n): 同步 Crowdin 译文"+ body: 由 i18n workflow 从 Crowdin 下载译文后自动生成。+ add-paths: |+ app/assets/i18n/*+ app/assets/resources.qrc+ app/assets/resources.rcc+ browser_extension/app/public/_locales/**+ README.md+ README_zh.md++ - name: Create Android translation pull request+ if: github.event_name != 'push'+ uses: peter-evans/create-pull-request@v8+ with:+ path: android+ token: ${{ secrets.ANDROID_REPO_TOKEN }}+ branch: chore/crowdin-translations+ delete-branch: true+ title: "chore(i18n): 同步 Crowdin 译文"+ commit-message: "chore(i18n): 同步 Crowdin 译文"+ body: 由公开仓库的 i18n workflow 从 Crowdin 下载译文后自动生成。+ add-paths: |+ app/src/main/res/values*/strings*.xml+ app/src/main/java/com/xychr/ghostdownloader/i18n/EngineStrings.ktdiff --git a/Ghost-Downloader-3.py b/Ghost-Downloader-3.pyindex 419919d2..68ab10fc 100644--- a/Ghost-Downloader-3.py+++ b/Ghost-Downloader-3.py@@ -86,7 +86,7 @@ def startApp(application: Application, primaryInstance: PrimaryInstance, isSilenfrom PySide6.QtCore import QLocalefrom app.platform.desktop import buildFontFamilies- localeName = cfg.language.value.value+ localeName = cfg.language.valuelocale = QLocale() if localeName == "Auto" else QLocale(localeName)cfg.set(cfg.fontFamilies, buildFontFamilies(locale, application.font().defaultFamily()), save=False)application.setQuitOnLastWindowClosed(False)diff --git a/README.md b/README.mdindex 7a3855d7..b546a600 100644--- a/README.md+++ b/README.md@@ -80,6 +80,14 @@ https://github.com/user-attachments/assets/d97dc8c9-f320-4645-8dcd-0d9dc4cf2eab</p><!-- COMMAND LINE -->+## Translation++We translate Ghost Downloader on [Crowdin](https://gdi18n.xychr.com). Do not send pull requests that change translation files.++- Your language is not on Crowdin? Request it in [Discussions](https://github.com/XiaoYouChR/Ghost-Downloader-3/discussions/categories/翻译-translations).+- The source text is Simplified Chinese. [@i0ntempest](https://github.com/i0ntempest) reviews the English translation by hand. To see it, open the **Other Languages** panel in the Crowdin editor.+- A new language goes into the app when 60% of the desktop text is translated. Text that is not translated shows in English.+## Command LineInstall `ghd` from **Settings -> Command Line Tool**.@@ -139,9 +147,6 @@ Thanks to all contributors who have participated in this project!## Translation Contributors-> [!TIP]-> If you'd like to help translate Ghost Downloader, welcome to join the Crowdin project: [ghost-downloader](https://crowdin.com/project/ghost-downloader)-<!-- CROWDIN-CONTRIBUTORS-START --><table><tbody>diff --git a/README_zh.md b/README_zh.mdindex f9c19860..8d89a57d 100644--- a/README_zh.md+++ b/README_zh.md@@ -81,6 +81,14 @@ https://github.com/user-attachments/assets/c1e21cdd-4454-4df3-b55a-6bc010709c74</p><!-- COMMAND LINE -->+## 翻译++Ghost Downloader 的翻译统一在 [Crowdin](https://gdi18n.xychr.com) 上进行,请勿提交修改翻译文件的 PR。++- 如果 Crowdin 上还没有你的语言,请在 [Discussions](https://github.com/XiaoYouChR/Ghost-Downloader-3/discussions/categories/翻译-translations) 中申请。+- 原文为简体中文。英文译文经 [@i0ntempest](https://github.com/i0ntempest) 人工校对,可在 Crowdin 编辑器的 **Other Languages** 面板中参考。+- 新语言的桌面端翻译完成 60% 后即会加入应用,尚未翻译的内容以英文显示。+## 命令行在 **设置 -> 命令行工具** 中安装 `ghd` 后即可使用。@@ -140,9 +148,6 @@ ghd wait tsk_0123## 翻译贡献者-> [!TIP]-> 如果你想为 Ghost Downloader 贡献翻译,欢迎前往 Crowdin 项目页: [ghost-downloader](https://crowdin.com/project/ghost-downloader)-<!-- CROWDIN-CONTRIBUTORS-START --><table><tbody>diff --git a/app/assets/i18n/gd3.zh_CN.ts b/app/assets/i18n/gd3.zh_CN.tsindex 93987a67..d85725f5 100644--- a/app/assets/i18n/gd3.zh_CN.ts+++ b/app/assets/i18n/gd3.zh_CN.ts@@ -4,82 +4,82 @@<context><name>AdvancedOptionsPage</name><message>- <location filename="../../view/windows/oobe_window.py" line="655"/>+ <location filename="../../view/windows/oobe_window.py" line="654"/><source>更多选项</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="656"/>+ <location filename="../../view/windows/oobe_window.py" line="655"/><source>按需开启以下功能,也可以稍后在设置中修改</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="665"/>+ <location filename="../../view/windows/oobe_window.py" line="664"/><source>复制下载链接时由本程序接管</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="669"/>+ <location filename="../../view/windows/oobe_window.py" line="668"/><source>自动分类保存</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="670"/>+ <location filename="../../view/windows/oobe_window.py" line="669"/><source>按文件类型自动保存到 视频、音频、文档 等子文件夹</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="675"/>+ <location filename="../../view/windows/oobe_window.py" line="674"/><source>关联文件类型</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="676"/>+ <location filename="../../view/windows/oobe_window.py" line="675"/><source>双击 .torrent 等文件时用 Ghost Downloader 打开</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="680"/>+ <location filename="../../view/windows/oobe_window.py" line="679"/><source>处理协议链接</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="681"/>+ <location filename="../../view/windows/oobe_window.py" line="680"/><source>点击 Magnet/eD2k/FTP 链接时唤起 Ghost Downloader</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="685"/>+ <location filename="../../view/windows/oobe_window.py" line="684"/><source>允许浏览器扩展唤醒</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="686"/>+ <location filename="../../view/windows/oobe_window.py" line="685"/><source>浏览器扩展可通过 ghostdownloader:// 协议启动桌面端</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="694"/>+ <location filename="../../view/windows/oobe_window.py" line="693"/><source>Aria2 RPC 兼容</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="695"/>+ <location filename="../../view/windows/oobe_window.py" line="694"/><source>让支持 Aria2 的工具和网站把下载任务发给 Ghost Downloader</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="659"/>+ <location filename="../../view/windows/oobe_window.py" line="658"/><source>开机自启</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="660"/>+ <location filename="../../view/windows/oobe_window.py" line="659"/><source>登录系统时自动在后台启动,随时接管下载</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="664"/>+ <location filename="../../view/windows/oobe_window.py" line="663"/><source>剪贴板监听</source><translation type="unfinished"></translation></message>@@ -169,64 +169,64 @@<context><name>BTTaskCard</name><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="115"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="104"/><source>分享率 {0}</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="53"/>- <location filename="../../../features/bittorrent_pack/cards.py" line="96"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="52"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="85"/><source>做种中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="48"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="47"/><source>校验已有文件</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="49"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="48"/><source>检查续传状态</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="50"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="49"/><source>获取元数据</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="51"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="50"/><source>下载中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="52"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="51"/><source>下载完成</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="54"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="53"/><source>分配文件中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="55"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="54"/><source>等待校验</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="56"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="55"/><source>已暂停下载</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="96"/>- <location filename="../../../features/bittorrent_pack/cards.py" line="110"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="85"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="99"/><source>,</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="117"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="106"/><source>已做种 {0}</source><translation type="unfinished"></translation></message>@@ -264,32 +264,32 @@<translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="336"/>+ <location filename="../../view/windows/oobe_window.py" line="335"/><source>使用系统设置</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="339"/>+ <location filename="../../view/windows/oobe_window.py" line="338"/><source>浏览...</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="356"/>+ <location filename="../../view/windows/oobe_window.py" line="355"/><source>界面语言</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="357"/>+ <location filename="../../view/windows/oobe_window.py" line="356"/><source>更改立即生效</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="360"/>+ <location filename="../../view/windows/oobe_window.py" line="359"/><source>下载保存位置</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="391"/>+ <location filename="../../view/windows/oobe_window.py" line="390"/><source>选择下载目录</source><translation type="unfinished"></translation></message>@@ -398,37 +398,37 @@ http://example.com/{mp4,mkv}/video</source><context><name>BilibiliDraftCard</name><message>- <location filename="../../../features/bili_pack/cards.py" line="456"/>+ <location filename="../../../features/bili_pack/cards.py" line="454"/><source>最佳画质</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="457"/>+ <location filename="../../../features/bili_pack/cards.py" line="455"/><source>最佳音质</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="470"/>+ <location filename="../../../features/bili_pack/cards.py" line="468"/><source>弹幕</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="477"/>+ <location filename="../../../features/bili_pack/cards.py" line="475"/><source>截取片段</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="493"/>+ <location filename="../../../features/bili_pack/cards.py" line="491"/><source>选择分P</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="493"/>+ <location filename="../../../features/bili_pack/cards.py" line="491"/><source>选择视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/task.py" line="88"/>+ <location filename="../../../features/bili_pack/task.py" line="87"/><source>(自动生成)</source><translation type="unfinished"></translation></message>@@ -436,38 +436,38 @@ http://example.com/{mp4,mkv}/video</source><context><name>BilibiliLoginSettingCard</name><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="167"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="168"/><source>账号登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="168"/>- <location filename="../../../features/bili_pack/setting_cards.py" line="201"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="169"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="202"/><source>状态:未登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="170"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="171"/><source>扫码登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="171"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="172"/><source>导入 Cookie</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="198"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="199"/><source>状态:已登录 用户名:{0} UID:{1} 会员状态:{2}</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="230"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="231"/><source>正在退出登录...</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="172"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="173"/><source>退出登录</source><translation type="unfinished"></translation></message>@@ -475,7 +475,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>BilibiliPack</name><message>- <location filename="../../../features/bili_pack/pack.py" line="232"/>+ <location filename="../../../features/bili_pack/pack.py" line="233"/><source>哔哩哔哩视频、番剧</source><translation type="unfinished"></translation></message>@@ -483,12 +483,12 @@ http://example.com/{mp4,mkv}/video</source><context><name>BilibiliTaskCard</name><message>- <location filename="../../../features/bili_pack/cards.py" line="781"/>+ <location filename="../../../features/bili_pack/cards.py" line="774"/><source>选择分P</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="781"/>+ <location filename="../../../features/bili_pack/cards.py" line="774"/><source>选择视频</source><translation type="unfinished"></translation></message>@@ -802,48 +802,48 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="34"/>+ <location filename="../../view/components/bootstrap_list.py" line="35"/><source>刚刚</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="36"/>+ <location filename="../../view/components/bootstrap_list.py" line="37"/><source>{0} 分钟前</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="38"/>+ <location filename="../../view/components/bootstrap_list.py" line="39"/><source>{0} 小时前</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="39"/>+ <location filename="../../view/components/bootstrap_list.py" line="40"/><source>{0} 天前</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="44"/>- <location filename="../../view/components/bootstrap_list.py" line="47"/>+ <location filename="../../view/components/bootstrap_list.py" line="45"/>+ <location filename="../../view/components/bootstrap_list.py" line="48"/><source>更新失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="44"/>+ <location filename="../../view/components/bootstrap_list.py" line="45"/><source>未拉取</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="45"/>+ <location filename="../../view/components/bootstrap_list.py" line="46"/><source>{0} 条</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="45"/>+ <location filename="../../view/components/bootstrap_list.py" line="46"/><source>{0}更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="48"/>+ <location filename="../../view/components/bootstrap_list.py" line="49"/><source>,</source><translation type="unfinished"></translation></message>@@ -851,48 +851,48 @@ http://example.com/{mp4,mkv}/video</source><context><name>BootstrapListCard</name><message>- <location filename="../../view/components/bootstrap_list.py" line="76"/>+ <location filename="../../view/components/bootstrap_list.py" line="77"/><source>管理</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="85"/>+ <location filename="../../view/components/bootstrap_list.py" line="86"/><source>立即更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="105"/>+ <location filename="../../view/components/bootstrap_list.py" line="106"/><source>正在更新…</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="110"/>+ <location filename="../../view/components/bootstrap_list.py" line="111"/><source>{0} 个订阅</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="113"/>+ <location filename="../../view/components/bootstrap_list.py" line="114"/><source>共 {0} 条</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="114"/>+ <location filename="../../view/components/bootstrap_list.py" line="115"/><source>{0}更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="116"/>- <location filename="../../view/components/bootstrap_list.py" line="120"/>+ <location filename="../../view/components/bootstrap_list.py" line="117"/>+ <location filename="../../view/components/bootstrap_list.py" line="121"/><source>更新失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="118"/>+ <location filename="../../view/components/bootstrap_list.py" line="119"/><source>使用内置列表</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="123"/>+ <location filename="../../view/components/bootstrap_list.py" line="124"/><source>,</source><translation type="unfinished"></translation></message>@@ -900,47 +900,47 @@ http://example.com/{mp4,mkv}/video</source><context><name>BootstrapListDialog</name><message>- <location filename="../../view/components/bootstrap_list.py" line="193"/>+ <location filename="../../view/components/bootstrap_list.py" line="195"/><source>订阅地址</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="194"/>+ <location filename="../../view/components/bootstrap_list.py" line="196"/><source>恢复默认</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="195"/>+ <location filename="../../view/components/bootstrap_list.py" line="197"/><source>添加</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="197"/>+ <location filename="../../view/components/bootstrap_list.py" line="200"/><source>自定义条目</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="208"/>+ <location filename="../../view/components/bootstrap_list.py" line="211"/><source>保存并更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="209"/>+ <location filename="../../view/components/bootstrap_list.py" line="212"/><source>取消</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="215"/>+ <location filename="../../view/components/bootstrap_list.py" line="218"/><source>每行一个,不会被订阅更新覆盖</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="241"/>+ <location filename="../../view/components/bootstrap_list.py" line="249"/><source>订阅地址无效</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/bootstrap_list.py" line="241"/>+ <location filename="../../view/components/bootstrap_list.py" line="249"/><source>请输入有效的 HTTP/HTTPS 地址</source><translation type="unfinished"></translation></message>@@ -948,87 +948,87 @@ http://example.com/{mp4,mkv}/video</source><context><name>BrowserExtensionPage</name><message>- <location filename="../../view/windows/oobe_window.py" line="413"/>+ <location filename="../../view/windows/oobe_window.py" line="412"/><source>安装浏览器扩展</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="414"/>+ <location filename="../../view/windows/oobe_window.py" line="413"/><source>让浏览器中的下载自动接管到 Ghost Downloader</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="426"/>+ <location filename="../../view/windows/oobe_window.py" line="425"/><source>安装教程动图</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="436"/>+ <location filename="../../view/windows/oobe_window.py" line="435"/><source>手动安装</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="437"/>+ <location filename="../../view/windows/oobe_window.py" line="436"/><source>随桌面端自动更新,适用于所有 Chromium 浏览器</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="442"/>+ <location filename="../../view/windows/oobe_window.py" line="441"/><source>Chrome 商店</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="443"/>+ <location filename="../../view/windows/oobe_window.py" line="442"/><source>Edge 商店</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="444"/>+ <location filename="../../view/windows/oobe_window.py" line="443"/><source>Firefox 商店</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="448"/>+ <location filename="../../view/windows/oobe_window.py" line="447"/><source>商店版更新需等待审核,可能滞后于桌面端</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="519"/>+ <location filename="../../view/windows/oobe_window.py" line="518"/><source>正在端口 {} 上等待扩展连接</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="512"/>+ <location filename="../../view/windows/oobe_window.py" line="511"/><source>浏览器扩展未启用,可稍后在设置中开启</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="524"/>+ <location filename="../../view/windows/oobe_window.py" line="523"/><source>已连接扩展 v{},最新版本为 v{}</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="528"/>+ <location filename="../../view/windows/oobe_window.py" line="527"/><source>已连接扩展,最新版本为 v{}</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="553"/>+ <location filename="../../view/windows/oobe_window.py" line="552"/><source>请手动打开浏览器</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="554"/>+ <location filename="../../view/windows/oobe_window.py" line="553"/><source>chrome://extensions 已复制到剪贴板</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="560"/>+ <location filename="../../view/windows/oobe_window.py" line="559"/><source>解包失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="576"/>+ <location filename="../../view/windows/oobe_window.py" line="575"/><source>协议版本不匹配,商店版可能滞后,请尝试手动安装</source><translation type="unfinished"></translation></message>@@ -1036,12 +1036,12 @@ http://example.com/{mp4,mkv}/video</source><context><name>CatalogCard</name><message>- <location filename="../../../features/jack_yao/pack.py" line="183"/>+ <location filename="../../../features/jack_yao/pack.py" line="181"/><source>下载</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="187"/>+ <location filename="../../../features/jack_yao/pack.py" line="185"/><source>观看视频</source><translation type="unfinished"></translation></message>@@ -1049,33 +1049,33 @@ http://example.com/{mp4,mkv}/video</source><context><name>CatalogDownloadDialog</name><message>+ <location filename="../../../features/jack_yao/pack.py" line="230"/><location filename="../../../features/jack_yao/pack.py" line="232"/>- <location filename="../../../features/jack_yao/pack.py" line="234"/><source>选择版本</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="234"/>+ <location filename="../../../features/jack_yao/pack.py" line="232"/><source>选择你想下载的版本</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="239"/>+ <location filename="../../../features/jack_yao/pack.py" line="237"/><source>更新日志</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="249"/>+ <location filename="../../../features/jack_yao/pack.py" line="247"/><source>开始下载</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="250"/>+ <location filename="../../../features/jack_yao/pack.py" line="248"/><source>取消</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="272"/>+ <location filename="../../../features/jack_yao/pack.py" line="270"/><source>下载失败</source><translation type="unfinished"></translation></message>@@ -1083,7 +1083,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>CatalogPage</name><message>- <location filename="../../../features/jack_yao/pack.py" line="113"/>+ <location filename="../../../features/jack_yao/pack.py" line="111"/><source>加载失败,请检查网络后重试</source><translation type="unfinished"></translation>@@ -1292,22 +1292,22 @@ http://example.com/{mp4,mkv}/video</source><context><name>ClientProfileCard</name><message>- <location filename="../../view/components/option_cards.py" line="27"/>+ <location filename="../../view/components/option_cards.py" line="30"/><source>自动(匹配来源)</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/option_cards.py" line="29"/>+ <location filename="../../view/components/option_cards.py" line="32"/><source>不模拟(原样发送)</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/option_cards.py" line="31"/>+ <location filename="../../view/components/option_cards.py" line="34"/><source>{0}(最新)</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/option_cards.py" line="171"/>+ <location filename="../../view/components/option_cards.py" line="174"/><source>模拟身份</source><translation type="unfinished"></translation></message>@@ -1328,18 +1328,18 @@ http://example.com/{mp4,mkv}/video</source><context><name>CompletePage</name><message>- <location filename="../../view/windows/oobe_window.py" line="755"/>+ <location filename="../../view/windows/oobe_window.py" line="754"/><source>一切就绪</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="759"/>+ <location filename="../../view/windows/oobe_window.py" line="758"/><source>Ghost Downloader 已准备好为你工作。你可以随时在设置中调整所有选项。</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="765"/>+ <location filename="../../view/windows/oobe_window.py" line="764"/><source>开始使用</source><translation type="unfinished"></translation></message>@@ -1347,13 +1347,13 @@ http://example.com/{mp4,mkv}/video</source><context><name>DecryptionKeyCard</name><message>- <location filename="../../../features/m3u8_pack/cards.py" line="195"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="182"/><source>解密密钥</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/m3u8_pack/cards.py" line="205"/>- <location filename="../../../features/m3u8_pack/cards.py" line="229"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="192"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="216"/><source>选择 KEY 文本文件</source><translation type="unfinished"></translation></message>@@ -1371,8 +1371,8 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/cards/draft_cards.py" line="132"/>- <location filename="../../view/cards/draft_cards.py" line="137"/>+ <location filename="../../view/cards/draft_cards.py" line="133"/>+ <location filename="../../view/cards/draft_cards.py" line="138"/><source>未分类</source><translation type="unfinished"></translation></message>@@ -1587,7 +1587,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>ED2kPack</name><message>- <location filename="../../../features/ed2k_pack/pack.py" line="56"/>+ <location filename="../../../features/ed2k_pack/pack.py" line="57"/><source>eD2k 链接</source><translation type="unfinished"></translation></message>@@ -1703,23 +1703,23 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/ed2k_pack/cards.py" line="83"/>- <location filename="../../../features/ed2k_pack/cards.py" line="85"/>+ <location filename="../../../features/ed2k_pack/cards.py" line="78"/>+ <location filename="../../../features/ed2k_pack/cards.py" line="80"/><source>,</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/ed2k_pack/cards.py" line="83"/>+ <location filename="../../../features/ed2k_pack/cards.py" line="78"/><source>做种中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/ed2k_pack/cards.py" line="90"/>+ <location filename="../../../features/ed2k_pack/cards.py" line="85"/><source>分享率 {0}</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/ed2k_pack/cards.py" line="92"/>+ <location filename="../../../features/ed2k_pack/cards.py" line="87"/><source>已做种 {0}</source><translation type="unfinished"></translation></message>@@ -1727,27 +1727,27 @@ http://example.com/{mp4,mkv}/video</source><context><name>EditCookieDialog</name><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="147"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="148"/><source>保存</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="148"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="149"/><source>取消</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="150"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="151"/><source>手动导入 Cookie</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="152"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="153"/><source>请粘贴浏览器导出的完整 Cookie,留空后保存可清空当前 Cookie</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="155"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="156"/><source>请在此输入用户 Cookie</source><translation type="unfinished"></translation></message>@@ -1877,7 +1877,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>FFmpegDraftCard</name><message>- <location filename="../../../features/ffmpeg_pack/cards.py" line="40"/>+ <location filename="../../../features/ffmpeg_pack/cards.py" line="34"/><source>截取片段</source><translation type="unfinished"></translation></message>@@ -1885,7 +1885,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>FailedDraftCard</name><message>- <location filename="../../view/cards/draft_cards.py" line="232"/>+ <location filename="../../view/cards/draft_cards.py" line="233"/><source>重试</source><translation type="unfinished"></translation></message>@@ -2147,7 +2147,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>HeadersEditCard</name><message>- <location filename="../../view/components/option_cards.py" line="264"/>+ <location filename="../../view/components/option_cards.py" line="267"/><source>请求标头</source><translation type="unfinished"></translation></message>@@ -2278,7 +2278,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>HttpPack</name><message>- <location filename="../../../features/http_pack/pack.py" line="262"/>+ <location filename="../../../features/http_pack/pack.py" line="256"/><source>文件直链(视频、音频、压缩包、安装包、镜像、文档)</source><translation type="unfinished"></translation></message>@@ -2469,13 +2469,13 @@ http://example.com/{mp4,mkv}/video</source><context><name>LoadingWidget</name><message>- <location filename="../../../features/jack_yao/pack.py" line="126"/>- <location filename="../../../features/jack_yao/pack.py" line="150"/>+ <location filename="../../../features/jack_yao/pack.py" line="124"/>+ <location filename="../../../features/jack_yao/pack.py" line="148"/><source>正在加载...</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/jack_yao/pack.py" line="130"/>+ <location filename="../../../features/jack_yao/pack.py" line="128"/><source>重试</source><translation type="unfinished"></translation></message>@@ -2761,17 +2761,17 @@ http://example.com/{mp4,mkv}/video</source><context><name>M3U8LiveTaskCard</name><message>- <location filename="../../../features/m3u8_pack/cards.py" line="69"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="61"/><source>等待中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/m3u8_pack/cards.py" line="70"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="62"/><source>录制中</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/m3u8_pack/cards.py" line="104"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="91"/><source>录制已结束</source><translation type="unfinished"></translation></message>@@ -2779,17 +2779,17 @@ http://example.com/{mp4,mkv}/video</source><context><name>M3U8Pack</name><message>- <location filename="../../../features/m3u8_pack/pack.py" line="274"/>+ <location filename="../../../features/m3u8_pack/pack.py" line="275"/><source>M3U8 / DASH 流媒体</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/m3u8_pack/pack.py" line="339"/>+ <location filename="../../../features/m3u8_pack/pack.py" line="340"/><source>M3U8 播放列表</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/m3u8_pack/pack.py" line="345"/>+ <location filename="../../../features/m3u8_pack/pack.py" line="346"/><source>DASH 清单</source><translation type="unfinished"></translation></message>@@ -2969,12 +2969,12 @@ http://example.com/{mp4,mkv}/video</source><context><name>MultiFileDraftCard</name><message>- <location filename="../../view/cards/draft_cards.py" line="173"/>+ <location filename="../../view/cards/draft_cards.py" line="174"/><source>选择文件</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/cards/draft_cards.py" line="202"/>+ <location filename="../../view/cards/draft_cards.py" line="203"/><source>{0}/{1} 个文件 · {2}</source><translation type="unfinished"></translation></message>@@ -2990,7 +2990,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>MuxImportCard</name><message>- <location filename="../../../features/m3u8_pack/cards.py" line="243"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="230"/><source>导入音轨/字幕</source><translation type="unfinished"></translation></message>@@ -3155,17 +3155,17 @@ http://example.com/{mp4,mkv}/video</source><context><name>OobeWindow</name><message>- <location filename="../../view/windows/oobe_window.py" line="841"/>+ <location filename="../../view/windows/oobe_window.py" line="840"/><source>上一步</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="842"/>+ <location filename="../../view/windows/oobe_window.py" line="841"/><source>跳过全部</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="843"/>+ <location filename="../../view/windows/oobe_window.py" line="842"/><source>下一步</source><translation type="unfinished"></translation></message>@@ -3181,12 +3181,12 @@ http://example.com/{mp4,mkv}/video</source><context><name>OutputFolderCard</name><message>- <location filename="../../view/components/option_cards.py" line="96"/>+ <location filename="../../view/components/option_cards.py" line="99"/><source>选择下载路径</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/components/option_cards.py" line="97"/>+ <location filename="../../view/components/option_cards.py" line="100"/><source>默认</source><translation type="unfinished"></translation></message>@@ -3222,7 +3222,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>PackPage</name><message>- <location filename="../../../features/jack_yao/pack.py" line="54"/>+ <location filename="../../../features/jack_yao/pack.py" line="52"/><source>资源下载</source><translation type="unfinished"></translation></message>@@ -3680,22 +3680,22 @@ http://example.com/{mp4,mkv}/video</source><context><name>RuntimeInstallPage</name><message>- <location filename="../../view/windows/oobe_window.py" line="592"/>+ <location filename="../../view/windows/oobe_window.py" line="591"/><source>安装推荐组件</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="593"/>+ <location filename="../../view/windows/oobe_window.py" line="592"/><source>点击下一步将自动安装勾选的组件,稍后可在设置中管理</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="595"/>+ <location filename="../../view/windows/oobe_window.py" line="594"/><source>推荐组件</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/windows/oobe_window.py" line="625"/>+ <location filename="../../view/windows/oobe_window.py" line="624"/><source>已安装</source><translation type="unfinished"></translation></message>@@ -3703,63 +3703,63 @@ http://example.com/{mp4,mkv}/video</source><context><name>ScanLoginDialog</name><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="49"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="50"/><source>关闭</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="51"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="52"/><source>扫码登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="53"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="54"/><source>使用哔哩哔哩手机客户端扫描下方二维码,并在手机端确认登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="61"/>- <location filename="../../../features/bili_pack/setting_cards.py" line="106"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="62"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="107"/><source>正在获取二维码...</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="63"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="64"/><source>二维码有效期约 180 秒,失效后可点击"刷新二维码"重新生成</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="67"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="68"/><source>刷新二维码</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="68"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="69"/><source>打开登录链接</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="120"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="121"/><source>请使用哔哩哔哩客户端扫码</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="123"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="124"/><source>等待扫码</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="125"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="126"/><source>二维码已扫码,请在手机端确认登录</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="127"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="128"/><source>二维码已失效,请点击"刷新二维码"重新生成</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/setting_cards.py" line="114"/>+ <location filename="../../../features/bili_pack/setting_cards.py" line="115"/><source>登录成功,正在导入 Cookie...</source><translation type="unfinished"></translation></message>@@ -3767,72 +3767,72 @@ http://example.com/{mp4,mkv}/video</source><context><name>SelectDialog</name><message>- <location filename="../../../features/bili_pack/cards.py" line="71"/>+ <location filename="../../../features/bili_pack/cards.py" line="74"/><source>选择分P</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="71"/>+ <location filename="../../../features/bili_pack/cards.py" line="74"/><source>选择视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="75"/>+ <location filename="../../../features/bili_pack/cards.py" line="78"/><source>全选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="76"/>+ <location filename="../../../features/bili_pack/cards.py" line="79"/><source>全不选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="77"/>+ <location filename="../../../features/bili_pack/cards.py" line="80"/><source>反选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="89"/>+ <location filename="../../../features/bili_pack/cards.py" line="92"/><source>确定</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="90"/>+ <location filename="../../../features/bili_pack/cards.py" line="93"/><source>取消</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="382"/>+ <location filename="../../../features/bili_pack/cards.py" line="385"/><source>已选 {0}/{1}</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="96"/>+ <location filename="../../../features/bili_pack/cards.py" line="99"/><source>分P</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="96"/>+ <location filename="../../../features/bili_pack/cards.py" line="99"/><source>视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="98"/>+ <location filename="../../../features/bili_pack/cards.py" line="101"/><source>大小</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="98"/>+ <location filename="../../../features/bili_pack/cards.py" line="101"/><source>开始</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="98"/>+ <location filename="../../../features/bili_pack/cards.py" line="101"/><source>结束</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="384"/>+ <location filename="../../../features/bili_pack/cards.py" line="387"/><source>{0}/{1} 个分P</source><translation type="unfinished"></translation></message>@@ -3888,7 +3888,7 @@ http://example.com/{mp4,mkv}/video</source></message><message><location filename="../../view/pages/setting_page.py" line="62"/>- <location filename="../../view/pages/setting_page.py" line="377"/>+ <location filename="../../view/pages/setting_page.py" line="376"/><source>关于</source><translation type="unfinished"></translation></message>@@ -3954,7 +3954,7 @@ http://example.com/{mp4,mkv}/video</source></message><message><location filename="../../view/pages/setting_page.py" line="146"/>- <location filename="../../view/pages/setting_page.py" line="486"/>+ <location filename="../../view/pages/setting_page.py" line="485"/><source>接收来自浏览器的下载信息,请安装浏览器扩展后使用</source><translation type="unfinished"></translation></message>@@ -4137,7 +4137,7 @@ http://example.com/{mp4,mkv}/video</source></message><message><location filename="../../view/pages/setting_page.py" line="220"/>- <location filename="../../view/pages/setting_page.py" line="500"/>+ <location filename="../../view/pages/setting_page.py" line="499"/><source>兼容 Aria2 JSON-RPC 协议,可接收外部工具发送的下载链接</source><translation type="unfinished"></translation></message>@@ -4287,286 +4287,286 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="304"/>+ <location filename="../../view/pages/setting_page.py" line="303"/><source>切换到用户模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="305"/>- <location filename="../../view/pages/setting_page.py" line="311"/>+ <location filename="../../view/pages/setting_page.py" line="304"/>+ <location filename="../../view/pages/setting_page.py" line="310"/><source>数据存储模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="306"/>+ <location filename="../../view/pages/setting_page.py" line="305"/><source>当前为 Portable 模式,数据保存在程序旁: {0}</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="310"/>+ <location filename="../../view/pages/setting_page.py" line="309"/><source>切换到 Portable 模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="312"/>+ <location filename="../../view/pages/setting_page.py" line="311"/><source>当前为用户模式,数据保存在: {0}</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="323"/>+ <location filename="../../view/pages/setting_page.py" line="322"/><source>命令行工具</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="324"/>+ <location filename="../../view/pages/setting_page.py" line="323"/><source>安装后可在终端中使用 ghd 命令添加和管理任务</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="382"/>+ <location filename="../../view/pages/setting_page.py" line="381"/><source>在应用程序启动时检查更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="383"/>+ <location filename="../../view/pages/setting_page.py" line="382"/><source>新版本将更稳定,并具有更多功能</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="332"/>+ <location filename="../../view/pages/setting_page.py" line="331"/><source>关闭主窗口时</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="333"/>+ <location filename="../../view/pages/setting_page.py" line="332"/><source>设置关闭主窗口后程序继续在后台运行还是退出</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="334"/>+ <location filename="../../view/pages/setting_page.py" line="333"/><source>关闭时询问</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="334"/>+ <location filename="../../view/pages/setting_page.py" line="333"/><source>继续在后台运行</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="334"/>+ <location filename="../../view/pages/setting_page.py" line="333"/><source>退出程序</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="342"/>+ <location filename="../../view/pages/setting_page.py" line="341"/><source>通知提示音</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="343"/>+ <location filename="../../view/pages/setting_page.py" line="342"/><source>下载完成时播放提示音</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="367"/>+ <location filename="../../view/pages/setting_page.py" line="366"/><source>通过提供反馈来帮助我们改进 Ghost Downloader,也可查看日志排查问题</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="373"/>+ <location filename="../../view/pages/setting_page.py" line="372"/><source>查看详情</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="373"/>+ <location filename="../../view/pages/setting_page.py" line="372"/><source>功能包</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="374"/>+ <location filename="../../view/pages/setting_page.py" line="373"/><source>管理已安装的功能包</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="504"/>+ <location filename="../../view/pages/setting_page.py" line="503"/><source>正在端口 {} 上监听</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="339"/>+ <location filename="../../view/pages/setting_page.py" line="338"/><source>系统通知</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="316"/>+ <location filename="../../view/pages/setting_page.py" line="315"/><source>新建任务的下载进度</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="317"/>+ <location filename="../../view/pages/setting_page.py" line="316"/><source>选择新建任务下载进度的显示方式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="318"/>+ <location filename="../../view/pages/setting_page.py" line="317"/><source>不显示</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="318"/>+ <location filename="../../view/pages/setting_page.py" line="317"/><source>通过弹窗显示</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="318"/>+ <location filename="../../view/pages/setting_page.py" line="317"/><source>显示于任务栏</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="337"/>+ <location filename="../../view/pages/setting_page.py" line="336"/><source>通知方式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="338"/>+ <location filename="../../view/pages/setting_page.py" line="337"/><source>下载完成、磁盘空间不足等提示的显示方式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="339"/>+ <location filename="../../view/pages/setting_page.py" line="338"/><source>弹窗</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="340"/>+ <location filename="../../view/pages/setting_page.py" line="339"/><source>关闭</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="349"/>+ <location filename="../../view/pages/setting_page.py" line="348"/><source>复制链接后先询问</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="350"/>+ <location filename="../../view/pages/setting_page.py" line="349"/><source>主窗口关闭或最小化时,开启则先弹出窗口询问是否下载,关闭则直接打开主窗口。</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="534"/>+ <location filename="../../view/pages/setting_page.py" line="533"/><source>卸载</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="534"/>+ <location filename="../../view/pages/setting_page.py" line="533"/><source>安装</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="546"/>+ <location filename="../../view/pages/setting_page.py" line="545"/><source>已卸载命令行工具</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="549"/>+ <location filename="../../view/pages/setting_page.py" line="548"/><source>新打开的终端即可使用 ghd</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="551"/>+ <location filename="../../view/pages/setting_page.py" line="550"/><source>新打开的终端即可使用 ghd;若提示找不到命令,请将 ~/.local/bin 添加到 PATH</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="552"/>+ <location filename="../../view/pages/setting_page.py" line="551"/><source>已安装命令行工具</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="558"/>+ <location filename="../../view/pages/setting_page.py" line="557"/><source>卸载命令行工具失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="558"/>+ <location filename="../../view/pages/setting_page.py" line="557"/><source>安装命令行工具失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="566"/>+ <location filename="../../view/pages/setting_page.py" line="565"/><source>用户模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="566"/>+ <location filename="../../view/pages/setting_page.py" line="565"/><source>Portable 模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="568"/>+ <location filename="../../view/pages/setting_page.py" line="567"/><source>切换数据存储模式</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="569"/>+ <location filename="../../view/pages/setting_page.py" line="568"/><source>确定要切换到{0}吗?数据将被复制到新位置,程序随后退出。请手动重新打开。</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="589"/>+ <location filename="../../view/pages/setting_page.py" line="588"/><source>正在检查更新...</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="601"/>+ <location filename="../../view/pages/setting_page.py" line="600"/><source>当前已是最新版本</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="598"/>+ <location filename="../../view/pages/setting_page.py" line="597"/><source>检查更新失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="598"/>+ <location filename="../../view/pages/setting_page.py" line="597"/><source>无法获取最新版本信息</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="614"/>+ <location filename="../../view/pages/setting_page.py" line="613"/><source>搜索设置</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="297"/>+ <location filename="../../view/pages/setting_page.py" line="296"/><source>开机启动</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="298"/>+ <location filename="../../view/pages/setting_page.py" line="297"/><source>在系统启动时静默运行 Ghost Downloader</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="388"/>+ <location filename="../../view/pages/setting_page.py" line="387"/><source>打开作者的个人空间</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="389"/>+ <location filename="../../view/pages/setting_page.py" line="388"/><source>了解作者</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="389"/>+ <location filename="../../view/pages/setting_page.py" line="388"/><source>发现更多 {} 的作品</source><translation type="unfinished"></translation></message><message>+ <location filename="../../view/pages/setting_page.py" line="364"/><location filename="../../view/pages/setting_page.py" line="365"/>- <location filename="../../view/pages/setting_page.py" line="366"/><source>提供反馈</source><translation type="unfinished"></translation></message>@@ -4576,63 +4576,63 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="369"/>+ <location filename="../../view/pages/setting_page.py" line="368"/><source>查看日志</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="377"/>- <location filename="../../view/pages/setting_page.py" line="589"/>+ <location filename="../../view/pages/setting_page.py" line="376"/>+ <location filename="../../view/pages/setting_page.py" line="588"/><source>检查更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="450"/>+ <location filename="../../view/pages/setting_page.py" line="449"/><source>已配置</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="450"/>+ <location filename="../../view/pages/setting_page.py" line="449"/><source>重启软件后生效</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="458"/>+ <location filename="../../view/pages/setting_page.py" line="457"/><source>已复制配对令牌</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="464"/>+ <location filename="../../view/pages/setting_page.py" line="463"/><source>已重新生成配对令牌</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="464"/>+ <location filename="../../view/pages/setting_page.py" line="463"/><source>新令牌已复制到剪贴板</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="479"/>+ <location filename="../../view/pages/setting_page.py" line="478"/><source>解包失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="490"/>+ <location filename="../../view/pages/setting_page.py" line="489"/><source>未连接</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="492"/>+ <location filename="../../view/pages/setting_page.py" line="491"/><source>已连接 v{} (桌面端自管理)</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="494"/>+ <location filename="../../view/pages/setting_page.py" line="493"/><source>已连接 v{} (商店安装)</source><translation type="unfinished"></translation></message><message>- <location filename="../../view/pages/setting_page.py" line="511"/>+ <location filename="../../view/pages/setting_page.py" line="510"/><source>选择导出路径</source><translation type="unfinished"></translation></message>@@ -4653,7 +4653,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>StreamSelectCard</name><message>- <location filename="../../../features/m3u8_pack/cards.py" line="119"/>+ <location filename="../../../features/m3u8_pack/cards.py" line="106"/><source>默认(最佳)</source><translation type="unfinished"></translation></message>@@ -4694,7 +4694,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>SubworkerCountCard</name><message>- <location filename="../../view/components/option_cards.py" line="125"/>+ <location filename="../../view/components/option_cards.py" line="128"/><source>预分配线程数</source><translation type="unfinished"></translation></message>@@ -4881,12 +4881,12 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bittorrent_pack/cards.py" line="37"/>+ <location filename="../../../features/bittorrent_pack/cards.py" line="36"/><source>{0}/{1} Peers</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/bili_pack/cards.py" line="59"/>+ <location filename="../../../features/bili_pack/cards.py" line="62"/><source>已选 {0}/{1}</source><translation type="unfinished"></translation></message>@@ -5009,7 +5009,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>TaskErrors</name><message>- <location filename="../../i18n.py" line="28"/>+ <location filename="../../i18n.py" line="59"/><source>{name} 未安装,请在设置中安装</source><translation type="unfinished"></translation></message>@@ -5040,122 +5040,122 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="11"/>+ <location filename="../../i18n.py" line="42"/><source>进程异常退出({code}):{detail}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="12"/>+ <location filename="../../i18n.py" line="43"/><source>发生了意外错误:{detail}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="13"/>+ <location filename="../../i18n.py" line="44"/><source>不支持该链接</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="14"/>+ <location filename="../../i18n.py" line="45"/><source>压缩包包含不安全路径:{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="15"/>+ <location filename="../../i18n.py" line="46"/><source>压缩包未找到:{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="16"/>+ <location filename="../../i18n.py" line="47"/><source>不支持的压缩格式:{name}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="17"/>+ <location filename="../../i18n.py" line="48"/><source>解压后未找到可执行文件:{name}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="18"/>+ <location filename="../../i18n.py" line="49"/><source>无法读取校验文件:{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="19"/>+ <location filename="../../i18n.py" line="50"/><source>无法读取文件:{detail}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="20"/>+ <location filename="../../i18n.py" line="51"/><source>无法写入文件夹 {folder}:{reason}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="21"/>+ <location filename="../../i18n.py" line="52"/><source>SHA256 校验失败:期望 {expected},实际 {actual}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="22"/>+ <location filename="../../i18n.py" line="53"/><source>下载的文件未找到:{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="23"/>+ <location filename="../../i18n.py" line="54"/><source>无法获取 {name} 的最新 release</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="24"/>+ <location filename="../../i18n.py" line="55"/><source>无法获取 {name}/{branch}/{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="25"/>+ <location filename="../../i18n.py" line="56"/><source>无法下载 {name}/{branch}/{path}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="26"/>+ <location filename="../../i18n.py" line="57"/><source>无法下载 {name}/{tag}/{asset}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="27"/>+ <location filename="../../i18n.py" line="58"/><source>无法获取 PyPI 包信息: {package}</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="33"/>+ <location filename="../../i18n.py" line="64"/><source>{path} 已被其他文件占用</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="34"/>+ <location filename="../../i18n.py" line="65"/><source>未获得管理员授权</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="37"/>+ <location filename="../../i18n.py" line="68"/><source>端口 {port} 被占用,请更换端口</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="38"/>+ <location filename="../../i18n.py" line="69"/><source>没有权限监听端口 {port},请更换端口</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="39"/>+ <location filename="../../i18n.py" line="70"/><source>无法监听端口 {port},详情见日志</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="40"/>+ <location filename="../../i18n.py" line="71"/><source>该链接不能用于更换</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="41"/>+ <location filename="../../i18n.py" line="72"/><source>新链接的内容与原任务不同,请重新添加任务</source><translation type="unfinished"></translation></message>@@ -5365,22 +5365,22 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="30"/>+ <location filename="../../i18n.py" line="61"/><source>无法获取版本信息</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="31"/>+ <location filename="../../i18n.py" line="62"/><source>校验失败</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="32"/>+ <location filename="../../i18n.py" line="63"/><source>当前平台无可用更新</source><translation type="unfinished"></translation></message><message>- <location filename="../../i18n.py" line="35"/>+ <location filename="../../i18n.py" line="66"/><source>DMG 中未找到 .app</source><translation type="unfinished"></translation></message>@@ -5772,7 +5772,7 @@ http://example.com/{mp4,mkv}/video</source></message><message><location filename="../../../features/bittorrent_pack/android.py" line="25"/>- <location filename="../../../features/ed2k_pack/android.py" line="46"/>+ <location filename="../../../features/ed2k_pack/android.py" line="47"/><source>做种中</source><translation type="unfinished"></translation></message>@@ -5978,7 +5978,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>UrlEditCard</name><message>- <location filename="../../view/components/option_cards.py" line="237"/>+ <location filename="../../view/components/option_cards.py" line="240"/><source>下载链接</source><translation type="unfinished"></translation></message>@@ -5986,57 +5986,57 @@ http://example.com/{mp4,mkv}/video</source><context><name>VideoSelectDialog</name><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="107"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="111"/><source>选择视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="110"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="114"/><source>全选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="111"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="115"/><source>全不选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="112"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="116"/><source>反选</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="124"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="128"/><source>确定</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="125"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="129"/><source>取消</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="132"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="136"/><source>标题</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="132"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="136"/><source>时长</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="132"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="136"/><source>开始</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="132"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="136"/><source>结束</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="209"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="213"/><source>{0}/{1} 个视频</source><translation type="unfinished"></translation></message>@@ -6086,7 +6086,7 @@ http://example.com/{mp4,mkv}/video</source><context><name>YouTubePack</name><message>- <location filename="../../../features/yt_dlp_pack/pack.py" line="70"/>+ <location filename="../../../features/yt_dlp_pack/pack.py" line="71"/><source>YouTube 视频</source><translation type="unfinished"></translation></message>@@ -6124,38 +6124,38 @@ http://example.com/{mp4,mkv}/video</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="18"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="23"/><source>YouTube Cookie</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="23"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="28"/><source>导入</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="28"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="33"/><source>清除 Cookie</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="46"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="51"/><source>已导入</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="47"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="52"/><source>下载需要登录的内容时需要 Cookie,推荐通过浏览器扩展自动导入</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="70"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="75"/><source>安装浏览器扩展后,下载 YouTube 视频时会自动携带登录信息,无需手动操作。如需手动导入:打开 YouTube 并登录,按 F12 打开开发者工具,在 Network 标签中找到任意请求,复制其 Cookie 请求头的值并粘贴到下方。</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="65"/>+ <location filename="../../../features/yt_dlp_pack/setting_cards.py" line="70"/><source>导入 YouTube Cookie</source><translation type="unfinished"></translation></message>@@ -6173,52 +6173,52 @@ http://example.com/{mp4,mkv}/video</source><context><name>YtDlpDraftCard</name><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="252"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="249"/><source>音频语言</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="257"/>- <location filename="../../../features/yt_dlp_pack/cards.py" line="273"/>- <location filename="../../../features/yt_dlp_pack/cards.py" line="440"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="254"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="270"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="437"/><source>最佳画质</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="258"/>- <location filename="../../../features/yt_dlp_pack/cards.py" line="274"/>- <location filename="../../../features/yt_dlp_pack/cards.py" line="441"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="255"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="271"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="438"/><source>最佳音质</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="264"/>- <location filename="../../../features/yt_dlp_pack/cards.py" line="448"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="261"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="445"/><source>自动</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="281"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="278"/><source>截取片段</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="299"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="296"/><source>选择视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="398"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="395"/><source>选择音频语言</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="576"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="573"/><source>未找到播放列表</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="581"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="578"/><source>加载播放列表失败</source><translation type="unfinished"></translation></message>@@ -6226,32 +6226,32 @@ http://example.com/{mp4,mkv}/video</source><context><name>YtDlpTaskCard</name><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="49"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="53"/><source>{0} 个视频 · {1}</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="34"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="38"/><source>提取信息</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="36"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="40"/><source>下载视频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="36"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="40"/><source>下载音频</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="38"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="42"/><source>合并</source><translation type="unfinished"></translation></message><message>- <location filename="../../../features/yt_dlp_pack/cards.py" line="40"/>+ <location filename="../../../features/yt_dlp_pack/cards.py" line="44"/><source>下载字幕</source><translation type="unfinished"></translation></message>diff --git a/app/assets/resources.qrc b/app/assets/resources.qrcindex 3a6f615c..a5942515 100644--- a/app/assets/resources.qrc+++ b/app/assets/resources.qrc@@ -15,20 +15,20 @@</qresource><qresource prefix="i18n">- <file alias="gd3.zh_CN.qm">i18n/gd3.zh_CN.qm</file><file alias="gd3.en_US.qm">i18n/gd3.en_US.qm</file>+ <file alias="gd3.es_ES.qm">i18n/gd3.es_ES.qm</file><file alias="gd3.ja_JP.qm">i18n/gd3.ja_JP.qm</file>- <file alias="gd3.zh_TW.qm">i18n/gd3.zh_TW.qm</file>- <file alias="gd3.zh_HK.qm">i18n/gd3.zh_HK.qm</file>- <file alias="gd3.ru_RU.qm">i18n/gd3.ru_RU.qm</file><file alias="gd3.pt_BR.qm">i18n/gd3.pt_BR.qm</file>- <file alias="gd3.es_ES.qm">i18n/gd3.es_ES.qm</file>- <file alias="gd3.zh.qm">i18n/gd3.zh_CN.qm</file>- <file alias="gd3.yue.qm">i18n/gd3.zh_HK.qm</file>+ <file alias="gd3.ru_RU.qm">i18n/gd3.ru_RU.qm</file>+ <file alias="gd3.zh_CN.qm">i18n/gd3.zh_CN.qm</file>+ <file alias="gd3.zh_HK.qm">i18n/gd3.zh_HK.qm</file>+ <file alias="gd3.zh_TW.qm">i18n/gd3.zh_TW.qm</file><file alias="gd3.en.qm">i18n/gd3.en_US.qm</file>+ <file alias="gd3.es.qm">i18n/gd3.es_ES.qm</file><file alias="gd3.ja.qm">i18n/gd3.ja_JP.qm</file>- <file alias="gd3.ru.qm">i18n/gd3.ru_RU.qm</file><file alias="gd3.pt.qm">i18n/gd3.pt_BR.qm</file>- <file alias="gd3.es.qm">i18n/gd3.es_ES.qm</file>+ <file alias="gd3.ru.qm">i18n/gd3.ru_RU.qm</file>+ <file alias="gd3.zh.qm">i18n/gd3.zh_CN.qm</file>+ <file alias="gd3.yue.qm">i18n/gd3.zh_HK.qm</file></qresource></RCC>diff --git a/app/assets/resources.rcc b/app/assets/resources.rccindex 5a4e34cf..9921eb27 100644Binary files a/app/assets/resources.rcc and b/app/assets/resources.rcc differdiff --git a/app/config/cfg.py b/app/config/cfg.pyindex a716acdc..9964d969 100644--- a/app/config/cfg.py+++ b/app/config/cfg.py@@ -38,31 +38,6 @@ BASE_HEADERS = {"upgrade-insecure-requests": "1",}-class Language(Enum):- CHINESE_SIMPLIFIED = "zh_CN"- CHINESE_TRADITIONAL = "zh_TW"- CANTONESE = "yue_HK"- ENGLISH_UNITED_STATES = "en_US"- JAPANESE = "ja_JP"- RUSSIAN = "ru_RU"- PORTUGUESE_BRAZIL = "pt_BR"- SPANISH = "es_ES"- AUTO = "Auto"---# 语言的展示标签,AUTO 由视图层翻译-LANGUAGE_TEXTS = {- Language.CHINESE_SIMPLIFIED: "简体中文 (中国大陆)",- Language.CHINESE_TRADITIONAL: "正體中文 (台灣)",- Language.CANTONESE: "粤语 (香港)",- Language.ENGLISH_UNITED_STATES: "English (US)",- Language.JAPANESE: "日本語 (日本)",- Language.RUSSIAN: "Русский (Россия)",- Language.PORTUGUESE_BRAZIL: "Português (Brasil)",- Language.SPANISH: "Español (España)",-}--class CloseMode(Enum):ASK = "Ask"BACKGROUND = "Background"@@ -130,15 +105,12 @@ class GeometrySerializer(ConfigSerializer):return (0, 0, 0, 0)-class LanguageSerializer(ConfigSerializer):- def serialize(self, language):- return language.value-- def deserialize(self, value: str):- try:- return Language(value)- except ValueError:- return Language.AUTO+class LanguageConfigItem(ConfigItem):+ # 语言列表要等 resources.rcc 注册后才读得到,加载配置时无法校验+ @property+ def options(self) -> list[str]:+ from app.i18n import loadLanguages+ return ["Auto", *loadLanguages()]class ThemeSerializer(ConfigSerializer):@@ -328,10 +300,7 @@ class Config(QConfig):shouldShowDockIcon = ConfigItem("Personalization", "ShowDockIcon", True, BoolValidator())shouldShowDockSpeed = ConfigItem("Personalization", "ShowDockSpeed", True, BoolValidator())shouldShowMenuBarSpeed = ConfigItem("Personalization", "ShowMenuBarSpeed", True, BoolValidator())- language = OptionsConfigItem(- "Personalization", "Language", Language.AUTO,- OptionsValidator(Language), LanguageSerializer(), restart=True,- )+ language = LanguageConfigItem("Personalization", "Language", "Auto", restart=True)# 软件shouldCheckUpdateAtStartup = ConfigItem("Software", "CheckUpdateAtStartUp", True, BoolValidator())diff --git a/app/i18n.py b/app/i18n.pyindex c348a5a0..a01e4601 100644--- a/app/i18n.py+++ b/app/i18n.py@@ -2,6 +2,37 @@ def N(context, text):return text+# 只放 Qt 本地名称不合适的语言+LANGUAGE_TEXTS = {+ "zh_CN": "简体中文 (中国大陆)",+ "zh_TW": "正體中文 (台灣)",+ "yue_HK": "粤语 (香港)",+ "en_US": "English (US)",+ "ja_JP": "日本語 (日本)",+ "ru_RU": "Русский (Россия)",+ "pt_BR": "Português (Brasil)",+ "es_ES": "Español (España)",+ "id_ID": "Bahasa Indonesia",+}+++def loadLanguages() -> list[str]:+ from PySide6.QtCore import QDir+ names = QDir(":/i18n").entryList(["gd3.*_*.qm"])+ codes = sorted(name.removeprefix("gd3.").removesuffix(".qm") for name in names)+ # 粤语的设置值是 yue_HK,文件却叫 zh_HK+ return ["yue_HK" if code == "zh_HK" else code for code in codes]+++def toLanguageText(code: str) -> str:+ if code in LANGUAGE_TEXTS:+ return LANGUAGE_TEXTS[code]+ from PySide6.QtCore import QLocale+ locale = QLocale(code)+ name = locale.nativeLanguageName()+ return f"{name[:1].upper()}{name[1:]} ({locale.nativeTerritoryName()})"++def toLocalizedError(error) -> str:from PySide6.QtCore import QCoreApplicationtext = QCoreApplication.translate("TaskErrors", error.message) or error.messagediff --git a/app/startup.py b/app/startup.pyindex 517941b6..462dba90 100644--- a/app/startup.py+++ b/app/startup.py@@ -20,18 +20,22 @@ def loadResources(application: Application) -> None:def loadTranslators(application: Application) -> None:- from PySide6.QtCore import QLocale, QTranslator+ from PySide6.QtCore import QLocale, QTranslator, Qtfrom app.config.cfg import cfgtranslator = QTranslator(application)+ if cfg.language.value not in cfg.language.options:+ cfg.language.value = "Auto"def setLocale():- localeName = cfg.language.value.value+ localeName = cfg.language.valuelocale = QLocale() if localeName == "Auto" else QLocale(localeName)application.removeTranslator(translator)+ application.setLayoutDirection(Qt.LayoutDirection.LeftToRight)if locale.name() != "zh_CN":if translator.load(locale, "gd3", ".", ":/i18n") or translator.load("gd3.en_US", ":/i18n"):application.installTranslator(translator)+ application.setLayoutDirection(QLocale(translator.language()).textDirection())setLocale()cfg.language.valueChanged.connect(setLocale)diff --git a/app/view/pages/setting_page.py b/app/view/pages/setting_page.pyindex 2c8c2e12..19127d14 100644--- a/app/view/pages/setting_page.py+++ b/app/view/pages/setting_page.py@@ -13,8 +13,8 @@ from qfluentwidgets import (from app.view.components.scroll_area import FastScrollArea, PAGE_MARGIN-from app.config.cfg import NoticeStyle, canShowPopup, cfg, LANGUAGE_TEXTS-from app.i18n import toLocalizedError+from app.config.cfg import NoticeStyle, canShowPopup, cfg+from app.i18n import toLanguageText, toLocalizedErrorfrom app.models.task import toTaskErrorfrom app.services.port_listener import ListenStatusfrom app.config.constants import (@@ -288,8 +288,7 @@ class SettingPage(QWidget):personalCards.append(ComboBoxSettingCard(cfg.language, FluentIcon.LANGUAGE, self.tr("语言"),self.tr("设置界面的首选语言"),- texts=[LANGUAGE_TEXTS.get(lang, self.tr("使用系统设置"))- for lang in cfg.language.options]),+ texts=[self.tr("使用系统设置"), *map(toLanguageText, cfg.language.options[1:])]),)self.personalGroup.addSettingCards(personalCards)diff --git a/app/view/windows/oobe_window.py b/app/view/windows/oobe_window.pyindex d6101eae..a8cab7cd 100644--- a/app/view/windows/oobe_window.py+++ b/app/view/windows/oobe_window.py@@ -20,8 +20,8 @@ from qfluentwidgets import (from qfluentwidgets import MSFluentTitleBarfrom qfluentwidgets.common.style_sheet import updateStyleSheet-from app.config.cfg import cfg, LANGUAGE_TEXTS-from app.i18n import toLocalizedError+from app.config.cfg import cfg+from app.i18n import toLanguageText, toLocalizedErrorfrom app.models.task import toTaskErrorfrom app.platform.desktop import openChromiumUrl, revealInFolderfrom app.platform.file_association import registerUrlScheme, unregisterUrlScheme@@ -332,8 +332,7 @@ class BasicSettingsPage(QWidget):self.langCombo = ComboBox(self)self.langCombo.setMinimumWidth(200)- for lang in cfg.language.options:- self.langCombo.addItem(LANGUAGE_TEXTS.get(lang, self.tr("使用系统设置")))+ self.langCombo.addItems([self.tr("使用系统设置"), *map(toLanguageText, cfg.language.options[1:])])self.langCombo.setCurrentIndex(cfg.language.options.index(cfg.language.value))self.browseButton = PushButton(self.tr("浏览..."), self)diff --git a/browser_extension/app/public/_locales/en_US/messages.json b/browser_extension/app/public/_locales/en_US/messages.jsondeleted file mode 100644index 825a4786..00000000--- a/browser_extension/app/public/_locales/en_US/messages.json+++ /dev/null@@ -1,770 +0,0 @@-{- "about": {- "message": "About"- },- "advancedFeatures": {- "message": "Advanced Features"- },- "advancedFeaturesHint": {- "message": "Enable as needed. Some features require page injection or special permissions."- },- "audio": {- "message": "Audio",- "description": "Badge label for audio resources"- },- "audioTrack": {- "message": "Audio Track"- },- "authenticating": {- "message": "Authenticating"- },- "autoPair": {- "message": "Auto Pair"- },- "autoSelectPort": {- "message": "Auto Select Port"- },- "awaitingPairing": {- "message": "Awaiting Pairing"- },- "browserDownload": {- "message": "Browser Download"- },- "bypassShortcutKey": {- "message": "Bypass Shortcut"- },- "bypassShortcutKeyHint": {- "message": "Hold this key while clicking a download link to bypass interception and use browser download."- },- "pressShortcutKey": {- "message": "Press a shortcut key..."- },- "cacheCapture": {- "message": "Cache Capture"- },- "cacheCaptureDescription": {- "message": "Capture resources from browser cache"- },- "cancel": {- "message": "Cancel"- },- "clearSelection": {- "message": "Clear Selection",- "description": "Clears multi-select, not a task cancellation"- },- "completed": {- "message": "Completed"- },- "fileMissing": {- "message": "Deleted"- },- "confirmPairing": {- "message": "Confirm Pairing"- },- "connected": {- "message": "Connected"- },- "connecting": {- "message": "Connecting"- },- "connectionClosed": {- "message": "Connection Closed"- },- "connectionConfig": {- "message": "Connection Settings"- },- "darkTheme": {- "message": "Dark"- },- "dashSegmentsCount": {- "message": "$1 DASH segment(s) $2"- },- "deepSearch": {- "message": "Deep Search"- },- "deepSearchDescription": {- "message": "Deeply analyze page request resources"- },- "desktopVersionInfo": {- "message": "Desktop $1"- },- "disconnected": {- "message": "Disconnected"- },- "downloadThisMedia": {- "message": "Download this Media"- },- "mediaButtonLabel": {- "message": "Media Button"- },- "downloadWithGhostDownloader": {- "message": "Download with Ghost Downloader"- },- "saveAsWithGhostDownloader": {- "message": "Save As with Ghost Downloader"- },- "downloading": {- "message": "Downloading"- },- "emptyCurrentResourcesDescription": {- "message": "After playing video or audio, captured resources will appear here automatically."- },- "emptyCurrentResourcesTitle": {- "message": "No resources on current page yet"- },- "emptyImagesDescription": {- "message": "Try switching to a page with images or adjust filters."- },- "emptyImagesTitle": {- "message": "No images found on current page"- },- "emptyOtherResourcesDescription": {- "message": "After switching to other tabs and capturing resources, they will be aggregated here automatically."- },- "emptyOtherResourcesTitle": {- "message": "No resources from other pages yet"- },- "emptyTasksDescription": {- "message": "Tasks will appear here after browser interception downloads or sending resources from the resource sniffer page."- },- "emptyTasksTitle": {- "message": "No tasks yet"- },- "errorAutoPairingFailed": {- "message": "Auto pairing failed"- },- "errorBackgroundNotReady": {- "message": "Background service not ready"- },- "errorBrowserNoDownloadId": {- "message": "Browser did not return a download task"- },- "errorCannotLocateMedia": {- "message": "Could not locate media"- },- "errorConnectionFailed": {- "message": "Connection failed"- },- "errorExtensionNotReady": {- "message": "Extension not ready"- },- "errorFeatureToggleFailed": {- "message": "Feature toggle failed"- },- "errorFullscreenFailed": {- "message": "Fullscreen failed"- },- "errorInvalidDownloadRequest": {- "message": "Invalid download request"- },- "errorInvalidMergeRequest": {- "message": "Invalid merge request"- },- "errorInvalidPairToken": {- "message": "Invalid pairing token"- },- "errorMediaActionFailed": {- "message": "Media action failed"- },- "errorMediaSourceUnrecognized": {- "message": "Unrecognized media source"- },- "errorMergeFailed": {- "message": "Online merge failed"- },- "errorMergeRequiresTwoResources": {- "message": "Online merge currently only supports selecting 2 resources"- },- "errorMultipleMediaFound": {- "message": "Multiple media resources found. Please select one on the resource sniffer page."- },- "errorNoActiveTab": {- "message": "No active tab available"- },- "errorNoControllableMedia": {- "message": "No controllable media available"- },- "errorNoMediaDetected": {- "message": "No media detected"- },- "errorNoTokenReturned": {- "message": "No token returned"- },- "errorOnlineMergeFailed": {- "message": "Online merge failed"- },- "errorPairingDisconnected": {- "message": "Pairing disconnected"- },- "errorPairingRejected": {- "message": "Pairing rejected"- },- "errorPairingTimeout": {- "message": "Pairing timed out"- },- "errorPipFailed": {- "message": "Picture-in-picture failed"- },- "errorReadMediaStateFailed": {- "message": "Failed to read media state"- },- "errorReconnectFailed": {- "message": "Reconnect failed"- },- "errorResourceNotFound": {- "message": "Resource not found"- },- "errorResourcesNotMergeable": {- "message": "The selected resources do not meet the conditions for online merging"- },- "errorResponseTimeout": {- "message": "Response timed out"- },- "errorSavePairingTokenFailed": {- "message": "Failed to save pairing token"- },- "errorSaveServerUrlFailed": {- "message": "Failed to save server URL"- },- "errorSendFailed": {- "message": "Send failed"- },- "errorSendImagesFailed": {- "message": "Failed to send images"- },- "errorSendResourceFailed": {- "message": "Failed to send resource"- },- "errorStrategyException": {- "message": "Strategy exception: $1"- },- "errorSwitchMediaFailed": {- "message": "Switch media failed"- },- "errorTargetTabNotFound": {- "message": "Target tab not found"- },- "errorTaskActionFailed": {- "message": "Task action failed"- },- "errorUnknownCommand": {- "message": "Unknown command: $1"- },- "errorUnknownDownloadType": {- "message": "Unknown download request type"- },- "errorUpdateMediaButtonFailed": {- "message": "Failed to update download button"- },- "errorUpdateTakeDownloadsFailed": {- "message": "Failed to update download interception"- },- "extensionDescription": {- "message": "Manage Ghost Downloader tasks and send browser resources to Ghost Downloader."- },- "extensionName": {- "message": "Ghost Downloader for Browser"- },- "extensionVersionInfo": {- "message": "Extension version $1"- },- "failed": {- "message": "Failed"- },- "featureBackgroundDisabled": {- "message": "Feature background state is off. The panel on the page can be closed within the webpage."- },- "featureDisabled": {- "message": "Feature disabled"- },- "featureEnabled": {- "message": "Feature enabled"- },- "featureEnabledAfterReload": {- "message": "Feature enabled. It will take effect after the page refreshes."- },- "featureStateUpdated": {- "message": "Feature state updated"- },- "featureToggles": {- "message": "Feature Toggles"- },- "filterAll": {- "message": "All"- },- "filterAudio": {- "message": "Audio"- },- "filterHeightLabel": {- "message": "H",- "description": "Short label for minimum height filter"- },- "filterVideo": {- "message": "Video"- },- "filterWidthLabel": {- "message": "W",- "description": "Short label for minimum width filter"- },- "followSystem": {- "message": "Follow System"- },- "fullscreen": {- "message": "Fullscreen"- },- "general": {- "message": "General"- },- "hlsSegmentsCount": {- "message": "$1 HLS segment(s) $2"- },- "imagesProcessed": {- "message": "Processed $1 image(s)"- },- "imagesSent": {- "message": "Images sent"- },- "installMethodInfo": {- "message": "Install Method $1"- },- "installTypeDevelopment": {- "message": "Desktop self-managed"- },- "installTypeSideload": {- "message": "Sideloaded"- },- "installTypeStore": {- "message": "Store installed"- },- "installTypeUnknown": {- "message": "Unknown"- },- "interceptUnknownSize": {- "message": "Intercept when size unknown"- },- "skipExtensions": {- "message": "Skip Extensions"- },- "skipExtensionsHint": {- "message": "Enter file extensions to not intercept, separated by commas"- },- "catImages": {- "message": "Images"- },- "catDocuments": {- "message": "Documents"- },- "catAudio": {- "message": "Audio"- },- "invertSelection": {- "message": "Invert Selection"- },- "itemCount": {- "message": "$1 item(s)"- },- "launchDesktop": {- "message": "Launch Desktop"- },- "lightTheme": {- "message": "Light"- },- "localServerAddress": {- "message": "Local Server Address"- },- "loop": {- "message": "Loop"- },- "mediaBridgeNotReady": {- "message": "The media bridge on the current page is not ready yet"- },- "mediaConnected": {- "message": "Current media state connected"- },- "mediaControl": {- "message": "Media Control"- },- "mediaReleased": {- "message": "Media released"- },- "merge": {- "message": "Merge"- },- "mergeTaskSentToDesktop": {- "message": "Online merge task sent to Ghost Downloader"- },- "minInterceptSize": {- "message": "Minimum Intercept Size"- },- "minInterceptSizeHint": {- "message": "Files smaller than this size are downloaded directly by the browser. 0 means intercept all."- },- "mobileUserAgent": {- "message": "Mobile User-Agent"- },- "mobileUserAgentDescription": {- "message": "Simulate a mobile device to access pages"- },- "mobileUserAgentDisabled": {- "message": "Mobile emulation disabled"- },- "mobileUserAgentEnabled": {- "message": "Mobile emulation enabled. Will take effect after refresh."- },- "mute": {- "message": "Mute"- },- "navAdvanced": {- "message": "Advanced"- },- "navImages": {- "message": "Images"- },- "navResources": {- "message": "Resources"- },- "navTasks": {- "message": "Tasks"- },- "noActiveTabForMedia": {- "message": "No active tab available"- },- "noControllableMedia": {- "message": "No controllable media available"- },- "noControllableMediaDetected": {- "message": "No controllable media detected"- },- "noMediaDetected": {- "message": "No controllable media detected"- },- "noMediaStateResponse": {- "message": "Page did not return media state"- },- "notConnected": {- "message": "Not Connected"- },- "openFile": {- "message": "Open File"- },- "openFolder": {- "message": "Open Folder"- },- "openWhenDone": {- "message": "Open When Done"- },- "pageNoControllableMedia": {- "message": "No controllable media detected on current page"- },- "pairing": {- "message": "Pairing"- },- "pairingRequestSentConfirmOnDesktop": {- "message": "Pairing request sent. Please confirm on the desktop app."- },- "pairingToken": {- "message": "Pairing Token"- },- "pairingTokenPlaceholder": {- "message": "Enter pairing token"- },- "pairingTokenSaved": {- "message": "Pairing token saved"- },- "pasteToken": {- "message": "Paste Token"- },- "pause": {- "message": "Pause"- },- "paused": {- "message": "Paused"- },- "pendingPairing": {- "message": "Pending Pairing"- },- "pendingQueueBadge": {- "message": "$1 · $2 Queued"- },- "pictureInPicture": {- "message": "Picture-in-Picture"- },- "play": {- "message": "Play"- },- "reconnect": {- "message": "Reconnect"- },- "recordWebRTC": {- "message": "Record WebRTC"- },- "recordWebRTCDescription": {- "message": "Record WebRTC real-time communication content"- },- "redownload": {- "message": "Re-download"- },- "removeTask": {- "message": "Remove Task Only"- },- "reloadRequired": {- "message": "Reload Required"- },- "rescan": {- "message": "Rescan"- },- "resolving": {- "message": "Resolving"- },- "resource": {- "message": "Resource",- "description": "Fallback badge label when type is unknown"- },- "resourceBridgeUnavailableDescription": {- "message": "The current tab cannot provide a resource list at the moment."- },- "resourceBridgeUnavailableTitle": {- "message": "Current tab does not support resource bridging yet"- },- "resourceProcessed": {- "message": "Resource processed successfully"- },- "resourceSentToBrowser": {- "message": "Resource handed to browser for download"- },- "resourceSentToDesktop": {- "message": "Resource sent to Ghost Downloader"- },- "restoringCapturedResources": {- "message": "Restoring captured resources"- },- "restoringCatCatchResources": {- "message": "Restoring cat-catch captured resources"- },- "restoringResourcesDescription": {- "message": "Restoring captured resources."- },- "restoringResourcesTitle": {- "message": "Restoring current page resources"- },- "resume": {- "message": "Resume"- },- "scanning": {- "message": "Scanning…"- },- "scopeCurrentPage": {- "message": "Current Page"- },- "scopeOtherPages": {- "message": "Other Pages"- },- "screenCapture": {- "message": "Screen Capture"- },- "screenCaptureDescription": {- "message": "Capture screen, window, or tab"- },- "screenshot": {- "message": "Screenshot"- },- "selectAll": {- "message": "Select All"- },- "selectMedia": {- "message": "Select Media"- },- "selectMediaPlaceholder": {- "message": "Select Media"- },- "selectResourceLabel": {- "message": "Select $1"- },- "sendCount": {- "message": "Send ($1)"- },- "sendCurrentMediaToGhostDownloader": {- "message": "Send current media to Ghost Downloader"- },- "sendToDesktop": {- "message": "Send to Ghost Downloader"- },- "sending": {- "message": "Sending"- },- "sent": {- "message": "Sent"- },- "sentToBrowserDownload": {- "message": "Handed to browser download"- },- "sentToDesktop": {- "message": "Sent to Ghost Downloader"- },- "serverUrlSaved": {- "message": "URL saved"- },- "settings": {- "message": "Settings"- },- "sortByArea": {- "message": "Area"- },- "sortByHeight": {- "message": "Height"- },- "sortByWidth": {- "message": "Width"- },- "tabNotSupportResourceBridge": {- "message": "Current tab does not support cat-catch resource bridging"- },- "takeOverDownloads": {- "message": "Intercept Downloads"- },- "taskQueued": {- "message": "Desktop not connected, task queued"- },- "theme": {- "message": "Theme"- },- "tokenInvalid": {- "message": "Token invalid"- },- "unmute": {- "message": "Unmute"- },- "video": {- "message": "Video",- "description": "Badge label for video resources"- },- "videoRecording": {- "message": "Video Recording"- },- "videoRecordingDescription": {- "message": "Record video content within web pages"- },- "videoTrack": {- "message": "Video Track"- },- "waitedTimeout": {- "message": "$1 (waited $2s)"- },- "waiting": {- "message": "Waiting"- },- "waitingForInstagramSeparateTracks": {- "message": "Waiting for Instagram separate audio and video tracks"- },- "waitingForResource": {- "message": "Waiting for resource…"- },- "waitingForResourceCapture": {- "message": "Waiting for cat-catch to capture resources"- },- "waitingForSeparateTracks": {- "message": "Waiting for separate audio and video tracks"- },- "waitingForVideoResource": {- "message": "Waiting for current video resource to be sniffed"- },- "waitingForXMasterPlaylist": {- "message": "Waiting for X master playlist"- },- "skipDomains": {- "message": "Skip Domains"- },- "skipDomainsHint": {- "message": "Downloads from these websites will not be intercepted"- },- "addCurrentSite": {- "message": "Add Current Site"- },- "openPopupOnSent": {- "message": "Open extension popup after sending task"- },- "filterPdf": {- "message": "PDF"- },- "filterImage": {- "message": "Images"- },- "filterArchive": {- "message": "Archives"- },- "filterDocument": {- "message": "Documents"- },- "filterSpreadsheet": {- "message": "Spreadsheets"- },- "filterOther": {- "message": "Other"- },- "moreKinds": {- "message": "More Types"- },- "sortByTime": {- "message": "Time"- },- "sortBySize": {- "message": "Size"- },- "sortByName": {- "message": "Name"- },- "searchResourcesPlaceholder": {- "message": "Search name or URL"- },- "noMatchingResourcesTitle": {- "message": "No matching resources"- },- "noMatchingResourcesDescription": {- "message": "Try another keyword or clear the filters."- },- "clearFilters": {- "message": "Clear Filters"- },- "sortByStatus": {- "message": "Status"- },- "sortAscending": {- "message": "Ascending"- },- "sortDescending": {- "message": "Descending"- },- "searchTasksPlaceholder": {- "message": "Search task names"- },- "noMatchingTasksTitle": {- "message": "No matching tasks"- },- "noMatchingTasksDescription": {- "message": "Try another keyword."- },- "moreOptions": {- "message": "More Options"- },- "removeCompletedTasks": {- "message": "Remove Completed Tasks"- },- "removeMissingTasks": {- "message": "Remove Missing Tasks"- },- "errorRemoveTasksFailed": {- "message": "Failed to remove $1 task(s)"- },- "mediaButtonStyle": {- "message": "Media Button Style"- },- "mediaButtonStyleStandard": {- "message": "Standard"- },- "mediaButtonStyleCompact": {- "message": "Compact"- },- "mediaButtonStyleHint": {- "message": "Compact style shows icons only"- }-}diff --git a/browser_extension/app/public/_locales/es_ES/messages.json b/browser_extension/app/public/_locales/es/messages.jsonsimilarity index 100%rename from browser_extension/app/public/_locales/es_ES/messages.jsonrename to browser_extension/app/public/_locales/es/messages.jsondiff --git a/crowdin-browser.yml b/crowdin-browser.ymldeleted file mode 100644index 5e45cee0..00000000--- a/crowdin-browser.yml+++ /dev/null@@ -1,17 +0,0 @@-project_id_env: CROWDIN_BROWSER_PROJECT_ID-api_token_env: CROWDIN_PERSONAL_TOKEN-base_path: .-preserve_hierarchy: true--files:- - source: /browser_extension/app/public/_locales/zh_CN/messages.json- translation: /browser_extension/app/public/_locales/%locale%/messages.json- type: chrome_json- languages_mapping:- locale:- en-US: en_US- ja: ja- ru: ru- zh-TW: zh_TW- zh-HK: zh_HK- pt-BR: pt_BRdiff --git a/crowdin.yml b/crowdin.ymlindex edfb1c8e..bad49dd7 100644--- a/crowdin.yml+++ b/crowdin.yml@@ -1,18 +1,16 @@project_id_env: CROWDIN_PROJECT_IDapi_token_env: CROWDIN_PERSONAL_TOKEN-base_path: .preserve_hierarchy: truefiles:- source: /app/assets/i18n/gd3.zh_CN.tstranslation: /app/assets/i18n/gd3.%locale_with_underscore%.ts+ skip_untranslated_strings: true+ - source: /browser_extension/app/public/_locales/zh_CN/messages.json+ translation: /browser_extension/app/public/_locales/%osx_locale%/messages.json+ type: chrome+ skip_untranslated_strings: truelanguages_mapping:- locale_with_underscore:- en-US: en_US- ja: ja_JP- ru: ru_RU+ osx_locale:+ en-US: enzh-TW: zh_TW- zh-HK: zh_HK- pt-BR: pt_BR- es-ES: es_ES-diff --git a/docs/adr/0035-crowdin-is-the-only-translation-writer.md b/docs/adr/0035-crowdin-is-the-only-translation-writer.mdnew file mode 100644index 00000000..3a131168--- /dev/null+++ b/docs/adr/0035-crowdin-is-the-only-translation-writer.md@@ -0,0 +1,18 @@+# 译文只在 Crowdin 写入,英文是回落语言++以前同一条译文有两个写入方:Crowdin,以及仓库里的 `.ts`(本地机翻脚本和直接改 `.ts` 的 PR 都写这里)。push 用仓库覆盖 Crowdin,pull 又用 Crowdin 覆盖仓库,8 份 `.ts` 每次都全量 diff、反复冲突,Crowdin 因此停用了三个月;支持的语言列表也在仓库里抄了 7 份以上。现在改为 Crowdin 是唯一写入方:仓库只上传原文、只下载译文,语言列表也以 Crowdin 项目的目标语言为准。另外,Android 沿用社区译文依赖 Crowdin 条款 §12.6(见 [Android ADR 0001](../../android/docs/adr/0001-closed-source-android.md)),绕过 Crowdin 提交的译文不在这条授权链上。++中文是原文。英文由项目保证完整:机翻补缺,标为未审校,再由人工审校。其他语言交给社区,缺译文的条目显示英文,不显示中文,因为看不懂中文的用户多半看得懂英文。浏览器扩展靠 `default_locale: en` 本来就是这样回落的。++## Considered Options++- **仓库为准,Crowdin 只做在线编辑入口**:两边改同一条译文就会互相覆盖,正是被替换掉的现状。+- **机翻覆盖全部语言**:Crowdin 上每加一种语言,它都会立刻被机翻到 100% 并进入正式包,"加语言"变成了"发布一种纯机翻语言"。+- **以 `Language` 枚举为语言列表的唯一来源**:Crowdin 后台仍要手动和枚举保持一致,新增语言还是要改两处。+- **安装第二个 QTranslator 做回落**:构建时把英文填进空条目,每种语言仍然只有一份 `.qm`,效果相同。++## Consequences++- 不再接受直接改译文的 PR,修订请到 Crowdin 提交。Discussions 里附带的译文文件,由维护者一次性导入 Crowdin。+- 新语言的桌面端完成度达到 60% 才加入仓库,三端一起加入,因为桌面端是主产品,Android 和扩展缺的部分显示英文。已经在仓库里的语言一直保留,不因完成度下降而移出,以免已选该语言的用户界面突然换成别的语言。+- 安装器的语言列表与应用相同,由 CI 生成。diff --git a/scripts/Ghost-Downloader-3.iss b/scripts/Ghost-Downloader-3.issindex 84f48497..de07fbc4 100644--- a/scripts/Ghost-Downloader-3.iss+++ b/scripts/Ghost-Downloader-3.iss@@ -37,12 +37,8 @@ WizardStyle=modern[Languages]Name: "english"; MessagesFile: "compiler:Default.isl"-Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"-Name: "chinesetraditional"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"-Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"-Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"-Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"-Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"+; 由 scripts/fetch_installer_languages.py 按应用的语言生成+#include "..\build\installer\languages.iss"[Tasks]Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: uncheckeddiff --git a/scripts/fetch_installer_languages.py b/scripts/fetch_installer_languages.pynew file mode 100644index 00000000..70f48740--- /dev/null+++ b/scripts/fetch_installer_languages.py@@ -0,0 +1,52 @@+from pathlib import Path+from urllib.error import HTTPError+from urllib.request import urlopen++from PySide6.QtCore import QLocale++REPO = Path(__file__).resolve().parent.parent+I18N_DIR = REPO / "app" / "assets" / "i18n"+OUTPUT_DIR = REPO / "build" / "installer"+ISL_URL = "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages"+# 只放文件名与 Qt 英文语言名不一致的语言,英文用 Default.isl+ISL_NAMES = {+ "en_US": None,+ "zh_CN": "ChineseSimplified",+ "zh_TW": "ChineseTraditional",+ "zh_HK": "ChineseTraditional",+ "pt_BR": "BrazilianPortuguese",+ "ms_MY": "Malaysian",+}+++def toIslName(locale: str) -> str | None:+ if locale in ISL_NAMES:+ return ISL_NAMES[locale]+ return QLocale.languageToString(QLocale(locale).language())+++def fetchIsl(name: str) -> bytes:+ for url in (f"{ISL_URL}/{name}.isl", f"{ISL_URL}/Unofficial/{name}.isl"):+ try:+ with urlopen(url, timeout=60) as response:+ return response.read()+ except HTTPError as error:+ if error.code != 404:+ raise+ raise SystemExit(f"Inno Setup has no {name}.isl")+++def main() -> int:+ locales = sorted(path.name.removeprefix("gd3.").removesuffix(".ts") for path in I18N_DIR.glob("gd3.*.ts"))+ names = sorted({name for locale in locales if (name := toIslName(locale))})+ OUTPUT_DIR.mkdir(parents=True, exist_ok=True)+ lines = []+ for name in names:+ (OUTPUT_DIR / f"{name}.isl").write_bytes(fetchIsl(name))+ lines.append(f'Name: "{name.lower()}"; MessagesFile: "build\\installer\\{name}.isl"')+ (OUTPUT_DIR / "languages.iss").write_text("\n".join(lines) + "\n", encoding="utf-8")+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/list_i18n_languages.py b/scripts/list_i18n_languages.pynew file mode 100644index 00000000..be96b69e--- /dev/null+++ b/scripts/list_i18n_languages.py@@ -0,0 +1,41 @@+import json+import os+from pathlib import Path+from urllib.request import Request, urlopen++REPO = Path(__file__).resolve().parent.parent+I18N_DIR = REPO / "app" / "assets" / "i18n"+THRESHOLD = 60+# 新语言按桌面端的完成度三端一起进入仓库,见 docs/adr/0035+SOURCE_PATH = "/app/assets/i18n/gd3.zh_CN.ts"+++def fetch(path: str, token: str) -> list[dict]:+ request = Request(f"https://api.crowdin.com/api/v2/{path}", headers={"Authorization": f"Bearer {token}"})+ with urlopen(request, timeout=60) as response:+ return [item["data"] for item in json.load(response)["data"]]+++def fetchProgress(projectId: str, token: str) -> list[dict]:+ files = fetch(f"projects/{projectId}/files?limit=500", token)+ fileId = next(file["id"] for file in files if file["path"] == SOURCE_PATH)+ return fetch(f"projects/{projectId}/files/{fileId}/languages/progress?limit=500", token)+++def matchLanguages(progress: list[dict]) -> list[str]:+ languages = []+ for item in progress:+ locale = item["language"]["locale"].replace("-", "_")+ if (I18N_DIR / f"gd3.{locale}.ts").exists() or item["translationProgress"] >= THRESHOLD:+ languages.append(item["languageId"])+ return sorted(languages)+++def main() -> int:+ progress = fetchProgress(os.environ["CROWDIN_PROJECT_ID"], os.environ["CROWDIN_PERSONAL_TOKEN"])+ print(" ".join(f"-l {language}" for language in matchLanguages(progress)))+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/sync_i18n_res.py b/scripts/sync_i18n_res.pyindex 1ddde1f2..c2935eca 100644--- a/scripts/sync_i18n_res.py+++ b/scripts/sync_i18n_res.py@@ -4,25 +4,21 @@ import reimport shutilimport subprocessimport sys+import tempfileimport xml.etree.ElementTree as ETfrom pathlib import PathREPO = Path(__file__).resolve().parent.parent-LANGUAGES = ["zh_CN", "en_US", "ja_JP", "zh_TW", "zh_HK", "ru_RU", "pt_BR", "es_ES"]-LANGUAGE_FAMILY_FALLBACKS = {- "zh": "zh_CN",- "yue": "zh_HK",- "en": "en_US",- "ja": "ja_JP",- "ru": "ru_RU",- "pt": "pt_BR",- "es": "es_ES",-}ASSETS_DIR = REPO / "app" / "assets"I18N_DIR = ASSETS_DIR / "i18n"QRC_PATH = ASSETS_DIR / "resources.qrc"RESOURCES_RCC = ASSETS_DIR / "resources.rcc"+SOURCE_LOCALE = "zh_CN"+FALLBACK_LOCALE = "en_US"+# Qt 按系统语言查 gd3.yue 找粤语,Crowdin 导出的粤语文件却叫 zh_HK+EXTRA_FAMILY_ALIASES = {"yue": "zh_HK"}+ENGINE_CONTEXTS = ["TaskErrors", "BinaryRuntime", "TaskState","TrackBar", "YtDlpDraftCard", "StreamSelectCard",@@ -35,16 +31,9 @@ ANDROID_I18N_KT = (/ "ghostdownloader" / "i18n" / "EngineStrings.kt")ANDROID_STRINGS_FILE = "strings_engine.xml"-ANDROID_LOCALE_FOLDERS = {- "zh_CN": "values",- "en_US": "values-en",- "zh_TW": "values-zh-rTW",- "zh_HK": "values-zh-rHK",- "ja_JP": "values-ja",- "ru_RU": "values-ru",- "pt_BR": "values-pt-rBR",- "es_ES": "values-es",-}+ANDROID_FALLBACK_FILE = "strings_fallback.xml"+# Android 资源目录沿用 Java 的旧语言代码+ANDROID_LANGUAGE_CODES = {"id": "in"}def findTool(name: str) -> str:@@ -62,78 +51,117 @@ def findSources() -> list[str]:sources = []for root in ("app", "features"):for path in sorted((REPO / root).rglob("*.py")):- if path == RESOURCES_RCC:- continuesources.append(path.relative_to(REPO).as_posix())return sources-def updateTsFiles(sources: list[str]) -> None:- lupdate = findTool("pyside6-lupdate")- for locale in LANGUAGES:- subprocess.run([- lupdate,- "-tr-function-alias", "QT_TRANSLATE_NOOP+=N",- "-no-ui-lines",- "-source-language", "zh_CN",- "-target-language", locale,- *sources,- "-ts", (I18N_DIR / f"gd3.{locale}.ts").as_posix(),- ], cwd=REPO, check=True)+def findLocales() -> list[str]:+ return sorted(path.name.removeprefix("gd3.").removesuffix(".ts")+ for path in I18N_DIR.glob("gd3.*.ts"))+++def updateSourceTs(sources: list[str]) -> None:+ subprocess.run([+ findTool("pyside6-lupdate"),+ "-tr-function-alias", "QT_TRANSLATE_NOOP+=N",+ "-no-ui-lines",+ "-no-obsolete",+ "-source-language", SOURCE_LOCALE,+ "-target-language", SOURCE_LOCALE,+ *sources,+ "-ts", (I18N_DIR / f"gd3.{SOURCE_LOCALE}.ts").as_posix(),+ ], cwd=REPO, check=True)-def buildQmFiles() -> None:+def loadTranslations(locale: str) -> dict[tuple[str, str], str]:+ entries = {}+ root = ET.parse(I18N_DIR / f"gd3.{locale}.ts").getroot()+ for context in root.findall("context"):+ contextName = context.findtext("name")+ for message in context.findall("message"):+ node = message.find("translation")+ if node is None or node.get("type") or not (node.text or "").strip():+ continue+ entries[(contextName, message.findtext("source") or "")] = node.text+ return entries+++def buildFilledTs(locale: str, fallback: dict[tuple[str, str], str], folder: Path) -> Path:+ translations = loadTranslations(locale)+ tree = ET.parse(I18N_DIR / f"gd3.{SOURCE_LOCALE}.ts")+ tree.getroot().set("language", locale)+ for context in tree.getroot().findall("context"):+ contextName = context.findtext("name")+ for message in context.findall("message"):+ node = message.find("translation")+ key = (contextName, message.findtext("source") or "")+ text = translations.get(key) or fallback.get(key)+ if text:+ node.text = text+ node.attrib.pop("type", None)+ path = folder / f"gd3.{locale}.ts"+ tree.write(path, encoding="utf-8", xml_declaration=True)+ return path+++def buildQmFiles(locales: list[str]) -> None:lrelease = findTool("pyside6-lrelease")- for locale in LANGUAGES:- ts = I18N_DIR / f"gd3.{locale}.ts"- qm = I18N_DIR / f"gd3.{locale}.qm"- subprocess.run([lrelease, ts.as_posix(), "-qm", qm.as_posix()],- cwd=REPO, check=True)+ fallback = loadTranslations(FALLBACK_LOCALE)+ with tempfile.TemporaryDirectory() as folder:+ for locale in locales:+ isBase = locale in (SOURCE_LOCALE, FALLBACK_LOCALE)+ ts = buildFilledTs(locale, {} if isBase else fallback, Path(folder))+ qm = I18N_DIR / f"gd3.{locale}.qm"+ subprocess.run([lrelease, "-nounfinished", ts.as_posix(), "-qm", qm.as_posix()],+ cwd=REPO, check=True)++def updateQrcI18n(locales: list[str]) -> None:+ families = {}+ for locale in locales:+ families.setdefault(locale.split("_")[0], locale)+ families.update(EXTRA_FAMILY_ALIASES)++ lines = [f' <file alias="gd3.{locale}.qm">i18n/gd3.{locale}.qm</file>' for locale in locales]+ lines += [f' <file alias="gd3.{family}.qm">i18n/gd3.{locale}.qm</file>'+ for family, locale in families.items()]+ section = '\n <qresource prefix="i18n">\n' + "\n".join(lines) + '\n </qresource>'-def updateQrcI18n() -> None:text = QRC_PATH.read_text(encoding="utf-8")- text = re.sub(- r'\s*<qresource prefix="i18n">.*?</qresource>',- '', text, flags=re.DOTALL,- )- lines = []- for locale in LANGUAGES:- lines.append(f' <file alias="gd3.{locale}.qm">i18n/gd3.{locale}.qm</file>')- for lang, fallback in LANGUAGE_FAMILY_FALLBACKS.items():- lines.append(f' <file alias="gd3.{lang}.qm">i18n/gd3.{fallback}.qm</file>')- entries = "\n".join(lines)- section = f'\n <qresource prefix="i18n">\n{entries}\n </qresource>'+ text = re.sub(r'\s*<qresource prefix="i18n">.*?</qresource>', '', text, flags=re.DOTALL)text = text.replace("</RCC>", f"{section}\n</RCC>")QRC_PATH.write_text(text, encoding="utf-8")-def readCatalog(locale: str) -> dict[str, tuple[str, str, str]]:- root = ET.parse(I18N_DIR / f"gd3.{locale}.ts").getroot()- entries: dict[str, tuple[str, str, str]] = {}+def toAndroidFolder(locale: str) -> Path | None:+ if locale == SOURCE_LOCALE:+ return ANDROID_RES_DIR / "values"+ language, _, region = locale.partition("_")+ language = ANDROID_LANGUAGE_CODES.get(language, language)+ for name in (f"values-{language}-r{region}", f"values-{language}"):+ if (ANDROID_RES_DIR / name / "strings.xml").exists():+ return ANDROID_RES_DIR / name+ return None+++def loadEngineCatalog(locale: str, fallback: dict[tuple[str, str], str]) -> dict[str, tuple[str, str, str]]:+ translations = loadTranslations(locale)+ entries = {}+ root = ET.parse(I18N_DIR / f"gd3.{SOURCE_LOCALE}.ts").getroot()for context in root.findall("context"):- ctxName = context.findtext("name")- if ctxName not in ENGINE_CONTEXTS:+ contextName = context.findtext("name")+ if contextName not in ENGINE_CONTEXTS:continuefor message in context.findall("message"):source = message.findtext("source") or ""- node = message.find("translation")- if locale == "zh_CN":- text = source- elif node is None or node.get("type"):- # 只收 finished(无 type 属性)。vanished / obsolete 是源文案已删除,- # 留着会变成默认语言没有的孤儿 string,lint 的 ExtraTranslation 报错- continue- else:- text = (node.text or "").strip()+ key = (contextName, source)+ text = source if locale == SOURCE_LOCALE else translations.get(key) or fallback.get(key)if source and text:digest = hashlib.sha1(source.encode("utf-8")).hexdigest()[:8]- resName = f"engine_{ctxName.lower()}_{digest}"- entries[resName] = (ctxName, source, text)+ entries[f"engine_{contextName.lower()}_{digest}"] = (contextName, source, text.strip())return entries-def escapeAndroidString(text: str) -> str:for old, new in (("&", "&"), ("<", "<"), (">", ">"),("'", "\\'"), ('"', '\\"')):@@ -141,8 +169,9 @@ def escapeAndroidString(text: str) -> str:return text-def buildAndroidStrings() -> None:- source = readCatalog("zh_CN")+def buildAndroidEngineStrings(locales: list[str]) -> None:+ fallback = loadTranslations(FALLBACK_LOCALE)+ source = loadEngineCatalog(SOURCE_LOCALE, fallback)if not source:raise SystemExit(f"No messages found for contexts {ENGINE_CONTEXTS}")@@ -152,22 +181,18 @@ def buildAndroidStrings() -> None:raise SystemExit(f"resourceName collision: {text!r} vs {nameToSource[name]!r}")nameToSource[name] = text- for locale, folder in ANDROID_LOCALE_FOLDERS.items():- entries = readCatalog(locale)- if not entries:+ for locale in locales:+ folder = toAndroidFolder(locale)+ if folder is None:continue- target = ANDROID_RES_DIR / folder- target.mkdir(parents=True, exist_ok=True)+ entries = loadEngineCatalog(locale, fallback)xmlLines = ["<!-- Generated by scripts/sync_i18n_res.py -->", "<resources>"]for resource in sorted(entries):text = escapeAndroidString(entries[resource][2])- xmlLines.append(- f' <string name="{resource}" formatted="false">{text}</string>'- )+ xmlLines.append(f' <string name="{resource}" formatted="false">{text}</string>')xmlLines.append("</resources>")- (target / ANDROID_STRINGS_FILE).write_text("\n".join(xmlLines) + "\n", encoding="utf-8")+ (folder / ANDROID_STRINGS_FILE).write_text("\n".join(xmlLines) + "\n", encoding="utf-8")- ANDROID_I18N_KT.parent.mkdir(parents=True, exist_ok=True)ktLines = ["// Generated by scripts/sync_i18n_res.py","package com.xychr.ghostdownloader.i18n",@@ -177,32 +202,64 @@ def buildAndroidStrings() -> None:"internal val engineStrings: Map<String, Int> = mapOf(",]for resource in sorted(source):- ctxName, rawText, _ = source[resource]+ contextName, rawText, _ = source[resource]text = rawText.replace("\\", "\\\\").replace('"', '\\"')- ktLines.append(f' "{ctxName}:{text}" to R.string.{resource},')+ ktLines.append(f' "{contextName}:{text}" to R.string.{resource},')ktLines.append(f' "{text}" to R.string.{resource},')ktLines.append(")")+ ANDROID_I18N_KT.parent.mkdir(parents=True, exist_ok=True)ANDROID_I18N_KT.write_text("\n".join(ktLines) + "\n", encoding="utf-8")+def loadAndroidResources(folder: Path) -> dict[str, ET.Element]:+ resources = {}+ for path in sorted(folder.glob("strings*.xml")):+ if path.name in (ANDROID_STRINGS_FILE, ANDROID_FALLBACK_FILE):+ continue+ for element in ET.parse(path).getroot():+ if element.tag in ("string", "plurals") and element.get("translatable") != "false":+ resources[element.get("name")] = element+ return resources+++def buildAndroidFallbackStrings(locales: list[str]) -> None:+ fallbackFolder = toAndroidFolder(FALLBACK_LOCALE)+ if fallbackFolder is None:+ return+ fallback = loadAndroidResources(fallbackFolder)+ for locale in locales:+ folder = toAndroidFolder(locale)+ if folder is None or locale in (SOURCE_LOCALE, FALLBACK_LOCALE):+ continue+ existing = loadAndroidResources(folder)+ missing = [fallback[name] for name in sorted(fallback) if name not in existing]+ path = folder / ANDROID_FALLBACK_FILE+ if not missing:+ path.unlink(missing_ok=True)+ continue+ xmlLines = ["<!-- Generated by scripts/sync_i18n_res.py -->", "<resources>"]+ xmlLines += [" " + ET.tostring(element, encoding="unicode").strip() for element in missing]+ xmlLines.append("</resources>")+ path.write_text("\n".join(xmlLines) + "\n", encoding="utf-8")+def buildResources() -> None:- rcc = findTool("pyside6-rcc")+ # 格式 2 起记录文件修改时间,CI 每次 checkout 都会让 .rcc 变化subprocess.run([- rcc, "--binary",+ findTool("pyside6-rcc"), "--binary", "--format-version", "1","-o", RESOURCES_RCC.as_posix(),QRC_PATH.as_posix(),], cwd=REPO, check=True)def main() -> int:- I18N_DIR.mkdir(parents=True, exist_ok=True)-- sources = findSources()- updateTsFiles(sources)- buildQmFiles()- updateQrcI18n()- buildAndroidStrings()+ updateSourceTs(findSources())+ locales = findLocales()+ buildQmFiles(locales)+ updateQrcI18n(locales)+ if ANDROID_RES_DIR.exists():+ buildAndroidEngineStrings(locales)+ buildAndroidFallbackStrings(locales)buildResources()return 0diff --git a/scripts/translate_i18n.py b/scripts/translate_i18n.pyindex 79290104..be757f3d 100644--- a/scripts/translate_i18n.py+++ b/scripts/translate_i18n.py@@ -12,38 +12,16 @@ I18N_DIR = REPO / "app" / "assets" / "i18n"BROWSER_I18N_DIR = REPO / "browser_extension" / "app" / "public" / "_locales"ANDROID_RES_DIR = REPO / "android" / "app" / "src" / "main" / "res"-ANDROID_SOURCE_FILES = [- "strings.xml",- "strings_identity.xml",- "strings_settings.xml",- "strings_settings_edit.xml",- "strings_settings_flow.xml",- "strings_task_bar.xml",- "strings_tasks.xml",-]-ANDROID_LOCALE_FOLDERS = {- "en_US": "values-en",- "ja_JP": "values-ja",- "ru_RU": "values-ru",- "zh_TW": "values-zh-rTW",- "zh_HK": "values-zh-rHK",- "pt_BR": "values-pt-rBR",- "es_ES": "values-es",-}--API_KEY = os.environ.get("DEEPSEEK_API_KEY", "")-API_URL = "https://api.deepseek.com/chat/completions"-MODEL = "deepseek-v4-pro"--LOCALES = {- "en_US": "English (United States)",- "ja_JP": "日本語 (Japanese)",- "ru_RU": "Русский (Russian)",- "zh_HK": "繁體中文 (Hong Kong)",- "zh_TW": "繁體中文 (Taiwan)",- "pt_BR": "Português (Brasil)",- "es_ES": "Español (España)",-}+ANDROID_FOLDER = "values-en"+ANDROID_GENERATED_FILES = {"strings_engine.xml", "strings_fallback.xml"}++BASE_URL = os.environ.get("TRANSLATE_BASE_URL", "").rstrip("/")+MODEL = os.environ.get("TRANSLATE_MODEL", "")+API_KEY = os.environ.get("TRANSLATE_API_KEY", "")++LOCALE = "en_US"+LOCALE_NAME = "English (United States)"+BROWSER_LOCALE = "en"SYSTEM_PROMPT_DESKTOP = """\将下载管理器 Ghost Downloader 3 的 UI 文本从简体中文翻译为 {locale_name}。@@ -135,7 +113,7 @@ def fetchTranslation(system: str, user: str) -> str:"reasoning_effort": "low",}req = Request(- API_URL,+ f"{BASE_URL}/chat/completions",data=json.dumps(payload).encode(),headers={"Content-Type": "application/json",@@ -222,22 +200,6 @@ def translateLocale(locale: str, localeName: str) -> None:print(f"[{locale}] {status}: {count}/{len(unfinished)} filled")-def checkLocales(locales: dict[str, str]) -> int:- total = 0- for locale in locales:- tsPath = I18N_DIR / f"gd3.{locale}.ts"- if not tsPath.exists():- print(f" {locale}: .ts not found")- continue- _, _, unfinished = parseTs(tsPath)- total += len(unfinished)- if unfinished:- print(f" {locale}: {len(unfinished)} unfinished")- else:- print(f" {locale}: up to date")- return total--def parseBrowserMessages(path: Path) -> dict[str, dict]:if not path.exists():return {}@@ -281,20 +243,9 @@ def parseBrowserResponse(text: str) -> dict[str, str]:return translations-BROWSER_LOCALE_MAP = {- "en_US": "en_US",- "ja_JP": "ja",- "ru_RU": "ru",- "zh_HK": "zh_HK",- "zh_TW": "zh_TW",- "pt_BR": "pt_BR",-}--def translateBrowserLocale(locale: str, localeName: str) -> None:- chromeLocale = BROWSER_LOCALE_MAP.get(locale, locale)sourceDir = BROWSER_I18N_DIR / "zh_CN"- targetDir = BROWSER_I18N_DIR / chromeLocale+ targetDir = BROWSER_I18N_DIR / BROWSER_LOCALEsource = parseBrowserMessages(sourceDir / "messages.json")if not source:@@ -336,24 +287,6 @@ def translateBrowserLocale(locale: str, localeName: str) -> None:print(f"[browser:{locale}] {status}: {filled}/{len(untranslated)} filled")-def checkBrowserLocales(locales: dict[str, str]) -> int:- total = 0- source = parseBrowserMessages(BROWSER_I18N_DIR / "zh_CN" / "messages.json")- if not source:- print(" browser: source messages.json not found")- return 0- for locale in locales:- chromeLocale = BROWSER_LOCALE_MAP.get(locale, locale)- existing = parseBrowserMessages(BROWSER_I18N_DIR / chromeLocale / "messages.json")- missing = len(set(source) - set(existing))- total += missing- if missing > 0:- print(f" browser:{locale}: {missing} untranslated")- else:- print(f" browser:{locale}: up to date")- return total--def parseAndroidStrings(path: Path) -> dict[str, str]:if not path.exists():return {}@@ -417,19 +350,16 @@ def escapeAndroidXml(text: str) -> str:def translateAndroidLocale(locale: str, localeName: str) -> None:- folder = ANDROID_LOCALE_FOLDERS.get(locale)- if not folder:- print(f"[android:{locale}] No folder mapping")- return-sourceDir = ANDROID_RES_DIR / "values"- localeDir = ANDROID_RES_DIR / folder+ localeDir = ANDROID_RES_DIR / ANDROID_FOLDER+ sourceFiles = [path.name for path in sorted(sourceDir.glob("strings*.xml"))+ if path.name not in ANDROID_GENERATED_FILES]allSource: dict[str, tuple[str, str]] = {}allExisting: dict[str, tuple[str, str]] = {}untranslated: dict[str, tuple[str, str]] = {}- for fname in ANDROID_SOURCE_FILES:+ for fname in sourceFiles:source = parseAndroidStrings(sourceDir / fname)existing = parseAndroidStrings(localeDir / fname)for name, text in source.items():@@ -462,7 +392,7 @@ def translateAndroidLocale(locale: str, localeName: str) -> None:filled += 1localeDir.mkdir(parents=True, exist_ok=True)- for fname in ANDROID_SOURCE_FILES:+ for fname in sourceFiles:source = parseAndroidStrings(sourceDir / fname)existing = parseAndroidStrings(localeDir / fname)newTranslations = fileEntries.get(fname, {})@@ -482,77 +412,24 @@ def translateAndroidLocale(locale: str, localeName: str) -> None:print(f"[android:{locale}] {status}: {filled}/{len(untranslated)} filled")-def checkAndroidLocales(locales: dict[str, str]) -> int:- total = 0- sourceDir = ANDROID_RES_DIR / "values"- for locale in locales:- folder = ANDROID_LOCALE_FOLDERS.get(locale)- if not folder:- continue- localeDir = ANDROID_RES_DIR / folder- missing = 0- for fname in ANDROID_SOURCE_FILES:- source = parseAndroidStrings(sourceDir / fname)- existing = parseAndroidStrings(localeDir / fname)- missing += len(set(source) - set(existing))- total += missing- if missing > 0:- print(f" android:{locale}: {missing} untranslated")- else:- print(f" android:{locale}: up to date")- return total--def main() -> int:- args = sys.argv[1:]- check = "--check" in args- browser = "--browser" in args- android = "--android" in args- targets = [a for a in args if not a.startswith("-")]-- if targets:- invalid = [t for t in targets if t not in LOCALES]- if invalid:- print(f"Unknown locales: {', '.join(invalid)}", file=sys.stderr)- print(f"Available: {', '.join(LOCALES)}", file=sys.stderr)- return 1- locales = {k: LOCALES[k] for k in targets}- else:- locales = LOCALES-- if check:- if android:- total = checkAndroidLocales(locales)- elif browser:- total = checkBrowserLocales(locales)- else:- total = checkLocales(locales)- return 0 if total == 0 else 2-- if not API_KEY:- print("Set DEEPSEEK_API_KEY environment variable", file=sys.stderr)+ if not (BASE_URL and MODEL and API_KEY):+ print("Set TRANSLATE_BASE_URL, TRANSLATE_MODEL and TRANSLATE_API_KEY", file=sys.stderr)return 1- if android:- translateFn = translateAndroidLocale- elif browser:- translateFn = translateBrowserLocale- else:- translateFn = translateLocale+ translateFns = [translateLocale, translateBrowserLocale]+ if ANDROID_RES_DIR.exists():+ translateFns.append(translateAndroidLocale)failed = False- with ThreadPoolExecutor(max_workers=len(locales)) as pool:- futures = {- pool.submit(translateFn, loc, name): loc- for loc, name in locales.items()- }+ with ThreadPoolExecutor(max_workers=len(translateFns)) as pool:+ futures = {pool.submit(fn, LOCALE, LOCALE_NAME): fn.__name__ for fn in translateFns}for fut in as_completed(futures):- loc = futures[fut]try:fut.result()except Exception as exc:failed = True- print(f"[{loc}] ERROR: {exc}", file=sys.stderr)+ print(f"[{futures[fut]}] ERROR: {exc}", file=sys.stderr)return 1 if failed else 0