Skip to content

Add Chinese (Simplified) localization - #810

Merged
Tyrrrz merged 34 commits into
Tyrrrz:primefrom
xmmtx:main
Apr 21, 2026
Merged

Add Chinese (Simplified) localization#810
Tyrrrz merged 34 commits into
Tyrrrz:primefrom
xmmtx:main

Conversation

@xmmtx

@xmmtx xmmtx commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

add chinese

@xmmtx

xmmtx commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

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

@xmmtx

xmmtx commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Outdated
Comment thread YoutubeDownloader/Localization/Language.cs
Comment thread .github/workflows/main.yml
Comment thread .github/workflows/main.yml
@xmmtx

xmmtx commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

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

xmmtx commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Tyrrrz commented Apr 14, 2026

Copy link
Copy Markdown
Owner

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread YoutubeDownloader/Localization/LocalizationManager.cs Outdated
Comment thread YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Outdated
Comment thread YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Outdated
Comment thread YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Outdated
Comment thread YoutubeDownloader/Localization/Language.cs
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Simplified Chinese localization option to the app’s localization system, including System-language auto-detection updates so Chinese users can see translated UI strings.

Changes:

  • Added ChineseSimplified to the Language enum.
  • Introduced a new ChineseSimplifiedLocalization string dictionary.
  • Updated LocalizationManager to select Simplified Chinese for certain CultureInfo.CurrentUICulture values (and allow explicit selection via Language.ChineseSimplified).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
YoutubeDownloader/Localization/LocalizationManager.cs Adds Simplified Chinese selection logic for System language and explicit Language.ChineseSimplified mapping.
YoutubeDownloader/Localization/LocalizationManager.ChineseSimplified.cs Adds Simplified Chinese translation strings for existing UI keys.
YoutubeDownloader/Localization/Language.cs Adds a new enum value to expose Simplified Chinese in settings/UI.

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

Comment thread YoutubeDownloader/Localization/LocalizationManager.cs
@Tyrrrz
Tyrrrz merged commit 3d9f7f1 into Tyrrrz:prime Apr 21, 2026
14 of 15 checks passed
@girl-dream

Copy link
Copy Markdown
Contributor

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

@Tyrrrz

Tyrrrz commented Apr 22, 2026

Copy link
Copy Markdown
Owner

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

That's for sorting purposes. I might add a separate display name later.

@xmmtx

xmmtx commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

本来想写的就是Chinese(Simplified),这样能保证Chinese这个大分类在前,但是为了不添加特殊符号与空格,才写成ChineseSimplified

@xmmtx

xmmtx commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

现在是直接读代码里面的名字的,所以直接显示ChineseSimplified

@girl-dream

Copy link
Copy Markdown
Contributor

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

现在是直接读代码里面的名字的,所以直接显示ChineseSimplified

用Description,我改了一下实现了


public enum Language
{
    System,
    English,
    Ukrainian,
    German,
    French,
    Spanish,
    [Description("Simplified Chinese")]
    ChineseSimplified,
}
shubaobaomumen

@xmmtx

xmmtx commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

简体中文翻译一般都是 Simplified Chinese或者Chinese(Simplified)ChineseSimplified没见过这样表示的

现在是直接读代码里面的名字的,所以直接显示ChineseSimplified

用Description,我改了一下实现了

public enum Language
{
    System,
    English,
    Ukrainian,
    German,
    French,
    Spanish,
    [Description("Simplified Chinese")]
    ChineseSimplified,
}
shubaobaomumen

已提交新PR:#819

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.

4 participants