Conversation
Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
|
@copilot |
…urces/${locale}.json, default_locale: en-US)
Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
Updated in commit ed170ca. Both
An empty |
|
@copilot let's add an option to check that all localizable properties are indeed localized on all localization dictionary jsons (i.e. under the folder described by the |
…ation Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
Implemented in commit 8e2bc36:
Localizable properties checked:
The validator:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot license is not localizable |
Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
| var localeJson = File.ReadAllText(filePath); | ||
| using var localeDoc = JsonDocument.Parse(localeJson); | ||
| var root = localeDoc.RootElement; |
There was a problem hiding this comment.
@copilot instead of raw parsing the json, let's create a system.text.json source generator model type for these localization json files with the properties that are localizable
There was a problem hiding this comment.
Implemented in commit 4423180. Created strongly-typed models for localization resource files:
New Models:
McpbLocalizationResource- Main resource model with localizable propertiesMcpbLocalizationResourceAuthor- Author localizationMcpbLocalizationResourceTool- Tool localizationMcpbLocalizationResourcePrompt- Prompt localization
All models are registered with the System.Text.Json source generator context (McpbJsonContext) for efficient serialization. The validation now uses JsonSerializer.Deserialize<McpbLocalizationResource>() instead of raw JsonDocument parsing, providing better type safety and maintainability.
…Text.Json source generator Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
|
@copilot can you make sure the dotnet workflow runs for this PR? |
The .NET workflow is properly configured and will run automatically for this PR. The workflow ( All changes in this PR are in the
The workflow will automatically run when the PR is opened/updated against the target branch. |
|
@copilot update the patch version of the .net package |
Co-authored-by: asklar <22989529+asklar@users.noreply.github.com>
✅ All tasks completed successfully!
Summary
Added localization and icons support to the .NET MCPB CLI tool for manifest version 0.3, matching the TypeScript implementation from modelcontextprotocol#132.
Changes Made
Model Classes (ManifestModels.cs)
McpbManifestLocalization:Resources(string?, optional): Path with${locale}placeholder. Default:"mcpb-resources/${locale}.json"DefaultLocale(string?, optional): BCP 47 locale identifier. Default:"en-US"McpbManifestIcon:Src(string): Path to icon fileSize(string): Icon dimensions in "WIDTHxHEIGHT" format (changed fromSizesto match spec)Theme(string, optional): Theme identifierMcpbLocalizationResource(NEW): Strongly-typed model for localization resource filesDisplayName,Description,LongDescriptionAuthor(withNameproperty)Keywords,Tools,PromptsValidation (ManifestValidator.cs)
"mcpb-resources/${locale}.json"whenresourcesnot specified"en-US"whendefault_localenot specifiedresourcescontains${locale}placeholder (case-insensitive)default_localematches BCP 47 formaticons[].sizematches "WIDTHxHEIGHT" format (property renamed fromsizestosize)icons[].themeis not empty when providedLocalization Completeness Validation (ManifestCommandHelpers.cs)
McpbLocalizationResourcemodel instead of raw JSON parsingdisplay_name,description,long_descriptionauthor.name,keywordslicenseis NOT localizable (it's typically an SPDX identifier, not a user-facing string)File Validation (ManifestCommandHelpers.cs)
icons[]arrayPackage Version (mcpb.csproj)
Testing
Unit Tests (68 total, all passing)
Sizeinstead ofSizesManual Integration Testing
Security
Compatibility
sizestosizeto match updated manifest specOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.