Skip to content

refactor(i18n): native i18next plurals at call sites, plural-aware extraction - #35637

Merged
OrcaWin merged 15 commits into
mainfrom
OrcaWin/i18n-refactor-4
Oct 29, 2026
Merged

OrcaWin merged 15 commits into
mainfrom
OrcaWin/i18n-refactor-4

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​81 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69
Prod 182 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1959 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3612 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1653

Item 4 of the i18n audit follow-ups, part 1 of 2: the mechanism plus nearly every call site.

Problem

Plural call sites branched in code and passed literal suffixed keys:

count === 1 ? translate('x_one', oneText, { count }) : translate('x_other', otherText, { count })

resolvePluralFamilyKey then stripped the suffix again so CLDR could pick the form. Extraction ran with disablePlurals: true, so the English _one default was never checked for drift.

Change

  • Native plural calls. Sites now use i18next's native form:

    translate('x', otherText, { count, defaultValue_one: oneText })
    

    An AST codemod converted the count === 1 ternaries (about 310 families, in 166 source files). It only rewrote a ternary when the condition tested the same value passed as count, and the two branches had the same options. A handful of irregular sites were converted by hand, and leftover locals the codemod made unused were removed. Catalog keys are unchanged (x_one / x_other).

  • defaultValue_one added where it was missing. 21 families already called the base key but had no defaultValue_one, so their _one copy existed only in en.json. They now pass it explicitly, which lets the drift gate track it.

  • English fallbacks use English plural rules. i18next picks defaultValue_<suffix> with the active language's rule. So a Russian user with a key missing from their catalog would see English singular copy for 21 ("21 file"). The shared translate now passes the English default chosen by English rules. A pass-through count: undefined is treated like an absent count.

  • Extraction is plural-aware. disablePlurals is removed:

    • Both English defaults go through the fallback-drift gate.
    • A call that passes count without defaultValue_one still means a singular key that only fills {{count}}, and stays singular in en.json.
    • A pre-native call, a suffixed key passed with count, is still reported, so the old pattern can't creep back.
  • Catalog verify and sync understand native plural calls. verify:localization-catalog and sync:localization-catalog expand a native plural call (count plus defaultValue_one) into its x_one / x_other English entries.

  • Dead base keys removed. 22 base keys duplicated a sibling plural family in every catalog. i18next never reads them once count is passed, so they were removed.

Kept for the follow-up

Twelve families, about 13 call sites, keep special exact-1 copy ("Used the browser" vs "Used the browser {{count}} times"). Those families have no English _one. The follow-up PR converts them and ResourcePtyPanel, then drops resolvePluralFamilyKey from desktop translate. Mobile still uses it.

Verified

  • All four verify:localization-* checks pass, along with sync and pnpm tc.
  • Tests cover English and Russian one/few/many through the native call, Russian 21 falling back to English "21 files" in main, and the extraction and catalog verifier rules.

…plural fill

Each catalog load parsed the JSON, rebuilt it to fill CLDR plural forms
from _other, then deep-copied and deep-merged it into the store (about
26 ms after parsing per 1.3 MB catalog), and concurrent loads of one
locale fetched it twice.

- sync:localization-catalog now commits the plural forms a locale's
  CLDR rules need beside each _other (fr/es/pt many, tr one, a few
  de/ru), and verify:localization-catalog fails when one is missing.
  Plural forms may include {{count}} where English omits it.
- Renderer and main load built-in catalogs as-is; plugin packs keep the
  runtime fill.
- Renderer catalog requests are shared per locale; a timed-out request
  is dropped so a retry fetches again. Bundles are added with skipCopy.
- createOrcaI18n (src/shared/orca-i18n-instance.ts) owns the backend,
  init options, plugin-pack registration, resource-language resolution
  and the translate wrapper; main and renderer inject only how a
  built-in catalog loads (dynamic import vs. fetch) and extra modules.
- Remove setRendererUiLanguage (tests only); tests load then switch.
- resolveUiLocale maps built-ins by lookup instead of an if-chain, and
  catalog URLs/loaders are direct map lookups.
- Drop <I18nextProvider>: initReactI18next already binds the instance.
# Conflicts:
#	src/main/i18n/main-i18n.ts
…traction

Call sites branched on count === 1 and passed literal _one/_other keys,
which resolvePluralFamilyKey stripped again so CLDR could pick the form.
They now call translate('x', otherDefault, { count, defaultValue_one })
and i18next selects the form natively; catalog keys stay x_one/x_other.

- Converted 284 families with an AST codemod plus a few by hand; added
  defaultValue_one to 21 base-key families that relied on en.json.
- Extraction runs with plurals enabled, so both English defaults are
  checked for drift. A key that only fills {{count}} (no defaultValue_one)
  stays singular in en.json.
- verify/sync:localization-catalog expand a native plural call into its
  x_one/x_other English entries.
- Removed 22 base keys that a sibling plural family shadowed in every
  catalog.
# Conflicts:
#	config/scripts/locale-plural-forms.mjs
#	config/scripts/verify-localization-catalog.mjs
#	config/scripts/verify-localization-catalog.test.mjs
#	src/renderer/src/i18n/lazy-locale.test.ts
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/fr.json
#	src/renderer/src/i18n/locales/pt.json
#	src/shared/orca-i18n-instance.ts
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 03:58
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Moves plural calls to base keys with count and defaultValue_one, while keeping existing catalog families.

  • Count-based translations use native plural calls across app surfaces.
  • Localization checks track both English forms for native plural calls.

No actionable issues were found. Tests were inspected but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Call with base key, count, and English defaults"] --> B["translate"]
  B --> C["Choose English fallback using English rules"]
  C --> D["i18next looks up the active language's plural form"]
  D --> E{"Translation found?"}
  E -->|Yes| F["Show translated text"]
  E -->|No| G["Show English fallback"]
Loading

Reviews (3) · Last reviewed commit: "refactor(i18n): convert a plural site me..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1eb3f092-e544-4996-aa10-ac941b3b8fee
Commits

Reviewing files that changed from the base of the PR and between 6ba04ff and 27d62f5.

Files selected for processing: 15
  • src/renderer/src/components/automations/AutomationDetail.tsx
  • src/renderer/src/components/right-sidebar/FolderWorkspacePrChecksPanel.test.tsx
  • src/renderer/src/components/sidebar/wsl-host-failure-text.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-upload-report.test.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d8e3355-bf01-4d78-bb69-ad7f408e8374
Commits

Reviewing files that changed from the base of the PR and between 4b72dfc and 6ba04ff.

Files selected for processing: 13
  • src/main/i18n/main-i18n-lazy-locale.test.ts
  • src/renderer/src/i18n/lazy-locale.test.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 9
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh-Hant.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The change adds plural-family defaults to translation handling and updates localization extraction and catalog validation to recognize them. Counted labels across the application now use shared translation keys with singular fallback options instead of selecting singular and plural keys in code. English and other locale catalogs are updated with explicit plural forms. Tests cover catalog checks, extraction normalization, and plural selection across locales.

Priority: Normal

Merge Risk: Low · previous review 6ba04

Localization sync has a narrow edge-case risk for quoted plural options; merging is otherwise reasonable with bounded follow-up.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description provides a detailed problem statement, implementation summary, deferred scope, and verification results. However, it omits required template sections, including an actual linked issue,… Rewrite the description using the repository template. Add an actual issue link after “Fixes #”, add Visual Proof or state N/A with a reason, document testing steps and tested platforms, complete AI Disclosure when applicable, address Revie…
Docstring Coverage Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly describes the main change: migrating call sites to native i18next plural handling and making extraction plural-aware.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides a detailed problem statement, implementation summary, deferred scope, and verification results. However, it omits required template sections, including an actual linked issue, Visual Proof with N/A if applicable, the Testing checklist and platform details, AI Disclosure when applicable, Review, Notes, and Checklist confirmations.

Resolution

Rewrite the description using the repository template. Add an actual issue link after “Fixes #”, add Visual Proof or state N/A with a reason, document testing steps and tested platforms, complete AI Disclosure when applicable, address Review, Notes, and Checklist items, and retain the current technical summary and verification results.

Full details: Docstring Coverage

Explanation

Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 42 functions across 51 files. (11 skipped: 11 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0f949e4-416c-48cc-aa94-8773bb9c69fe
Commits

Reviewing files that changed from the base of the PR and between d8eef80 and 4b72dfc.

Files selected for processing: 185
  • config/i18next.config.ts
  • config/scripts/locale-plural-forms.mjs
  • config/scripts/verify-localization-catalog.mjs
  • config/scripts/verify-localization-catalog.test.mjs
  • config/scripts/verify-localization-extraction.mjs
  • config/scripts/verify-localization-extraction.test.mjs
  • src/main/i18n/main-i18n-lazy-locale.test.ts
  • src/main/local-builds/local-build-switch.ts
  • src/renderer/src/components/ClaudeAccountSwitchDialog.tsx
  • src/renderer/src/components/JiraLinkedWorkspaceAction.tsx
  • src/renderer/src/components/NativeChatRemoteResumeActions.tsx
  • src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
  • src/renderer/src/components/NativeChatResumeRunPanel.tsx
  • src/renderer/src/components/QuickOpen.tsx
  • src/renderer/src/components/activity/ActivityTitlebarControls.tsx
  • src/renderer/src/components/activity/activity-clear-completed.ts
  • src/renderer/src/components/activity/activity-thread-context-menu.tsx
  • src/renderer/src/components/automations/AutomationDetail.tsx
  • src/renderer/src/components/automations/AutomationListLocalRow.tsx
  • src/renderer/src/components/automations/AutomationRunHistory.tsx
  • src/renderer/src/components/automations/ExternalAutomationManagers.tsx
  • src/renderer/src/components/automations/automation-run-occurrences.ts
  • src/renderer/src/components/automations/automation-usage-model.ts
  • src/renderer/src/components/automations/external-automation-unchecked-hosts.ts
  • src/renderer/src/components/browser-extension-permission-messages.ts
  • src/renderer/src/components/dashboard-popout/AgentKanbanCard.tsx
  • src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.tsx
  • src/renderer/src/components/dashboard/DashboardAgentRow.tsx
  • src/renderer/src/components/editor/CheckRunJobs.tsx
  • src/renderer/src/components/editor/ConflictComponents.tsx
  • src/renderer/src/components/editor/IpynbViewer.tsx
  • src/renderer/src/components/editor/closed-unsaved-files-toast.ts
  • src/renderer/src/components/editor/combined-diff/review-controls/combined-diff-notes-popover.tsx
  • src/renderer/src/components/editor/combined-diff/review-controls/combined-diff-toolbar.tsx
  • src/renderer/src/components/editor/csv/CsvViewer.tsx
  • src/renderer/src/components/github-item-dialog/inspect-pull-request/pr-files-combined-diff-toolbar.tsx
  • src/renderer/src/components/github-project/project-view-error-copy.ts
  • src/renderer/src/components/github/CommentReactions.tsx
  • src/renderer/src/components/github/PRFilterSections.tsx
  • src/renderer/src/components/gitlab-item-dialog/gitlab-description-tab.tsx
  • src/renderer/src/components/host-picker/host-picker-copy.ts
  • src/renderer/src/components/linear-project-overview-content.tsx
  • src/renderer/src/components/linear-project-view-surfaces.tsx
  • src/renderer/src/components/linear-scope-selector.tsx
  • src/renderer/src/components/native-chat-restart-action-notifications.ts
  • src/renderer/src/components/native-chat-resume-activity-label.ts
  • src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx
  • src/renderer/src/components/native-chat/NativeChatTaskList.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx
  • src/renderer/src/components/native-chat/NativeChatTurnDiffRollup.tsx
  • src/renderer/src/components/native-chat/background-task-words-text.ts
  • src/renderer/src/components/native-chat/native-chat-image-label.ts
  • src/renderer/src/components/native-chat/native-chat-subagent-group-words-text.ts
  • src/renderer/src/components/native-chat/native-chat-tool-run-label.ts
  • src/renderer/src/components/onboarding/AgentStep.tsx
  • src/renderer/src/components/pr-check-counts.ts
  • src/renderer/src/components/project-host-count-label.ts
  • src/renderer/src/components/pull-request-page/files/toolbar.tsx
  • src/renderer/src/components/repo/NestedRepoScanLimitNotice.tsx
  • src/renderer/src/components/right-sidebar/AiVaultScanIssueBanners.tsx
  • src/renderer/src/components/right-sidebar/AiVaultScanProgressStrip.tsx
  • src/renderer/src/components/right-sidebar/AiVaultSessionListBar.tsx
  • src/renderer/src/components/right-sidebar/AiVaultSessionUnsavedNotice.tsx
  • src/renderer/src/components/right-sidebar/FolderWorkspacePrChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx
  • src/renderer/src/components/right-sidebar/SearchResultsPane.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/checks-list.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/comments-list.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/conflict-summary.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/triage-strip.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-multi-drag-image.ts
  • src/renderer/src/components/right-sidebar/github-pr-stack-confirmation.ts
  • src/renderer/src/components/right-sidebar/github-pr-stack-merge.ts
  • src/renderer/src/components/right-sidebar/source-control-count-localized-copy.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/bulk-action-bar.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/discard-confirmation.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/discard-dialog.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/use-discard-confirmation.ts
  • src/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsx
  • src/renderer/src/components/right-sidebar/source-control/listing/review-note-count-title.ts
  • src/renderer/src/components/right-sidebar/source-control/listing/section-header.tsx
  • src/renderer/src/components/right-sidebar/source-control/notes/diff-comments-clear-dialog-state.ts
  • src/renderer/src/components/right-sidebar/source-control/panel/branch-context-stats.ts
  • src/renderer/src/components/right-sidebar/source-control/sync/compare-summary.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerImport.ts
  • src/renderer/src/components/settings/ComputerUsePane.tsx
  • src/renderer/src/components/settings/McpConfigFileRow.tsx
  • src/renderer/src/components/settings/OrchestrationSkillAgentCoverage.tsx
  • src/renderer/src/components/settings/WarpThemeImportModal.tsx
  • src/renderer/src/components/settings/agent-permission-override-notice.tsx
  • src/renderer/src/components/settings/mcp-config-summary.ts
  • src/renderer/src/components/settings/useWarpThemeImport.ts
  • src/renderer/src/components/sidebar/AddRepoNestedImportStep.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeLineageNotice.tsx
  • src/renderer/src/components/sidebar/HiddenWorktreeRecoveryList.tsx
  • src/renderer/src/components/sidebar/HostRemoveDialog.tsx
  • src/renderer/src/components/sidebar/ImportedWorktreesVisibilityLine.tsx
  • src/renderer/src/components/sidebar/LocalGitToolchainScanBanner.tsx
  • src/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.tsx
  • src/renderer/src/components/sidebar/PreservedBranchBatchReviewDialog.tsx
  • src/renderer/src/components/sidebar/ProjectGroupDeleteDialog.tsx
  • src/renderer/src/components/sidebar/SetupScriptPromptCard.tsx
  • src/renderer/src/components/sidebar/SeveredTerminalDaemonBanner.tsx
  • src/renderer/src/components/sidebar/WorkspaceKanbanDrawerHeader.tsx
  • src/renderer/src/components/sidebar/WorkspaceKanbanSearchField.tsx
  • src/renderer/src/components/sidebar/WorktreeCardMetaBadges.tsx
  • src/renderer/src/components/sidebar/WorktreeCardPorts.tsx
  • src/renderer/src/components/sidebar/WorktreeLinkedItemsField.tsx
  • src/renderer/src/components/sidebar/active-filter-count-label.ts
  • src/renderer/src/components/sidebar/add-remote-host-ssh-actions.ts
  • src/renderer/src/components/sidebar/delete-worktree-dialog-copy.ts
  • src/renderer/src/components/sidebar/local-base-ref-suggestion-toast.tsx
  • src/renderer/src/components/sidebar/preserved-branch-batch-toast.tsx
  • src/renderer/src/components/sidebar/removal-unsaved-files.ts
  • src/renderer/src/components/sidebar/use-worktree-card-workspace-actions.ts
  • src/renderer/src/components/sidebar/workspace-batch-action-labels.ts
  • src/renderer/src/components/sidebar/worktree-card-model.ts
  • src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeader.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts
  • src/renderer/src/components/skills/SkillBundleInstallOutcome.tsx
  • src/renderer/src/components/skills/SkillInstallAgentPicker.tsx
  • src/renderer/src/components/skills/SkillInstallReviewContent.tsx
  • src/renderer/src/components/skills/SkillInstallRiskNotice.tsx
  • src/renderer/src/components/skills/skill-delete-copy.ts
  • src/renderer/src/components/skills/skill-display-labels.ts
  • src/renderer/src/components/skills/skill-freshness-summary-headline.tsx
  • src/renderer/src/components/skills/skill-managed-removal-summary.ts
  • src/renderer/src/components/skills/skill-plan-op-copy.ts
  • src/renderer/src/components/skills/skill-share-preview-summary.ts
  • src/renderer/src/components/skills/use-skill-delete-flow.ts
  • src/renderer/src/components/stats/UsageBreakdownSection.tsx
  • src/renderer/src/components/stats/UsageOverviewPane.tsx
  • src/renderer/src/components/stats/usage-overview-sections.tsx
  • src/renderer/src/components/status-bar/CodexSwitcherMenu.tsx
  • src/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsx
  • src/renderer/src/components/status-bar/PortsStatusSegment.tsx
  • src/renderer/src/components/status-bar/RemoteServerUpdateStatusSegment.tsx
  • src/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsx
  • src/renderer/src/components/status-bar/StatusBarAccountControls.tsx
  • src/renderer/src/components/status-bar/WorkspaceSpaceCompactPanel.tsx
  • src/renderer/src/components/status-bar/resource-manager-terminal-copy.ts
  • src/renderer/src/components/status-bar/resource-usage-popover-body.tsx
  • src/renderer/src/components/status-bar/resource-usage-popover-summary.tsx
  • src/renderer/src/components/status-bar/ssh-status-segment-copy.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/use-workspace-space-manager-panel.ts
  • src/renderer/src/components/status-bar/workspace-space-breakdown-list.tsx
  • src/renderer/src/components/status-bar/workspace-space-decision-hover-card.tsx
  • src/renderer/src/components/status-bar/workspace-space-decision-labels.ts
  • src/renderer/src/components/status-bar/workspace-space-format.ts
  • src/renderer/src/components/status-bar/workspace-space-manager-toolbar.tsx
  • src/renderer/src/components/task-page/github/List.tsx
  • src/renderer/src/components/task-page/jira/Content.tsx
  • src/renderer/src/components/task-page/linear/IssueToolbar.tsx
  • src/renderer/src/components/task-page/linear/linear-attribute-count-labels.ts
  • src/renderer/src/components/task-page/task-page-pr-delta-summary.ts
  • src/renderer/src/components/task-source-host-status-labels.ts
  • src/renderer/src/components/terminal-pane/NewerDaemonHoldBanner.tsx
  • src/renderer/src/components/terminal-pane/newer-daemon-hold-state.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-upload-report.ts
  • src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-remove.tsx
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-scan-notice.ts
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-selection-model.ts
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-sort-header.tsx
  • src/renderer/src/components/worktree-jump-palette-surface.tsx
  • src/renderer/src/hooks/composer-drop-failure-toast.ts
  • src/renderer/src/i18n/lazy-locale.test.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/native-file-drop-rejection-message.ts
  • src/renderer/src/ssh/ssh-host-moved-automations-copy.ts
  • src/renderer/src/ssh/ssh-host-server-status-copy.ts
  • src/shared/orca-i18n-instance.ts
Files with no reviewable changes: 1
  • config/i18next.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment on lines +23 to +24
const property = (name) => options.properties.find((entry) => entry.name?.getText() === name)
const one = property('defaultValue_one')

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.

Minor · Data Integrity & Integration · Quick win

Recognize quoted plural option names.

If a call uses { count, 'defaultValue_one': 'One file' }, getText() returns the quoted property name. pluralFamilyDefaults then records only the base key. Catalog sync can add that base key instead of the _one and _other keys that the counted runtime lookup uses. Compare the property name’s AST text value rather than its source spelling. (raw.githubusercontent.com)

Proposed fix
--- "a/config/scripts/locale-plural-forms.mjs"
+++ "b/config/scripts/locale-plural-forms.mjs"
@@ -20,7 +20,13 @@
   if (PLURAL_KEY_RE.test(key) || !options || !ts.isObjectLiteralExpression(options)) {
     return undefined
   }
-  const property = (name) => options.properties.find((entry) => entry.name?.getText() === name)
+  const property = (name) =>
+    options.properties.find(
+      (entry) =>
+        entry.name &&
+        (ts.isIdentifier(entry.name) || ts.isStringLiteral(entry.name)) &&
+        entry.name.text === name
+    )
   const one = property('defaultValue_one')
   // Without defaultValue_one, count only fills {{count}} in a singular key; without count, i18next reads the base key.
   if (!one || !property('count')) {
Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const property = (name) => options.properties.find((entry) => entry.name?.getText() === name)
const one = property('defaultValue_one')
const property = (name) =>
options.properties.find(
(entry) =>
entry.name &&
(ts.isIdentifier(entry.name) || ts.isStringLiteral(entry.name)) &&
entry.name.text === name
)
const one = property('defaultValue_one')

@OrcaWin
OrcaWin merged commit 938f9ff into main Oct 29, 2026
64 checks passed
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.

1 participant