Introduce translation support and add Chinese (Simplified) translation#25
Introduce translation support and add Chinese (Simplified) translation#25SadPencil merged 10 commits intoCnCNet:masterfrom SadPencil:localization
Conversation
There was a problem hiding this comment.
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
TextResourceresource files with English and Chinese translations - Integration of
Resource.Embedderv1.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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
|
Won't it be better to use |
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> |
There was a problem hiding this comment.
| <value>组件 {0} 缺失。</value> | |
| <value>缺失必要的组件:{0}。</value> |
There was a problem hiding this comment.
In this commit, only the English version was updated, but the Chinese version still uses <value>组件 {0} 缺失。</value>.
Co-Authored-By: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com>
@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? |
|
@Damfoos said he is willing to help translating these strings |
Use
Resource.Embedderv1.2.8 to avoid introducing DLLs for multi-language ResX resources.Need a proofreading for this PR, especially the
Program.csfile, in case some codes or texts are accidentally changed.