[localization] Include template JSON files in OneLocBuild configuration. Fixes #20717#25717
[localization] Include template JSON files in OneLocBuild configuration. Fixes #20717#25717rolfbjarne wants to merge 1 commit into
Conversation
The templatestrings.en.json files in dotnet/Templates were not included in the LocProject.json configuration, which meant OneLocBuild never translated them. This caused Polish and Chinese Traditional translations to remain outdated (still referencing '.NET 6'). Replace the static LocProject.json.in template with a generate-loc-project.sh script that dynamically discovers all templatestrings.en.json files and includes them in the generated LocProject.json. This also fixes a duplicate entry for Microsoft.Macios.Generator/Resources.resx that was in the original .in file. Fixes #20717 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Updates the localization configuration used by OneLocBuild so that template localization source files (templatestrings.en.json under dotnet/Templates/) are included, fixing missed translations for template strings (issue #20717). It also removes a previously duplicated .resx entry by moving from a static JSON template to a generated file.
Changes:
- Replace the static
LocProject.json.intemplate with a bash generator that discovers alltemplatestrings.en.jsonfiles underdotnet/Templates/. - Update the devops Makefile target to generate
Localize/LocProject.jsonvia the new script. - Remove the duplicate
Microsoft.Macios.Generator/Resources.resxentry by regenerating the list from a single authoritative script.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/devops/Makefile | Switches LocProject generation to run the new discovery script. |
| tools/devops/LocProject.json.in | Removes the static template configuration (including a duplicate entry). |
| tools/devops/generate-loc-project.sh | New generator that emits LocProject.json with static .resx items plus discovered template JSON files. |
| LocProject.json: generate-loc-project.sh Makefile $(TOP)/Make.config | ||
| $(Q_GEN) $(TOP)/tools/devops/generate-loc-project.sh "$(PWD)" "$(TOP)" > $(TOP)/Localize/$@; |
| #!/bin/bash | ||
|
|
||
| # This script generates the LocProject.json file for OneLocBuild. | ||
| # It includes both the static .resx entries and dynamically discovered | ||
| # template JSON files (templatestrings.en.json). | ||
|
|
||
| WORKING_DIRECTORY="$1" | ||
| TOP="$2" | ||
|
|
||
| if [ -z "$WORKING_DIRECTORY" ] || [ -z "$TOP" ]; then | ||
| echo "Usage: $0 <working-directory> <top-directory>" >&2 | ||
| exit 1 | ||
| fi |
✅ [PR Build #a94069b] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #a94069b] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #a94069b] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #a94069b] Test results 🔥Test results❌ Tests failed on VSTS: test results 1 tests crashed, 11 tests failed, 182 tests passed. Failures❌ assembly-processing tests [attempt 2]🔥 Failed catastrophically on VSTS: test results - assembly-processing (no summary found). Html Report (VSDrops) Download ❌ linker tests (tvOS) [attempt 2]11 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The
templatestrings.en.jsonfiles indotnet/Templates/were not included in theLocProject.jsonconfiguration, which meant OneLocBuild never picked them up for translation.This PR replaces the static
LocProject.json.intemplate with agenerate-loc-project.shscript that dynamically discovers alltemplatestrings.en.jsonfiles and includes them in the generatedLocProject.json.This also fixes a duplicate entry for
Microsoft.Macios.Generator/Resources.resxthat was in the original.infile.Hopefully fixes #20717
🤖 Pull request created by Copilot