Skip to content

plugins/aks-desktop: i18n: Add missing translations#416

Merged
illume merged 1 commit into
Azure:mainfrom
illume:msi18n
Mar 12, 2026
Merged

plugins/aks-desktop: i18n: Add missing translations#416
illume merged 1 commit into
Azure:mainfrom
illume:msi18n

Conversation

@illume
Copy link
Copy Markdown
Collaborator

@illume illume commented Mar 11, 2026

Description

Wraps all hard-coded user-facing strings in the plugins/aks-desktop folder with useTranslation t() for i18n support. Covers aria-labels, tooltips, placeholders, JSX text content, status labels, and error messages across components and hooks. Preserves existing JSX formatting (<code>, <strong>) for technical identifiers and emphasized text by translating surrounding text fragments separately. Adds aria-hidden="true" to all decorative Iconify icons inside buttons and icon buttons to prevent screen reader noise. Ensures t is included in all useEffect/useCallback dependency arrays where it is referenced.

Several components used the t(variable) anti-pattern — passing dynamically-referenced strings through t() (e.g., t(phase.label), t(stage.label), t(health.label)) — which the i18next-parser can't statically extract. All 11 instances across 9 source files have been refactored so that every t() call now uses a string literal argument, making all translation keys visible to the static extraction tool (npm run i18n).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Changes Made

Components (21 files):

  • Logo.tsx — aria-label
  • DeployTab.tsx, ClusterDeployCard.tsx, PipelineDeployDialog.tsx — table headers, buttons, alerts, tooltips, dialog title; <strong> formatting preserved for workflow filename and repo name; aria-hidden="true" on decorative icons (pencil, open-in-new, replay, rocket-launch)
  • PipelineCard.tsx — card text, button, tooltip, aria-label
  • WizardShell.tsx — step labels (translated at render via t(label)), aria-label, heading, alert; added aria-hidden="true" to decorative close icon
  • GitHubAuthStatusButton.tsx — tooltip titles (including t('GitHub: {{username}}', { username }) interpolation), button text, fallback text; aria-hidden="true" on both GitHub startIcons
  • ConnectSourceStep.tsx, RepoSelector.tsx — permissions, placeholders, aria-labels, template literals converted to t() interpolation; aria-hidden="true" on open-in-new startIcon; t added to useCallback dependency array for fetchRepos
  • DeploymentStatusScreen.tsx — stage labels, namespace/pipeline labels, pod status with proper singular/plural handling, buttons; aria-hidden="true" on open-in-new IconButton icon, open-in-new and refresh startIcons
  • PipelineConfiguredScreen.tsx, PRStatusScreen.tsx — status titles, descriptions, elapsed time (including {{minutes}} min interpolation); <strong> formatting preserved for repo name; aria-hidden="true" on open-in-new startIcon
  • WorkloadIdentitySetup.tsx — step labels, resource descriptions, alerts; <code> formatting preserved for owner/repo and branch identifiers; aria-hidden="true" on shield-check and refresh startIcons
  • GitHubPipelineWizard.tsx — loading spinner messages, footer buttons, error fallback; aria-hidden="true" on robot-outline/source-pull startIcon
  • ConfigurePipelineButton.tsx — button text; aria-hidden="true" on pipe startIcon
  • ConfigureContainer.tsx — 5 aria-labels (using translated label in interpolation); technical placeholders (registry/image:tag, /healthz, /ready, /startup) kept as untranslated literals; aria-hidden="true" on all 5 decorative info icons inside IconButtons
  • AccessStep.tsx — placeholder
  • ClusterConfigurePanel.tsx — addon labels, alert titles, button states; network policy info preserved as JSX with <code> formatting; error messages use single t() calls with {{error}} and {{addonKey}} interpolation; t added to useCallback dependency array for pollForCompletion
  • MetricsTab.tsx — AlertTitle

Hooks (6 files):

  • useAzureContext.ts — error messages passed to setError(); t added to useEffect dependency array
  • useDeploymentHealth.ts — error messages passed to setError(); t added to useEffect dependency array
  • usePipelineRuns.ts — error messages passed to setError(); t added to useCallback dependency array
  • useClusterDeployStatus.ts — error messages passed to setError(); t added to useEffect dependency array
  • useDeployments.ts — error messages passed to setError(); t added to useEffect dependency array
  • RepoSelector.tsx (fetchRepos callback) — error message passed to setError(); t added to useCallback dependency array

Accessibility improvements (16 files):

  • Added aria-hidden="true" to all decorative Iconify <Icon> components inside buttons, icon buttons, and tooltip-labeled controls where the parent element already provides the accessible name via button text, tooltip, or aria-label
  • Includes 5 info icons in ConfigureContainer.tsx (CPU request, CPU limit, memory request, memory limit, target CPU utilization), pipe icon in ConfigurePipelineButton.tsx, and rocket-launch icon in ClusterDeployCard.tsx

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

Test Cases

  1. npm run tsc — zero errors
  2. npm run lint — zero warnings
  3. npm run format — all files formatted
  4. Full vitest suite — all previously-passing tests still pass; 6 pre-existing jsdom failures unchanged

Screenshots/Videos

N/A — no visual changes; strings render identically via identity t() in English locale and all JSX formatting (<code>, <strong>) is preserved.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

None. All changes are additive — wrapping existing strings with t() which returns the key as-is for the default (English) locale.

Performance Impact

  • No performance impact
  • Performance improved
  • Performance degraded (explain why this is acceptable)

Documentation Updates

  • README.md updated
  • API documentation updated
  • Code comments updated
  • User guide updated
  • No documentation updates needed

@illume illume force-pushed the msi18n branch 3 times, most recently from 7b2019c to a4702c0 Compare March 11, 2026 19:51
@illume illume marked this pull request as ready for review March 11, 2026 19:51
Copilot AI review requested due to automatic review settings March 11, 2026 19:51
@illume illume added bug Something isn't working i18n p0 Highest priority labels Mar 11, 2026
Copy link
Copy Markdown
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.

Pull request overview

This PR expands i18n coverage in plugins/aks-desktop by wrapping user-facing strings with useTranslation().t() and updates locale JSON files accordingly, while also reducing screen reader noise by hiding decorative icons inside button controls.

Changes:

  • Wrapped UI strings (labels, tooltips, aria-labels, placeholders, alerts) across components/hooks with t(), and updated hook dependency arrays where t is referenced.
  • Added/moved translation keys across plugins/aks-desktop/locales/*/translation.json (including English source strings in en).
  • Added aria-hidden="true" to many decorative Iconify icons within buttons/icon buttons.

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
plugins/aks-desktop/src/hooks/useAzureContext.ts Localizes Azure context error strings and adds t to effect deps.
plugins/aks-desktop/src/hooks/useAzureContext.test.ts Mocks useTranslation for updated hook behavior.
plugins/aks-desktop/src/components/Scaling/hooks/useDeployments.ts Localizes error string and adds t to effect deps.
plugins/aks-desktop/src/components/Scaling/hooks/useDeployments.test.ts Extends Headlamp mock to include useTranslation.
plugins/aks-desktop/src/components/MetricsTab/MetricsTab.tsx Localizes “Metrics Unavailable” alert title.
plugins/aks-desktop/src/components/Logo/Logo.tsx Localizes the logo aria-label.
plugins/aks-desktop/src/components/GitHubPipeline/hooks/useDeploymentHealth.ts Localizes watcher error strings and adds t to effect deps.
plugins/aks-desktop/src/components/GitHubPipeline/components/WorkloadIdentitySetup.tsx Localizes UI strings and hides decorative startIcons.
plugins/aks-desktop/src/components/GitHubPipeline/components/WizardShell.tsx Localizes wizard shell text and hides decorative close icon.
plugins/aks-desktop/src/components/GitHubPipeline/components/RepoSelector.tsx Localizes placeholders/errors and adds t to callback deps.
plugins/aks-desktop/src/components/GitHubPipeline/components/PipelineConfiguredScreen.tsx Localizes status copy while preserving <strong> formatting.
plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Localizes status screen text, elapsed time formatting, and button labels.
plugins/aks-desktop/src/components/GitHubPipeline/components/GitHubAuthStatusButton.tsx Localizes tooltip/button strings and hides decorative GitHub icons.
plugins/aks-desktop/src/components/GitHubPipeline/components/DeploymentStatusScreen.tsx Localizes stage labels, status copy, and hides decorative icons in controls.
plugins/aks-desktop/src/components/GitHubPipeline/components/ConnectSourceStep.tsx Localizes auth/permissions copy and hides decorative icons in controls.
plugins/aks-desktop/src/components/GitHubPipeline/GitHubPipelineWizard.tsx Localizes loading/error UI strings and hides decorative startIcon.
plugins/aks-desktop/src/components/Deployments/hooks/usePipelineRuns.ts Localizes error string and adds t to callback deps.
plugins/aks-desktop/src/components/Deployments/PipelineCard.tsx Localizes pipeline card copy, tooltips, and aria-labels.
plugins/aks-desktop/src/components/DeployWizard/components/ConfigureContainer.tsx Localizes labels/aria-labels/tooltips and hides decorative info icons (most cases).
plugins/aks-desktop/src/components/DeployTab/hooks/useClusterDeployStatus.ts Localizes watcher error strings and adds t to effect deps.
plugins/aks-desktop/src/components/DeployTab/components/PipelineDeployDialog.tsx Localizes dialog content and hides decorative icons.
plugins/aks-desktop/src/components/DeployTab/components/ClusterDeployCard.tsx Localizes table headers/actions and hides decorative icons.
plugins/aks-desktop/src/components/DeployTab/DeployTab.tsx Localizes empty/heading text.
plugins/aks-desktop/src/components/CreateAKSProject/components/ClusterConfigurePanel.tsx Localizes cluster configuration UI/errors and adds t to callback deps.
plugins/aks-desktop/src/components/CreateAKSProject/components/ClusterConfigurePanel.test.tsx Mocks useTranslation for updated component behavior.
plugins/aks-desktop/src/components/CreateAKSProject/components/AccessStep.tsx Localizes email placeholder.
plugins/aks-desktop/src/components/ConfigurePipeline/ConfigurePipelineButton.tsx Localizes button/loading text and hides decorative icon.
plugins/aks-desktop/locales/zh-Hant/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/zh-Hans/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/tr/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/sv/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/ru/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/pt-PT/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/pt-BR/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/pl/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/nl/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/ko/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/ja/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/it/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/id/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/fr/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/es/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/en/translation.json Adds English source strings for newly localized UI.
plugins/aks-desktop/locales/de/translation.json Adds/moves keys used by newly localized UI strings.
plugins/aks-desktop/locales/cs/translation.json Adds/moves keys used by newly localized UI strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Outdated
Comment thread plugins/aks-desktop/src/components/DeployWizard/components/ConfigureContainer.tsx Outdated
Comment thread plugins/aks-desktop/src/components/Deployments/PipelineCard.tsx Outdated
Comment thread plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Outdated
@illume illume marked this pull request as draft March 11, 2026 19:59
@illume illume changed the title plugins/aks-desktop: Add missing translations WIP: plugins/aks-desktop: Add missing translations Mar 11, 2026
@illume illume requested a review from Copilot March 11, 2026 20:18
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Outdated
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Outdated
@illume illume force-pushed the msi18n branch 2 times, most recently from b6d8e15 to 32510bc Compare March 11, 2026 20:48
@illume illume requested a review from Copilot March 11, 2026 20:53
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/aks-desktop/src/components/DeployTab/components/ClusterDeployCard.tsx Outdated
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@illume illume marked this pull request as ready for review March 11, 2026 22:14
@illume illume changed the title WIP: plugins/aks-desktop: Add missing translations plugins/aks-desktop: Add missing translations Mar 11, 2026
@illume illume changed the title plugins/aks-desktop: Add missing translations plugins/aks-desktop: i18n: Add missing translations Mar 11, 2026
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 50 out of 50 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

plugins/aks-desktop/src/components/GitHubPipeline/components/WizardShell.tsx:100

  • getStepLabels(t) returns translated strings, and the stepper uses those translated labels as React keys (key={label}). Keys should be stable and not depend on locale/translation (translations can change or collide), otherwise React may remount steps unexpectedly or warn about duplicate keys. Consider mapping over a stable list of step IDs (e.g., ['connect-source', ...]) and deriving the translated label separately, using the ID as the key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@illume illume marked this pull request as draft March 11, 2026 22:18
@illume illume marked this pull request as ready for review March 11, 2026 22:32
Copilot AI review requested due to automatic review settings March 11, 2026 22:32
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 50 out of 50 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

plugins/aks-desktop/src/components/GitHubPipeline/components/DeploymentStatusScreen.tsx:173

  • getWorkflowBadgeLabel(...) returns hard-coded English status strings (e.g., "Succeeded", "Failed", "Running"), but the value is rendered directly as the Chip label and is not passed through t(). Those labels won’t be translatable / extracted by the i18n tooling. Consider either (a) changing getWorkflowBadgeLabel to accept t and return translated labels, or (b) returning stable i18n keys from getWorkflowBadgeLabel and translating at the call site (and adding the keys to the locale JSON files).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@illume
Copy link
Copy Markdown
Collaborator Author

illume commented Mar 12, 2026

rebased against main

@illume illume merged commit 2daf51e into Azure:main Mar 12, 2026
8 checks passed
@illume illume mentioned this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working i18n p0 Highest priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants