Skip to content

feat(i18n): translate lineage column-path phrases; add common.counts namespace#17712

Merged
max-datahub merged 4 commits into
masterfrom
i18n-lineage-column-paths
Jun 4, 2026
Merged

feat(i18n): translate lineage column-path phrases; add common.counts namespace#17712
max-datahub merged 4 commits into
masterfrom
i18n-lineage-column-paths

Conversation

@max-datahub
Copy link
Copy Markdown
Collaborator

Summary

Closes the known gap deferred from #17707: the four lineage column-path phrases in previewV2/EntityPaths whose word order and pluralization differ by language. Stacked on i18n-extract-preview-embed (#17707).

These phrases couldn't be naively extracted because they mix direction-dependent word order with nested JSX and pluralized nouns:

  • Downstream: {field} to {columns} — Upstream: {columns} to {field}
  • "Column paths from …" / "Upstream columns:" pluralize on path/column count

Approach

<Trans> with direction-split + pluralized entity.preview keys, so translators control both word order and plural forms:

  • columnRelationship.upstream / .downstream<columns/> to <field>{{fieldPath}}</field> (order flips per direction)
  • columnPaths.modalTitle / .tooltip / .upstreamColumnsLabel / .downstreamColumnsLabel_one/_other plural variants
  • Nested components (<field>, <columns/>, <relationship/>) passed via components so the column list / field name render inside the translated sentence

Migrated ColumnsRelationshipText, ColumnPathsText, EntityPathsModal and removed their deferred eslint-disable comments.

Reusable common.counts namespace

Added common.counts for standalone "{count} noun" counts (column/match/owner/query/row/tag/term) and moved the generic SearchPill pill counts (term/tag/owner/match) into it via inline-namespace keys — these were previously feature-scoped duplicates.

pluralize() → i18next convention (two examples)

Applied the count-interpolation convention to two pluralize() call sites as worked examples:

  • SchemaSearchInputentity.profile.schema (searchInput.matchedColumns)
  • DropdownHeader → new entity.form namespace (promptsRemaining/promptsCompleted/fieldLabel); also replaced deprecated ANTD_GRAY_V2/hardcoded colors with semantic theme tokens (required because the file was touched).

Testing

  • New ColumnPathsText.test.tsx covers the 2×2 (direction × singular/plural) matrix: word-order for ColumnsRelationshipText and pluralized labels for ColumnPathsText.
  • yarn eslint (i18next jsx-only) — 0 errors on touched files
  • yarn tsc --noEmit — 0 errors
  • Prettier clean

Notes

Checklist

  • PR conforms to the Contributing Guideline
  • Tests added
  • Docs added/updated (n/a)
  • Breaking changes (none)

🤖 Generated with Claude Code

max-datahub and others added 2 commits June 3, 2026 11:25
Extract hardcoded user-visible strings from the entity preview-card area
(src/app/previewV2 and src/app/preview) into a new entity.preview react-i18next
namespace. English only; translations follow separately.

- New en/entity.preview.json (57 keys), registered in i18n.ts and setupTests.ts.
- Migrate 15 files to t()/i18next.t()/<Trans>; pluralized counts (lineage,
  notes, queries, search pills) use _one/_other; Freshness uses lazy getters;
  Modal.confirm "Yes" reuses common.actions.
- Refactor SearchPill/Pills count tooltip from a caller-supplied English noun
  passed to pluralize() into per-noun pluralization keys.
- Replace a deprecated foundations color import in DataProcessInstanceInfo with
  a semantic theme token.

The src/app/embed files contain no user-visible strings (text lives in shared
subcomponents), so no embed namespace is created.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…namespace

Translate the previously-deferred lineage column-path phrases in
previewV2/EntityPaths via <Trans> with direction-split + pluralized
entity.preview keys (ColumnsRelationshipText, ColumnPathsText, EntityPathsModal),
removing the deferred eslint-disable comments. Add a 2x2 (direction x plural)
render test.

Add a reusable common.counts namespace for standalone "{count} noun" counts and
move the generic SearchPill pill counts (term/tag/owner/match) into it. Apply the
pluralize()->i18next convention to two examples: SchemaSearchInput
(entity.profile.schema) and DropdownHeader (new entity.form namespace; also
replaces deprecated ANTD_GRAY_V2/hardcoded colors with semantic theme tokens).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Bundle Report

Changes will increase total bundle size by 2.63kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 23.5MB 2.63kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 513 bytes 8.85MB 0.01%
assets/en-*.js 2.12kB 201.61kB 1.06%

Files in assets/index-*.js:

  • ./src/app/previewV2/EntityPaths/EntityPathsModal.tsx → Total Size: 2.51kB

  • ./src/app/previewV2/EntityPaths/ColumnsRelationshipText.tsx → Total Size: 1.02kB

  • ./src/app/previewV2/SearchPill.tsx → Total Size: 3.7kB

  • ./src/i18n/i18n.ts → Total Size: 9.6kB

  • ./src/app/previewV2/EntityPaths/ColumnPathsText.tsx → Total Size: 1.9kB

  • ./src/app/entity/shared/entityForm/schemaFieldPrompts/DropdownHeader.tsx → Total Size: 1.59kB

Files in assets/en-*.js:

  • ./src/i18n/locales/en/entity.preview.json → Total Size: 4.41kB

  • ./src/i18n/locales/en/entity.form.json → Total Size: 431 bytes

  • ./src/i18n/locales/en/common.counts.json → Total Size: 879 bytes

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
datahub-web-react/src/i18n/i18n.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Base automatically changed from i18n-extract-preview-embed to master June 4, 2026 05:51
max-datahub and others added 2 commits June 4, 2026 09:10
Resolve conflicts after #17707 (this PR's original base) was squash-merged and
QueryStat/Freshness were subsequently fixed on master via #17704:
- Freshness.tsx, QueryStat.tsx: take master's versions (this PR only inherited
  them from #17707; master has the newer fixes — nowrap restore + translated popover)
- EntityPaths/*, SearchPill.tsx: keep this PR's lineage column-path work
  (master side was just the #17707 baseline)
- entity.preview.json: union — master's freshness.popoverContent + pill.* alongside
  this PR's columnPaths.* / columnRelationship.* keys
- translated-files.txt: keep this PR's DropdownHeader / SchemaSearchInput entries

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-merge after #17701 (entity types) merged to master:
- SchemaSearchInput.tsx: take master's version — #17701 extracted the matched-columns
  label to entity.types:dataset.matchedColumnsCount, superseding this PR's duplicate
  entity.profile.schema extraction
- entity.profile.schema.json: revert to master (drop the now-orphaned
  searchInput.matchedColumns keys)
- registration files (i18n.ts/setupTests.ts/translated-files.txt) auto-merged

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@max-datahub max-datahub enabled auto-merge (squash) June 4, 2026 07:17
@max-datahub max-datahub merged commit 5184235 into master Jun 4, 2026
53 of 54 checks passed
@max-datahub max-datahub deleted the i18n-lineage-column-paths branch June 4, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-submitter-merge product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants