Localize UI strings to zh-CN#27
Conversation
Updated build process to use specific project files and improved artifact packaging.
|
Thanks, but of course I can't merge it as is. I'll consider merging a PR which adds proper localization support. |
There was a problem hiding this comment.
Pull request overview
This PR aims to localize the UWPSpy application to Simplified Chinese (zh-CN), translating UI strings throughout the application including dialog boxes, menus, error messages, and tooltips. The changes also convert resource files to UTF-8 encoding to support Chinese characters.
Changes:
- Translated all user-facing strings from English to Simplified Chinese across launcher and main application
- Updated resource files (.rc, .rc2) with UTF-8 code page pragma to support Chinese characters
- Added a GitHub Actions workflow file (unrelated to localization)
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| UWPSpyLauncher/process_spy.cpp | Localized error messages and warning prompts for architecture compatibility, file operations, and process inspection |
| UWPSpyLauncher/UWPSpyLauncher.rc2 | Added version resource with UTF-8 encoding for Chinese text support |
| UWPSpyLauncher/UWPSpyLauncher.rc | Changed code page to UTF-8 and translated dialog controls, buttons, and menu strings |
| UWPSpyLauncher/MainDlg.cpp | Translated dialog messages for process selection, about box, and error handling |
| UWPSpy/UWPSpy.rc2 | Added version resource with UTF-8 encoding and Chinese component description |
| UWPSpy/UWPSpy.rc | New file with UTF-8 encoding containing fully localized dialog resources and string tables |
| UWPSpy/MainDlg.cpp | Translated window title, tab labels, column headers, error messages, and context menu items |
| UWPSpy/AboutDlg.cpp | Localized error message for link opening failure |
| .github/workflows/build.yml | Added CI/CD workflow (unrelated to localization scope) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -17,7 +17,7 @@ | |||
|
|
|||
| #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) | |||
| LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US | |||
There was a problem hiding this comment.
The LANGUAGE directive specifies LANG_ENGLISH, SUBLANG_ENGLISH_US but the resource strings are in Simplified Chinese. This should be changed to LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED (0x0804) for proper localization. The language identifier affects how the operating system selects resources at runtime.
| button.SetWindowText(L"全部折叠"); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
| name += L"(当前)"; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
| auto parent = wux::Media::VisualTreeHelper::GetParent(element) | ||
| .try_as<wux::FrameworkElement>(); | ||
| if (parent && winrt::get_class_name(parent) == | ||
| if (parent && winrt::get_class_name(parent) == |
There was a problem hiding this comment.
The indentation appears to have been changed from the standard alignment (16 spaces) to 17 spaces. This inconsistency should be corrected to maintain proper code formatting.
| auto parent = wux::Media::VisualTreeHelper::GetParent(element) | ||
| .try_as<wux::FrameworkElement>(); | ||
| if (parent && winrt::get_class_name(parent) == | ||
| if (parent && winrt::get_class_name(parent) == |
There was a problem hiding this comment.
The indentation appears to have been changed from the standard alignment (16 spaces) to 17 spaces. This inconsistency should be corrected to maintain proper code formatting.
| attributesList.InsertColumn(c++, L"值", LVCFMT_LEFT, width / 2); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
| return; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
| groupName = L"(未命名)"; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This blank line appears to be unintentionally added and doesn't serve a purpose. Consider removing it to maintain consistent code formatting.
| name: build | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup NuGet | ||
| uses: nuget/setup-nuget@v2 | ||
|
|
||
| - name: Setup MSBuild | ||
| uses: microsoft/setup-msbuild@v2 | ||
|
|
||
| - name: Restore NuGet packages | ||
| run: nuget restore UWPSpy.sln | ||
|
|
||
| - name: Build Release x64 | ||
| shell: pwsh | ||
| run: | | ||
| $outDir = Join-Path $env:GITHUB_WORKSPACE "build\\" | ||
| New-Item -ItemType Directory -Force -Path $outDir | Out-Null | ||
| msbuild UWPSpyLauncher\\UWPSpyLauncher.vcxproj /m /p:Configuration=Release /p:Platform=x64 /p:OutDir="$outDir" | ||
| msbuild UWPSpy\\UWPSpy.vcxproj /m /p:Configuration=Release /p:Platform=x64 /p:OutDir="$outDir" | ||
| Write-Host "Build output:" | ||
| Get-ChildItem -Path $outDir -Filter *.exe | ||
| Get-ChildItem -Path $outDir -Filter *.dll | ||
|
|
||
| - name: Package artifacts | ||
| shell: pwsh | ||
| run: | | ||
| $outDir = "artifacts" | ||
| New-Item -ItemType Directory -Force -Path $outDir | Out-Null | ||
| Copy-Item "$env:GITHUB_WORKSPACE\\build\\UWPSpyLauncher.exe" -Destination $outDir | ||
| Copy-Item "$env:GITHUB_WORKSPACE\\build\\UWPSpy.dll" -Destination $outDir | ||
| Compress-Archive -Path "$outDir\\*" -DestinationPath "UWPSpy-Release-x64.zip" -Force | ||
|
|
||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: UWPSpy-Release-x64 | ||
| path: UWPSpy-Release-x64.zip | ||
|
|
||
| - name: Create GitHub Release | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: UWPSpy-Release-x64.zip |
There was a problem hiding this comment.
This GitHub Actions workflow file appears to be unrelated to the zh-CN localization work described in the PR. This should be submitted as a separate pull request to keep changes focused on their stated purpose.
Summary
Testing