feat(i18n): translate lineage column-path phrases; add common.counts namespace#17712
Conversation
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>
Bundle ReportChanges will increase total bundle size by 2.63kB (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: datahub-react-web-esmAssets Changed:
Files in
Files in
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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>
Summary
Closes the known gap deferred from #17707: the four lineage column-path phrases in
previewV2/EntityPathswhose word order and pluralization differ by language. Stacked oni18n-extract-preview-embed(#17707).These phrases couldn't be naively extracted because they mix direction-dependent word order with nested JSX and pluralized nouns:
{field} to {columns}— Upstream:{columns} to {field}Approach
<Trans>with direction-split + pluralizedentity.previewkeys, 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/_otherplural variants<field>,<columns/>,<relationship/>) passed viacomponentsso the column list / field name render inside the translated sentenceMigrated
ColumnsRelationshipText,ColumnPathsText,EntityPathsModaland removed their deferredeslint-disablecomments.Reusable
common.countsnamespaceAdded
common.countsfor standalone"{count} noun"counts (column/match/owner/query/row/tag/term) and moved the genericSearchPillpill 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:SchemaSearchInput→entity.profile.schema(searchInput.matchedColumns)DropdownHeader→ newentity.formnamespace (promptsRemaining/promptsCompleted/fieldLabel); also replaced deprecatedANTD_GRAY_V2/hardcoded colors with semantic theme tokens (required because the file was touched).Testing
ColumnPathsText.test.tsxcovers the 2×2 (direction × singular/plural) matrix: word-order forColumnsRelationshipTextand pluralized labels forColumnPathsText.yarn eslint(i18next jsx-only) — 0 errors on touched filesyarn tsc --noEmit— 0 errorsNotes
translated-files.txtupdated with the two newly-migrated files; theEntityPaths/SearchPillfiles were already opted in by feat(i18n): extract keys from entity preview cards #17707.Checklist
🤖 Generated with Claude Code