Skip to content

feat(i18n): extract java-agent namespace strings#651

Merged
jaydeluca merged 7 commits into
open-telemetry:mainfrom
eruizdechavez:i18n-3
Jun 15, 2026
Merged

feat(i18n): extract java-agent namespace strings#651
jaydeluca merged 7 commits into
open-telemetry:mainfrom
eruizdechavez:i18n-3

Conversation

@eruizdechavez

@eruizdechavez eruizdechavez commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds `en/java-agent.json` and `es/java-agent.json` covering all user-visible strings in the java-agent feature
  • Covers 48 source files: the full list of java-agent components, hooks, utilities, and pages
  • Replaces hardcoded module-level constants (`FORMAT_TABS`, `INSTRUMENTATIONS_SECTION_LABEL`, `CONTROL_TYPE_DISPLAY`, `SEMANTIC_CONVENTION_MAP`, `FEATURE_MAP`) with `t()` or `getI18n().t()` calls so labels stay translatable outside React component scope
  • Integrates `standalone-library-tab.tsx` added in [feat] Add Standalone Library tab to Java instrumentation detail page #664 (landed after the original branch was created)
  • Fixes follow-up strings found during manual testing: list page description/count/banner and format tab labels
  • Initializes i18next in the integration test setup, which had no i18next instance and caused all integration tests to fail after the namespace was introduced

Test plan

  • `bun run typecheck` passes
  • `bun run test` passes (1023 unit tests)
  • `bun run test:integration` passes (51 integration tests)
  • Java Agent instrumentation list, detail, and configuration builder pages render correctly in both languages

Assisted-By: This contribution was prepared with the assistance of an AI development tool.

@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for otel-ecosystem-explorer ready!

Name Link
🔨 Latest commit 9971c49
🔍 Latest deploy log https://app.netlify.com/projects/otel-ecosystem-explorer/deploys/6a2fdf262bf9b000083da9b2
😎 Deploy Preview https://deploy-preview-651--otel-ecosystem-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@eruizdechavez eruizdechavez marked this pull request as ready for review June 4, 2026 16:19
@eruizdechavez eruizdechavez requested review from a team as code owners June 4, 2026 16:19
Copilot AI review requested due to automatic review settings June 4, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces internationalization (i18n) support across the Ecosystem Explorer UI, including a feature-flagged language switcher and English/Spanish translation bundles.

Changes:

  • Add i18next + react-i18next configuration (HTTP backend + optional language detection via I18N feature flag).
  • Replace hardcoded UI copy across multiple pages/components with translation keys.
  • Add en/es locale JSON files and update dev/test feature-flag env defaults.

Reviewed changes

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

Show a summary per file
File Description
ecosystem-explorer/src/test/setup.ts Initializes i18n resources for unit tests.
ecosystem-explorer/src/main.tsx Loads i18n configuration at app startup.
ecosystem-explorer/src/lib/feature-flags.ts Adds I18N feature flag.
ecosystem-explorer/src/i18n/config.ts New i18next configuration with backend + optional language detection.
ecosystem-explorer/src/features/not-found/not-found-page.tsx Moves 404 copy to translations.
ecosystem-explorer/src/features/java-agent/utils/format.ts Translates semantic convention + feature labels via i18n.
ecosystem-explorer/src/features/java-agent/java-release-comparison-page.tsx Moves page text to translations.
ecosystem-explorer/src/features/java-agent/java-instrumentation-list-page.tsx Moves list UI strings (errors/loading/results) to translations.
ecosystem-explorer/src/features/java-agent/java-configuration-list-page.tsx Moves configuration list strings to translations.
ecosystem-explorer/src/features/java-agent/java-agent-page.tsx Moves landing copy to translations.
ecosystem-explorer/src/features/java-agent/instrumentation-detail-page.tsx Moves detail page labels/tooltips/empty states to translations.
ecosystem-explorer/src/features/java-agent/configuration/configuration-builder-page.tsx Moves builder UI strings to translations.
ecosystem-explorer/src/features/java-agent/configuration/components/union-renderer.tsx Localizes ARIA label for union chooser.
ecosystem-explorer/src/features/java-agent/configuration/components/preview-card.tsx Localizes preview card labels + ARIA text.
ecosystem-explorer/src/features/java-agent/configuration/components/plugin-select-renderer.tsx Localizes plugin picker labels/placeholders.
ecosystem-explorer/src/features/java-agent/configuration/components/list-renderer.tsx Localizes list add/remove UI + empty text.
ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-row.tsx Localizes row labels, counts, and ARIA strings.
ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-config-form.tsx Localizes empty-state message.
ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-config-field.tsx Localizes control labels, pills, and default preview.
ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-browser.tsx Localizes browser headings/readouts/empty states.
ecosystem-explorer/src/features/java-agent/configuration/components/group-renderer.tsx Localizes enable toggle ARIA label.
ecosystem-explorer/src/features/java-agent/configuration/components/field-section.tsx Localizes expand/collapse ARIA label + empty fallback.
ecosystem-explorer/src/features/java-agent/configuration/components/controls/primitive-list-control.tsx Localizes list control labels + empty state.
ecosystem-explorer/src/features/java-agent/configuration/components/controls/key-value-map-control.tsx Localizes map control labels/placeholders + announcements.
ecosystem-explorer/src/features/java-agent/configuration/components/controls/focus-managed-input-list.tsx Localizes accessibility announcements.
ecosystem-explorer/src/features/java-agent/configuration/components/controls/field-meta.tsx Localizes “Default” label.
ecosystem-explorer/src/features/java-agent/configuration/components/controls/control-wrapper.tsx Localizes “default” badge and reset link text.
ecosystem-explorer/src/features/java-agent/configuration/components/configuration-toc-sidebar.tsx Localizes tabs, search, and nav labels.
ecosystem-explorer/src/features/java-agent/configuration/components/circular-ref-placeholder.tsx Localizes circular reference message.
ecosystem-explorer/src/features/java-agent/components/version-selector.tsx Localizes default “Version” label.
ecosystem-explorer/src/features/java-agent/components/telemetry-section.tsx Localizes telemetry section headers and empty states.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/version-selector-panel.tsx Localizes comparison selector UI strings.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/telemetry-comparison-section.tsx Localizes comparison loading/errors/warnings.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/span-diff-card.tsx Localizes diff card status + messages.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/metric-diff-card.tsx Localizes diff card labels/messages.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/diff-results-section.tsx Localizes diff result headers and empty-state text.
ecosystem-explorer/src/features/java-agent/components/telemetry-comparison/attribute-diff-table.tsx Localizes attribute diff table headings/status text.
ecosystem-explorer/src/features/java-agent/components/sub-instrumentation-item.tsx Localizes item ARIA label.
ecosystem-explorer/src/features/java-agent/components/multi-instrumentation-group-card.tsx Localizes versions count label.
ecosystem-explorer/src/features/java-agent/components/instrumentation-filter-bar.tsx Localizes filter labels, placeholders, and tooltips.
ecosystem-explorer/src/features/java-agent/components/instrumentation-configuration-tab.tsx Localizes “no options” empty state.
ecosystem-explorer/src/features/java-agent/components/instrumentation-badges.tsx Localizes badge labels/tooltips/ARIA labels.
ecosystem-explorer/src/features/java-agent/components/configuration-selector.tsx Localizes selector banner/label.
ecosystem-explorer/src/features/java-agent/components/configuration-card.tsx Localizes default/examples/usage strings.
ecosystem-explorer/src/features/java-agent/components/attribute-table.tsx Localizes attributes table labels.
ecosystem-explorer/src/features/java-agent/components/agent-explore-landing.tsx Localizes landing navigation card copy.
ecosystem-explorer/src/features/home/components/hero-section.tsx Localizes hero headline + tagline.
ecosystem-explorer/src/features/home/components/explore-section.tsx Localizes explore navigation cards.
ecosystem-explorer/src/features/collector/collector-page.tsx Localizes collector landing copy + unavailable state.
ecosystem-explorer/src/features/collector/collector-detail-page.tsx Localizes collector detail labels/sections/stability/type descriptions.
ecosystem-explorer/src/features/collector/collector-components-page.tsx Localizes collector components list UI.
ecosystem-explorer/src/components/ui/copy-button.tsx Localizes “Copy/Copied” default labels.
ecosystem-explorer/src/components/ui/back-button.tsx Localizes “Back” default label.
ecosystem-explorer/src/components/layout/header.tsx Localizes header nav + adds feature-flagged language switcher.
ecosystem-explorer/src/components/layout/footer.tsx Localizes footer copy and links.
ecosystem-explorer/public/locales/es/layout.json Adds Spanish layout translations.
ecosystem-explorer/public/locales/es/java-agent.json Adds Spanish Java Agent translations.
ecosystem-explorer/public/locales/es/home.json Adds Spanish home translations.
ecosystem-explorer/public/locales/es/common.json Adds Spanish common translations.
ecosystem-explorer/public/locales/es/collector.json Adds Spanish collector translations.
ecosystem-explorer/public/locales/en/layout.json Adds English layout translations.
ecosystem-explorer/public/locales/en/java-agent.json Adds English Java Agent translations.
ecosystem-explorer/public/locales/en/home.json Adds English home translations.
ecosystem-explorer/public/locales/en/common.json Adds English common translations.
ecosystem-explorer/public/locales/en/collector.json Adds English collector translations.
ecosystem-explorer/package.json Adds i18n dependencies.
ecosystem-explorer/bun.lock Locks i18n dependency versions.
ecosystem-explorer/.env.test Disables I18N for tests.
ecosystem-explorer/.env.development Enables I18N for development.
Comments suppressed due to low confidence (4)

ecosystem-explorer/src/i18n/config.ts:1

  • With HttpBackend, translations load asynchronously. react-i18next defaults to Suspense-based loading; if the app isn't wrapped in a <Suspense fallback={...}>, initial renders can throw/suspend. Fix by either (a) adding react: { useSuspense: false } to the i18n init options and handling readiness manually, or (b) wrapping the application root in a Suspense boundary with an appropriate fallback.
    ecosystem-explorer/src/i18n/config.ts:1
  • The config registers the about namespace, but this PR doesn't add /public/locales/{lng}/about.json. That will cause backend requests for missing files (and potentially trigger Suspense or error noise depending on configuration). Either add en/about.json + es/about.json, or remove about from ns until those files exist.
    ecosystem-explorer/src/i18n/config.ts:1
  • The document <html lang> is only updated on languageChanged, so the initial language may never be applied (especially when language detection selects a non-default language on first load). Set document.documentElement.lang after initialization as well (e.g., in the init promise resolution or an initialized event handler) to ensure screen readers and accessibility tooling see the correct language from the first paint.
    ecosystem-explorer/src/test/setup.ts:1
  • i18next init(...) returns a promise; running it at module top-level without awaiting can create ordering/flakiness in tests that render before initialization completes. Move initialization into a beforeAll and await the init promise (or use initImmediate: false in the test-only init config if appropriate for your setup).

Comment thread ecosystem-explorer/src/components/layout/header.tsx
Comment thread ecosystem-explorer/src/features/collector/collector-detail-page.tsx Outdated
Assisted-By: This contribution was prepared with the assistance of an AI development tool.
Assisted-By: This contribution was prepared with the assistance of an AI development tool.
…ion-list-page

Assisted-By: This contribution was prepared with the assistance of an AI development tool.
…pace

Assisted-By: This contribution was prepared with the assistance of an AI development tool.
Components that call useTranslation() or getI18n().t() throw or return
key strings when no i18next instance exists. The integration test setup
did not initialize i18next, causing all java-agent integration tests to
fail after the namespace was extracted in the previous commit.

Assisted-By: This contribution was prepared with the assistance of an AI development tool.
@eruizdechavez eruizdechavez marked this pull request as ready for review June 10, 2026 14:35
# Conflicts:
#	ecosystem-explorer/src/features/java-agent/components/sub-instrumentation-item.tsx
#	ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-browser.tsx

@jaydeluca jaydeluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

@jaydeluca jaydeluca added this pull request to the merge queue Jun 15, 2026
Merged via the queue into open-telemetry:main with commit 1699bab Jun 15, 2026
23 checks passed
@otelbot

otelbot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @eruizdechavez! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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