Repository navigation
Fix build and complete the Simplified Chinese localization - #95
Open
Yangta0-L1yu wants to merge 3 commits into
Open
Yangta0-L1yu wants to merge 3 commits into
Yangta0-L1yu wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master currently does not compile, and the Simplified Chinese localization
looks like it was never built. This PR fixes the build and finishes the
localization that is already in the tree.
The build failure
src/viv.chas already been switched to theIDC_*_STATIC/_BUTTON/_COMBOBOX/_CHECKBOXnaming, butres/resource.handres/voidImageViewer.rcstill use the old control names,and several dialog labels still share the single
IDC_STATICid:Providing the ids alone is not enough: while the labels share
IDC_STATIC,os_SetDlgItemText_localization_id()can only ever reach the first one, so theChinese text silently never appears on the other labels of the same page.
What this changes
res/resource.h- new unique ids1055-1066for the labels that are setat runtime, and the remaining control ids aligned with the names
viv.calready uses. Previous names kept as aliases.
res/voidImageViewer.rc- controls renamed to match. Dialog text stays adesign-time placeholder, because every visible string is assigned from the
localization table at runtime; that keeps the script plain ASCII and
independent of any code page.
src/localization_zh_cn.h- corrections on top of the initial contribution:blit mode wording (
位图模式->绘制模式, the old term reads as a fileformat), view presets (
极简/紧凑/标准),删除到回收站/永久删除, and the association descriptions, which were still English(
Bitmap Image,PNG Image, ...) and are what Explorer shows in the"Open with" list. Two labels were shortened because they were wider than
their control.
Two build details are worth knowing if someone tries this locally:
/utf-8is required. Without it the UTF-8 table is read as ANSI andthe UI shows mojibake.
UNICODE/_UNICODEmust be defined, matching theCharacterSetthat
Release|x64already declares. Without them the wide buffers arefilled by the ANSI variants of the Win32 APIs and the process starts
without ever creating its main window.
Testing
MSVC 14.34.31933, SDK 10.0.19041.0,
Release|x64. On a Simplified Chinesesystem I checked the main window, all menus, the three options pages, About,
Rename, Jump To, custom rate and the keyboard shortcut dialogs. Each label was
measured against its control width to confirm nothing is clipped.
No functional change: no image loading, rendering, playlist or config code is
touched, and the version stays at 1.0.0.15.
Notes
All dialog text is populated at runtime, so the English build is untouched -
the language is still picked from the system UI language.
Happy to split this into "build fix" and "translation polish" as two commits,
or to drop the translation part entirely, if that is easier to review.
AI assistance
Worth stating plainly: the analysis, the patch and the build were produced with
the help of an AI coding agent (WorkBuddy), working from this source tree. I am
the one submitting it and I will answer for it - if something here is wrong,
that is on me, not on the tool.
I have also run the resulting build and gone through the menus and dialogs
myself, so the testing notes below reflect what I saw, not just what the agent
reported.
The patch is deliberately small and contains no logic changes - three files:


resource ids, the resource script, and strings. It should be reviewable on its
own merits rather than on trust in whatever produced it. If any part looks off,
I am happy to explain it or rework it by hand.