Skip to content

Introduce translation support and add Chinese (Simplified) translation#25

Merged
SadPencil merged 10 commits intoCnCNet:masterfrom
SadPencil:localization
Nov 14, 2025
Merged

Introduce translation support and add Chinese (Simplified) translation#25
SadPencil merged 10 commits intoCnCNet:masterfrom
SadPencil:localization

Conversation

@SadPencil
Copy link
Member

@SadPencil SadPencil commented Nov 13, 2025

Use Resource.Embedder v1.2.8 to avoid introducing DLLs for multi-language ResX resources.

Need a proofreading for this PR, especially the ‎Program.cs file, in case some codes or texts are accidentally changed.

Copy link
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

This PR introduces internationalization/localization support to the CnCNet Launcher by implementing a resource-based string management system using Resource.Embedder v1.2.8.

Summary: The pull request refactors all hardcoded UI strings into reusable resource files, enabling multi-language support. The implementation includes English (default) and Simplified Chinese (zh-Hans) translations.

Key Changes:

  • All user-facing strings extracted into TextResource resource files with English and Chinese translations
  • Integration of Resource.Embedder v1.2.8 package to avoid satellite DLLs
  • Minor code modernization (collection initializer syntax adjustments)

Reviewed Changes

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

Show a summary per file
File Description
Program.cs Replaced all hardcoded strings with TextResource references; added LocalizationResources namespace import; updated collection initializers for older C# compatibility
LocalizationResources/TextResource.resx Base English resource file containing all translatable strings with descriptive keys
LocalizationResources/TextResource.zh-Hans.resx Simplified Chinese translation file with matching resource keys
LocalizationResources/TextResource.Designer.cs Auto-generated strongly-typed resource accessor class
CnCNet.LauncherStub.csproj Added Resource.Embedder package reference (v1.2.8) and configured resource file code generation with debug symbol settings
Files not reviewed (1)
  • LocalizationResources/TextResource.Designer.cs: Language not supported

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

SadPencil and others added 3 commits November 13, 2025 19:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
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

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

Files not reviewed (1)
  • LocalizationResources/TextResource.Designer.cs: Language not supported

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

SadPencil and others added 2 commits November 13, 2025 20:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
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

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

Files not reviewed (1)
  • LocalizationResources/TextResource.Designer.cs: Language not supported

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

@SadPencil SadPencil marked this pull request as ready for review November 13, 2025 12:14
@Metadorius
Copy link
Member

Won't it be better to use Translation.ini from xna-cncnet-client?

@SadPencil
Copy link
Member Author

SadPencil commented Nov 13, 2025

Won't it be better to use Translation.ini from xna-cncnet-client?

Then we would need to duplicate a lot of codes here and make the exe less portable, likely an overkill for these hardcoded literal strings. In this PR, the launcher is still standalone as a single exe.

<value>请考虑升级到更新版本的 Windows。</value>
</data>
<data name="MissingComponent_Message_Line1" xml:space="preserve">
<value>组件 {0} 缺失。</value>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<value>组件 {0} 缺失。</value>
<value>缺失必要的组件:{0}。</value>

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 07a870c

Copy link
Member

Choose a reason for hiding this comment

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

07a870c

In this commit, only the English version was updated, but the Chinese version still uses <value>组件 {0} 缺失。</value>.

SadPencil and others added 3 commits November 14, 2025 07:48
@SadPencil SadPencil changed the title Introduce translation support Introduce translation support and add Chinese (Simplified) translation Nov 14, 2025
@SadPencil
Copy link
Member Author

Won't it be better to use Translation.ini from xna-cncnet-client?

Then we would need to duplicate a lot of codes here and make the exe less portable, likely an overkill for these hardcoded literal strings. In this PR, the launcher is still standalone as a single exe.

@Metadorius Are you okay with my defense? If so I plan to merge it and suggest other ones prepare for translations in Russian and maybe German

@Metadorius
Copy link
Member

@Metadorius Are you okay with my defense? If so I plan to merge it and suggest other ones prepare for translations in Russian and maybe German

I am fine with it. @MahBoiDeveloper are you up to translate the launcher exe?

@SadPencil
Copy link
Member Author

@Damfoos said he is willing to help translating these strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants