Skip to content

Localize user-facing reason strings in setting resolution warnings#1535

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-code-review-suggestion
Closed

Localize user-facing reason strings in setting resolution warnings#1535
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-code-review-suggestion

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

The reason strings interpolated into notifyUserOfSettingErrors's l10n.t(...) warning templates were hard-coded English (for managerNotRegistered and pathCannotResolve), producing partially-localized notifications in non-English locales.

Changes

  • getLocalizedReason(error) helper in src/features/interpreterSelection.ts — builds a fully localized reason from the structured kind (and configuredValue where needed). The English reason field is retained on SettingResolutionError for logs/diagnostics only.
  • Warning messages — the three l10n.t(...) calls in notifyUserOfSettingErrors now interpolate getLocalizedReason(firstError) instead of firstError.reason.
function getLocalizedReason(error: SettingResolutionError): string {
    switch (error.kind) {
        case 'managerNotRegistered':
            return l10n.t("Environment manager '{0}' is not registered", error.configuredValue);
        case 'pathUnresolvedVariables':
            return l10n.t('Path contains unresolved variables');
        case 'pathCannotResolve':
            return l10n.t("Could not resolve interpreter path '{0}'", error.configuredValue);
        default:
            return error.reason;
    }
}

Copilot AI changed the title [WIP] Fix code according to review comment Localize user-facing reason strings in setting resolution warnings May 21, 2026
Copilot AI requested a review from StellaHuang95 May 21, 2026 18:50
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.

2 participants