Skip to content

Localization cleanup: remove unused keys, localize hardcoded strings#15112

Draft
adamint wants to merge 6 commits intorelease/13.2from
localization-cleanup
Draft

Localization cleanup: remove unused keys, localize hardcoded strings#15112
adamint wants to merge 6 commits intorelease/13.2from
localization-cleanup

Conversation

@adamint
Copy link
Member

@adamint adamint commented Mar 10, 2026

Description

Comprehensive localization cleanup across the Aspire Dashboard, CLI, and VS Code extension:

  1. Remove unused resource keys from localization files
  2. Localize hardcoded user-facing strings that should go through the resource system
  3. Fix misspelled resource key (UnxpectedCodePathUnexpectedCodePath)

Dashboard Changes

Removed 11 unused resource keys across 6 .resx files:

  • AIAssistant.resx: SidebarShrinkDialog, ChatRequestErrorRateLimited
  • ConsoleLogs.resx: ConsoleLogsNoResourceSelected, ConsoleLogsPauseActive, ConsoleLogsPauseDetails
  • ControlsStrings.resx: ViewLogsLink, ViewStructuredLogsText
  • Dialogs.resx: SettingsExportAllButtonText, McpServerDialogOtherDescription
  • Resources.resx: ResourceDetailsViewConsoleLogs
  • StructuredLogs.resx: StructuredLogsMinimumLogFilter

Localized 1 hardcoded string:

  • MainLayout.razor: Hardcoded "MCP Server" → Layout.MainLayoutMcpServerLink

CLI Changes

Removed 35 unused resource keys across 16 .resx files:

  • AddCommandStrings: UsePrereleasePackages
  • AgentCommandStrings: ConfigUpdatesSelectPrompt, SkipNoneDescription
  • DoCommandStrings: GeneratingArtifacts
  • ErrorStrings: FailedToRetrieveCachedAllAspirePackages, SingleFileAppHostFeatureNotEnabled
  • InitCommandStrings: CreatingAppHostProject, CreatingServiceDefaultsProject, AddingProjectsToSolution
  • InteractionServiceStrings: DirectLink, CodespacesLink
  • LogsCommandStrings: ResourceRequiredWithoutFollow, TailRequiresResource
  • McpCommandStrings: InitCommand_AgentConfigurationSelectPrompt, InitCommand_AdditionalOptionsSelectPrompt, InitCommand_CreateAgentInstructionsPrompt, InitCommand_ConfigurePlaywrightPrompt
  • NewCommandStrings: UsePrereleaseTemplates
  • PublishCommandStrings: GeneratingArtifacts, InputPromptLoading
  • RootCommandStrings: FirstTimeUseWelcome
  • RunCommandStrings: ForceArgumentDescription, JsonArgumentDescription, WatchArgumentDescription, AgentConfigurationPrompt, AgentConfigurationYes, AgentConfigurationNo, AgentConfigurationMaybeLater, AgentConfigurationSelectPrompt, WaitingForAppHostToStart, IsolatedArgumentDescription
  • StopCommandStrings: MultipleAppHostsRunning
  • TelemetryCommandStrings: TraceIdArgumentDescription
  • UpdateCommandStrings: UnxpectedCodePath (misspelled)

Localized ~60 hardcoded user-facing strings across 18 source files:

  • ResourceCommandHelper.cs: 6 strings (command execution success/failure/cancel messages)
  • StopCommand.cs: 2 strings (found running app host, sending stop signal)
  • UpdateCommand.cs: 10 strings (self-update flow messages)
  • InitCommand.cs: 9 strings (project creation failure/success messages)
  • McpCallCommand.cs: 2 strings (JSON validation, tool call failure)
  • McpToolsCommand.cs: 1 string (no resources with MCP tools)
  • TelemetryTracesCommand.cs / TelemetrySpansCommand.cs: 1 string each (resource not found)
  • GuestAppHostProject.cs: 5 strings (run/publish/dependency errors, SDK/package updates)
  • SetupCommand.cs: 4 strings (bundle extraction messages)
  • CliTemplateFactory.EmptyTemplate.cs: 3 strings (language/project creation messages)
  • CliTemplateFactory.TypeScriptStarterTemplate.cs: 2 strings (project creation messages)
  • CliDownloader.cs: 1 string (validating download)
  • NuGetConfigPrompter.cs: 3 strings (NuGet config prompts)
  • LanguageService.cs: 2 strings (language preference messages)
  • RunningInstanceManager.cs: 1 string (stopping previous instance)
  • SdkDumpCommand.cs: 5 strings (integration/package validation errors)
  • SdkGenerateCommand.cs: 5 strings (SDK generation errors/results)
  • ScaffoldingService.cs: 1 string (build failure)

VS Code Extension Changes

Localized 7 hardcoded user-facing strings across 3 source files:

  • AspireDcpServer.ts: 4 DCP error messages (missing DCP prefix, unsupported launch config type, debug session not found, failed to start debug session)
  • dotnet.ts: 2 error messages (dotnet run-api failure, unexpected response type)
  • do.ts: 1 input placeholder ('deploy')

Validation

  • Dashboard: 1261 tests pass (0 failures)
  • CLI: All test failures are pre-existing (verified by running same tests on base branch) — caused by Spanish locale on test machine, not by these changes
  • Extension: TypeScript compilation and ESLint pass with 0 errors

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Dashboard:
- Removed 11 unused resource keys across 6 .resx files
- Localized hardcoded 'MCP Server' string in MainLayout.razor

CLI:
- Removed 35 unused resource keys across 16 .resx files
- Localized ~60 hardcoded user-facing strings across 18 source files
- Added corresponding resource entries to .resx and .Designer.cs files
- Fixed misspelled UnxpectedCodePath -> UnexpectedCodePath

Extension:
- No changes needed (all 131 localized keys are in use)
Copilot AI review requested due to automatic review settings March 10, 2026 22:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15112

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15112"

- DCP server: 4 error messages (missing DCP prefix, unsupported launch config,
  debug session not found, failed to start debug session)
- dotnet debugger: 2 error messages (run-api failures)
- do command: 1 input placeholder ('deploy')
@adamint adamint marked this pull request as draft March 10, 2026 22:38
adamint added 3 commits March 10, 2026 19:38
…n-cleanup

# Conflicts:
#	src/Aspire.Cli/Projects/GuestAppHostProject.cs
#	src/Aspire.Cli/Resources/ErrorStrings.resx
#	src/Aspire.Cli/Resources/NewCommandStrings.resx
#	src/Aspire.Cli/Resources/TemplatingStrings.Designer.cs
#	src/Aspire.Cli/Resources/TemplatingStrings.resx
#	src/Aspire.Cli/Templating/CliTemplateFactory.EmptyTemplate.cs
#	src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 298551b:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ❌ Upload failed
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ❌ Upload failed
RestoreGeneratesSdkFiles ❌ Upload failed
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ❌ Upload failed
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ❌ Upload failed
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22931846442

…atting

- Restored ConsoleLogsPauseActive and ConsoleLogsPauseDetails to ConsoleLogs.resx
- Fixed XML formatting in 6 resx files where key removal collapsed </data><data
- Removed orphaned Designer.cs properties for correctly-removed keys
- Updated XLF files for ConsoleLogs
- Fixed trailing whitespace in CLI files
@adamint adamint marked this pull request as ready for review March 11, 2026 02:08
@adamint adamint marked this pull request as draft March 11, 2026 02:08
@joperezr
Copy link
Member

Looks like this has gone out of date. Are you still planning to port the loc changes over for 13.2?

@joperezr
Copy link
Member

Chatted with @adamint offline. We are going to hold off on this until 13.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants