Conversation
|
Hi, this PR adds Simplified Chinese localization to the admin panel. The full solution builds successfully locally on Linux with .NET 10, all 116 Web tests pass, and Codacy checks pass. The Azure Pipelines check fails, but I don’t have permission to access its logs. Could you please help check the failure details and let me know if any changes are needed? Thank you for reviewing! |
sven-n
left a comment
There was a problem hiding this comment.
Thanks a lot for this contribution, it's a big and careful piece of work!
Verification
- Azure Pipelines failure is not caused by this PR. The
MUnique.OpenMUcheck fails instantly (start == end) on other PRs too, including already merged ones (#973, #977, #978), so it's an infrastructure issue on our side. - I built the PR head and a test merge onto the current
master(866b0f55, merges without conflicts) on Linux with .NET 10:dotnet build -c Release -p:ci=true→ 0 errors. - All test projects pass (Tests 1033, Web.Tests 116, PlugIns 41, Network.Packets 602, Persistence.Initialization, AttributeSystem, ChatServer, Network, Pathfinding).
Looks good
ModelResourceProvider.GetModelResourceStringwalks base types, which fixes captions for the persistence-generated derived model types.- Switching the culture selector and
RequestLocalizationOptionstoculture.Nameis needed forzh-CN. Existingde/envalues still resolve, because neutral cultures keep the same name. LocalizedPaginatorsubscribes to and unsubscribes fromPaginationStatecorrectly.FieldCaptionandEnumSelectnow useDisplayAttribute.GetName(), which respectsResourceType.
Before merging
-
TranslationCoverageTests.ChineseResourceSetsMatchNeutralKeysAndPlaceholdersmakes zh-CN mandatory for every new string. Every future PR that adds a key to one of the 12 neutral resource sets would fail CI unless it also adds a Chinese translation. No other language (e.g.de) has this requirement. Most contributors can't provide Chinese, so this would block unrelated work. Please keep the placeholder-consistency check (it's valuable), but only for keys that exist in zh-CN, and treat missing keys as fallback to English rather than a failure. -
Numbered resource keys like
BotConfiguration_Display1_Name…_Display13_Name(about 55 inGameLogic/Properties/PlugInResources.resx, 5 inPersistence.Initialization) have no link to the property they describe. Reordering or inserting a property silently makes the keys misleading, and reviewers can't see from the key what text it holds. Please name them after the member, e.g.BotConfiguration_ResetBots_Name/_Description, the same wayModelResourcesalready does ({Type}_{Property}_Caption).
Minor (non-blocking)
- Update plugins (e.g.
AddDuelConfigurationPlugIn) still keepPlugInName/PlugInDescriptionconstants for theName/Descriptionoverrides, while the[Display]text now lives in the resx. The English text is duplicated and can drift. Consider using the resource for both, or leaving the constants as the single source. PlugInPointCaptionuses the English name/description text itself as the resx key. Editing the text of a plug-in point attribute silently drops its translation. That's acceptable as a fallback, but worth a comment in the class.- Several
ToString()overrides inDataModelare now culture-dependent. They also show up in server logs, so a server running under a non-English UI culture will log localized text. Probably fine, just be aware.
Happy to merge once 1 and 2 are addressed. 🙂
Generated by Claude Code
Administrators can select Simplified Chinese (
zh-CN) for the admin panel,configuration editor, and built-in plugin metadata. This adds 12 Chinese resource
sets with 4,550 entries and replaces remaining hard-coded UI captions with
resource-backed text.
The accompanying code preserves regional culture names during selection and
request localization, discovers deployed satellite cultures, resolves captions
for derived model types, and localizes shared forms, validation messages,
pagination, enum labels, configuration summaries, plugin configuration fields,
and update descriptions. English remains the neutral fallback. Authorization
roles, plugin identifiers, and command syntax keep their original values.
Database records, schema migrations, configuration initialization, and gameplay
values are outside this change. Names stored in configuration data may still
require separate translations.
Related to #379.
Validation
Full solution build passed on Linux with .NET 10:
dotnet build src/MUnique.OpenMU.sln -c Release -p:ci=true --no-restore(0 errors; existing warnings remain).Release build and Web test suite passed: 116 tests, 0 failures, 0 skipped.
Command:
dotnet test tests/MUnique.OpenMU.Web.Tests/MUnique.OpenMU.Web.Tests.csproj -c Release -p:ci=true --no-restore.Existing analyzer and dependency warnings remain.
XML/resource audit: all 12 Chinese resource sets parse, with no duplicate keys,
missing nonempty neutral keys, or placeholder mismatches.
Localization tests exercise culture selection, enum round trips, model captions,
plugin display resources, resource completeness, and pagination behavior.
The implementation was also deployed locally for testing; the admin home,
plugin, and chat command pages returned HTTP 200 with Chinese UI content.
The isolated upstream branch excludes the local database-name completion work.