Skip to content

Add Chinese (Simplified) localization#810

Open
xmmtx wants to merge 34 commits intoTyrrrz:primefrom
xmmtx:main
Open

Add Chinese (Simplified) localization#810
xmmtx wants to merge 34 commits intoTyrrrz:primefrom
xmmtx:main

Conversation

@xmmtx
Copy link
Copy Markdown

@xmmtx xmmtx commented Apr 11, 2026

add chinese

@xmmtx
Copy link
Copy Markdown
Author

xmmtx commented Apr 11, 2026

To be precise, it is Simplified Chinese, intended for use in mainland China.

@xmmtx
Copy link
Copy Markdown
Author

xmmtx commented Apr 11, 2026

maybe you can delete my workflows. because i change subscribe to my kook channel

@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Simplified Chinese localization support to YoutubeDownloader, and also updates the GitHub Actions workflow used to build, package, release, and send release notifications.

Changes:

  • Added a Simplified Chinese localization dictionary and language option.
  • Updated system-language detection to map a Chinese culture to the new localization.
  • Refactored .github/workflows/main.yml (action versions, version parsing, deploy packaging, and notification target).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
YoutubeDownloader/Localization/LocalizationManager.cs Adds System-language mapping and explicit selection for Simplified Chinese.
YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Introduces Simplified Chinese UI strings.
YoutubeDownloader/Localization/Language.cs Adds a new language enum value and display metadata.
.github/workflows/main.yml Updates CI/CD pipeline steps, versions, and replaces release notification integration.
Comments suppressed due to low confidence (3)

YoutubeDownloader/Localization/LocalizationManager.cs:56

  • CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName for Chinese cultures is typically "zho" (ISO 639-2), not "chs" (which matches ThreeLetterWindowsLanguageName). As written, Language.System will likely never auto-select Chinese and will fall back to English. Consider switching this logic to use TwoLetterISOLanguageName/Name for zh-*, or change the compared value to "zho" (or use ThreeLetterWindowsLanguageName consistently).
                    "spa" => SpanishLocalization,
                    _ => EnglishLocalization,
                },
            Language.ChineseSimplified => ChineseSimplifiedLocalization,
            Language.Ukrainian => UkrainianLocalization,
            Language.German => GermanLocalization,
            Language.French => FrenchLocalization,
            Language.Spanish => SpanishLocalization,
            _ => EnglishLocalization,

.github/workflows/main.yml:179

  • A bot authorization token is committed directly in the workflow (Authorization: Bot ...). This is a secret and should not be stored in the repo; it can be harvested from git history and used to send messages as the bot. Move the token (and likely target_id) into GitHub Secrets and reference it via ${{ secrets.* }}; rotate/revoke the leaked token immediately.
    .github/workflows/main.yml:149
  • deploy uses actions/download-artifact, which requires actions: read permission for the GITHUB_TOKEN. The job permissions were reduced to only contents: write, so artifact download may fail with insufficient permissions. Add actions: read to deploy job permissions (and consider least-privilege for other jobs as well).
      - name: Create package
        working-directory: YoutubeDownloader/
        run: zip -r ../YoutubeDownloader.${{ matrix.rid }}.zip .

      - name: Upload release asset
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: >

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[nameof(SettingsTitle)] = "设置",
[nameof(ThemeLabel)] = "主题",
[nameof(ThemeTooltip)] = "首选的用户界面主题",
[nameof(LanguageLabel)] = "语言Language",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because i don't want any body change to wrong language than don't know how to change back

Comment on lines 19 to 31
jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4

- name: Install .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can remove

Comment on lines 25 to 31
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4

- name: Install .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can remove

@xmmtx
Copy link
Copy Markdown
Author

xmmtx commented Apr 13, 2026

because i don't want anybody change to wrong language than don't know how to change back. then keep english at language buttom

@xmmtx
Copy link
Copy Markdown
Author

xmmtx commented Apr 13, 2026

and all change of workflows can delete

@Tyrrrz Tyrrrz changed the title add chinese Add Simplified Chinese localization Apr 14, 2026
@Tyrrrz Tyrrrz changed the title Add Simplified Chinese localization Add Chinese (Simplified) localization Apr 14, 2026
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 14, 2026

@xmmtx thank you.

I've made some corrections to fit the established conventions.

However, your translations are relying on a slightly outdated string set (see build errors). Please take a look at the base strings (English) on the latest prime branch (https://github.com/Tyrrrz/YoutubeDownloader/blob/prime/YoutubeDownloader/Localization/LocalizationManager.English.cs) and update your strings accordingly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Chinese (Simplified) localization option and wires it into the localization selection logic so the UI can be displayed in Simplified Chinese.

Changes:

  • Added ChineseSimplified to the Language enum.
  • Added a new Simplified Chinese localization dictionary (LocalizationManager.ChineseSimplified.cs).
  • Updated LocalizationManager language selection to route to the new localization.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
YoutubeDownloader/Localization/LocalizationManager.cs Routes System/explicit language selection to the new Simplified Chinese localization.
YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Adds Simplified Chinese strings for UI labels/tooltips/dialog messages.
YoutubeDownloader/Localization/Language.cs Introduces the ChineseSimplified language option for settings selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


或者,你也可以下载集成了 FFmpeg 的 {0} 版本。请寻找未标记为 *.Bare 的发布资源。

点击“下载”跳转到 FFmpeg 下载页面。
[nameof(CloseButton)] = "关闭",
[nameof(DownloadButton)] = "下载",
[nameof(CancelButton)] = "取消",
[nameof(SettingsButton)] = "设置",
Comment on lines +122 to +128
[nameof(FFmpegPathMissingMessage)] = """
此应用需要 FFmpeg 才能运行,但配置的路径不存在:
{0}

请在设置中更新 FFmpeg 路径,或将其清空以使用自动检测。
""",
[nameof(FFmpegMissingSearchedLabel)] = "在以下目录中搜索了 '{0}':",
German,
French,
Spanish,
ChineseSimplified,
xmmtx and others added 2 commits April 14, 2026 21:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Updated localization strings for Chinese Simplified, including changes to FFmpeg messages.
@xmmtx xmmtx requested a review from Tyrrrz April 14, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants