Skip to content

Use MarkdownString for privacy footer localization with embedded links#289271

Merged
osortega merged 3 commits intoosortega/planned-halibutfrom
copilot/sub-pr-289266
Jan 21, 2026
Merged

Use MarkdownString for privacy footer localization with embedded links#289271
osortega merged 3 commits intoosortega/planned-halibutfrom
copilot/sub-pr-289266

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 21, 2026

Consolidates fragmented localization strings in the agents welcome page privacy footer. Previously split across multiple localize() calls and DOM nodes, making proper translation difficult.

Changes

  • Replace manual anchor element creation with MarkdownString and markdown link syntax [Terms]({1}) and [Privacy Statement]({2})
  • Add IMarkdownRendererService injection to render the markdown
  • Use single localize() call with URL placeholders

Before:

desc.textContent = localize('tosDescription', "By continuing, you agree to {0}'s ", name);
const termsLink = append(desc, $<HTMLAnchorElement>('a'));
termsLink.textContent = localize('terms', "Terms");
desc.appendChild(document.createTextNode(localize('and', " and ")));
// ... more fragmented DOM manipulation

After:

const markdown = new MarkdownString(
  localize('tosDescription', 
    "By continuing, you agree to {0}'s [Terms]({1}) and [Privacy Statement]({2}).",
    name, termsUrl, privacyUrl
  ),
  { isTrusted: true }
);
desc.appendChild(markdownRendererService.render(markdown).element);

Follows the pattern used in chatWidget.ts, inlineChatWidget.ts, and gettingStartedContent.ts.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 21, 2026 00:50
…erns

Co-authored-by: osortega <48293249+osortega@users.noreply.github.com>
Co-authored-by: osortega <48293249+osortega@users.noreply.github.com>
Copilot AI changed the title [WIP] Update localization for privacy footer on agents welcome page Use MarkdownString for privacy footer localization with embedded links Jan 21, 2026
Copilot AI requested a review from osortega January 21, 2026 00:56
@osortega osortega marked this pull request as ready for review January 21, 2026 01:00
@osortega osortega merged commit 2657b9c into osortega/planned-halibut Jan 21, 2026
2 of 3 checks passed
@osortega osortega deleted the copilot/sub-pr-289266 branch January 21, 2026 01:00
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants