Skip to content

[AI] Fix budget template notification translations - #8478

Merged
jfdoming merged 4 commits into
actualbudget:masterfrom
DarthAmk97:fix/8413-budget-template-notification-i18n
Jul 17, 2026
Merged

jfdoming merged 4 commits into
actualbudget:masterfrom
DarthAmk97:fix/8413-budget-template-notification-i18n

Conversation

@DarthAmk97

@DarthAmk97 DarthAmk97 commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Budget template actions were returning English notification strings from loot-core, so the desktop client could only display them as-is.

This changes the server side to return stable notification keys plus the small bits of data the UI needs, like counts. The desktop client then maps those keys to normal translatable strings before showing the notification.

This follows the direction discussed on the existing PRs for #8413: keep i18n string extraction in the client instead of trying to make dynamic server strings translatable.

AI-assisted implementation drafted with Codex, then reviewed and edited before submission.

Related issue(s)

Fixes #8413

Testing

Tested locally:

  • corepack yarn generate:i18n
  • corepack yarn workspace @actual-app/core test:node src/server/budget/goal-template.test.ts src/server/budget/template-notes.test.ts
  • corepack yarn workspace @actual-app/web test src/budget/mutations.test.ts
  • corepack yarn exec oxfmt --check ...
  • corepack yarn exec oxlint --type-aware --quiet ...
  • corepack yarn workspace @actual-app/core typecheck
  • corepack yarn workspace @actual-app/web typecheck

Also verified the PR diff only includes the intended budget-template notification files and release note.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 30 13.28 MB → 13.28 MB (+1.82 kB) +0.01%
loot-core 1 4.83 MB → 4.83 MB (-275 B) -0.01%
api 2 3.88 MB → 3.88 MB (-278 B) -0.01%
cli 1 8.02 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
30 13.28 MB → 13.28 MB (+1.82 kB) +0.01%
Changeset
File Δ Size
src/budget/mutations.ts 📈 +1.82 kB (+13.89%) 13.08 kB → 14.89 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 5.28 MB → 5.28 MB (+1.82 kB) +0.03%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/AppliedFilters.js 36.47 kB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 760.33 kB 0%
static/js/PayeeRuleCountLabel.js 7.1 kB 0%
static/js/ReportRouter.js 1.28 MB 0%
static/js/TransactionList.js 85.19 kB 0%
static/js/bootstrapHyperFormula.js 302 B 0%
static/js/ca.js 174.64 kB 0%
static/js/da.js 98.1 kB 0%
static/js/de.js 181.92 kB 0%
static/js/en-GB.js 11.1 kB 0%
static/js/en.js 201.68 kB 0%
static/js/es.js 168.08 kB 0%
static/js/fr.js 169.79 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 155.52 kB 0%
static/js/narrow.js 359.49 kB 0%
static/js/nb-NO.js 139.35 kB 0%
static/js/nl.js 116.92 kB 0%
static/js/pl.js 139.95 kB 0%
static/js/pt-BR.js 182.8 kB 0%
static/js/th.js 170 kB 0%
static/js/theme.js 31.02 kB 0%
static/js/uk.js 204.6 kB 0%
static/js/useDateFormat.js 2.85 MB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 304.69 kB 0%
static/js/workbox-window.prod.es5.js 7.21 kB 0%
static/js/zh-Hans.js 109.57 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 4.83 MB → 4.83 MB (-275 B) -0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/template-notes.ts 📉 -35 B (-0.48%) 7.15 kB → 7.12 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/goal-template.ts 📉 -54 B (-0.73%) 7.24 kB → 7.19 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/cleanup-template.ts 📉 -186 B (-2.24%) 8.1 kB → 7.92 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.BybqcATr.js 0 B → 4.83 MB (+4.83 MB) -

Removed

Asset File Size % Changed
kcab.worker.CEHtIopf.js 4.83 MB → 0 B (-4.83 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
2 3.88 MB → 3.88 MB (-278 B) -0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/template-notes.ts 📉 -35 B (-0.49%) 6.96 kB → 6.93 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/goal-template.ts 📉 -55 B (-0.76%) 7.07 kB → 7.02 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/cleanup-template.ts 📉 -188 B (-2.33%) 7.89 kB → 7.71 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
index.js 3.88 MB → 3.88 MB (-278 B) -0.01%

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 8.02 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
cli.js 8.02 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.12 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 11.12 kB 0%

@netlify

netlify Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit e8cdec2
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/6a578f928771040008791a46
😎 Deploy Preview https://deploy-preview-8478.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@DarthAmk97

Copy link
Copy Markdown
Contributor Author

🤖 AI-assisted implementation. I could not apply the \AI generated\ label from the fork due permissions.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hello contributor!

We would love to review your PR! Before we can do that, please make sure:

  • ✅ All CI checks pass
  • ✅ The PR is moved from draft to open (if applicable)
  • ✅ The "[WIP]" prefix is removed from the PR title
  • ✅ The PR description follows the provided template, with all checklist boxes filled in
  • ✅ All CodeRabbit code review comments are resolved (if you disagree with anything - reply to the bot with your reasoning so we can read through it). The bot will eventually approve the PR.
  • ✅ Any AI usage is disclosed (see our AI Usage Policy)

A quick note on volume: please get one PR reviewed and merged before opening several more. A stack of simultaneous, similar PRs from one author is reviewed slowly, and low-effort, untested, or undisclosed-AI PRs may be closed without a detailed review.

We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges.

For more information, please see our Contributing Guide.

@DarthAmk97
DarthAmk97 marked this pull request as ready for review July 14, 2026 23:58
@DarthAmk97
DarthAmk97 requested a review from youngcw as a code owner July 14, 2026 23:58
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e504ad2-d771-48d0-ac7d-2b0ab23048d0

📥 Commits

Reviewing files that changed from the base of the PR and between a2a0b8e and e8cdec2.

📒 Files selected for processing (2)
  • packages/desktop-client/src/budget/mutations.test.ts
  • packages/desktop-client/src/budget/mutations.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/desktop-client/src/budget/mutations.ts
  • packages/desktop-client/src/budget/mutations.test.ts

📝 Walkthrough

Walkthrough

Budget template and cleanup operations now return shared notification identifiers and metadata. The desktop client translates these identifiers, formats count-based messages, and dispatches localized notifications. Tests and release notes reflect the updated notification contract.

Changes

Budget template notification translation

Layer / File(s) Summary
Shared notification contract
packages/loot-core/src/server/budget/template-notification.ts
Defines shared template notification identifiers, message types, and optional count and error metadata.
Template operation notification payloads
packages/loot-core/src/server/budget/goal-template.ts, packages/loot-core/src/server/budget/template-notes.ts, packages/loot-core/src/server/budget/*template.test.ts
Template application and checking flows return shared message identifiers, counts, sticky state, and error details, with assertions updated accordingly.
Cleanup notification payloads
packages/loot-core/src/server/budget/cleanup-template.ts
Cleanup branches use shared identifiers while retaining source, sink, warning, and error data.
Desktop translation and dispatch
packages/desktop-client/src/budget/mutations.ts, packages/desktop-client/src/budget/mutations.test.ts, upcoming-release-notes/...
Translates known template notifications, formats count-based cleanup messages, preserves unknown messages, and dispatches localized results.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TemplateAction
  participant useBudgetActions
  participant translateBudgetTemplateNotification
  participant NotificationsStore
  TemplateAction->>useBudgetActions: return typed template notification
  useBudgetActions->>translateBudgetTemplateNotification: translate message and counts
  translateBudgetTemplateNotification-->>useBudgetActions: localized notification
  useBudgetActions->>NotificationsStore: dispatch localized notification
Loading

Suggested reviewers: youngcw, matt-fidd

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: translating budget template notifications.
Description check ✅ Passed The description matches the changes, describing stable keys on the server and client-side translation.
Linked Issues check ✅ Passed The changes address the linked bug by replacing English-only budget template notifications with translatable keys and data.
Out of Scope Changes check ✅ Passed No obvious unrelated code changes stand out; the edits stay focused on budget-template notifications, tests, and release notes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

🧹 Nitpick comments (2)
packages/desktop-client/src/budget/mutations.ts (1)

63-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Export the BudgetTemplateNotification type.

Exporting this type is a good practice since it is used as a parameter in the exported translateBudgetTemplateNotification function. This prevents potential TypeScript declaration errors (TS4058) and allows consumers of the function to explicitly type their arguments if needed.

♻️ Proposed refactor
-type BudgetTemplateNotification = Notification & {
+export type BudgetTemplateNotification = Notification & {
   count?: number | undefined;
   sourceCount?: number | undefined;
   sinkCount?: number | undefined;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/desktop-client/src/budget/mutations.ts` around lines 63 - 67, Export
the BudgetTemplateNotification type so it is publicly available alongside the
exported translateBudgetTemplateNotification function. Keep its existing fields
and type definition unchanged.
packages/desktop-client/src/budget/mutations.test.ts (1)

38-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add test coverage for cleanup-applied pluralization logic.

The formatCleanupApplied function has several branches for handling singular/plural combinations of sourceCount and sinkCount. Adding a test case for these combinations would ensure the pluralization logic remains fully covered and regressions are prevented.

🧪 Proposed test cases
   it('leaves non-template notifications unchanged', () => {
     expect(
       translateBudgetTemplateNotification({ message: 'Already translated' }, t)
         .message,
     ).toBe('Already translated');
   });
+
+  it('translates cleanup notification counts with appropriate pluralization', () => {
+    expect(
+      translateBudgetTemplateNotification(
+        { message: 'cleanup-applied', sourceCount: 1, sinkCount: 2 },
+        t,
+      ).message,
+    ).toBe(
+      'Successfully returned funds from {{sourceCount}} source and funded {{sinkCount}} sinking funds.:{"sourceCount":1,"sinkCount":2}',
+    );
+
+    expect(
+      translateBudgetTemplateNotification(
+        { message: 'cleanup-applied', sourceCount: 2, sinkCount: 1 },
+        t,
+      ).message,
+    ).toBe(
+      'Successfully returned funds from {{sourceCount}} sources and funded {{sinkCount}} sinking fund.:{"sourceCount":2,"sinkCount":1}',
+    );
+  });
 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/desktop-client/src/budget/mutations.test.ts` around lines 38 - 44,
Add test coverage in the budget notification tests for the cleanup-applied path
handled by formatCleanupApplied, exercising its singular/plural combinations for
sourceCount and sinkCount. Assert the resulting translated message for each
combination while preserving the existing non-template notification test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/desktop-client/src/budget/mutations.test.ts`:
- Around line 38-44: Add test coverage in the budget notification tests for the
cleanup-applied path handled by formatCleanupApplied, exercising its
singular/plural combinations for sourceCount and sinkCount. Assert the resulting
translated message for each combination while preserving the existing
non-template notification test.

In `@packages/desktop-client/src/budget/mutations.ts`:
- Around line 63-67: Export the BudgetTemplateNotification type so it is
publicly available alongside the exported translateBudgetTemplateNotification
function. Keep its existing fields and type definition unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75a3a690-1b43-4345-a65b-e2a1d5425c0d

📥 Commits

Reviewing files that changed from the base of the PR and between 0c96d77 and 5fb8fa8.

📒 Files selected for processing (9)
  • packages/desktop-client/src/budget/mutations.test.ts
  • packages/desktop-client/src/budget/mutations.ts
  • packages/loot-core/src/server/budget/cleanup-template.ts
  • packages/loot-core/src/server/budget/goal-template.test.ts
  • packages/loot-core/src/server/budget/goal-template.ts
  • packages/loot-core/src/server/budget/template-notes.test.ts
  • packages/loot-core/src/server/budget/template-notes.ts
  • packages/loot-core/src/server/budget/template-notification.ts
  • upcoming-release-notes/translate-budget-template-notifications.md

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026

@jfdoming jfdoming 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.

Looks pretty good, thanks for working on this! One small issue with pluralization, otherwise looks good

Comment on lines +76 to +92
if (sourceCount === 1 && sinkCount === 1) {
return t(
'Successfully returned funds from {{sourceCount}} source and funded {{sinkCount}} sinking fund.',
{ sourceCount, sinkCount },
);
}
if (sourceCount === 1) {
return t(
'Successfully returned funds from {{sourceCount}} source and funded {{sinkCount}} sinking funds.',
{ sourceCount, sinkCount },
);
}
if (sinkCount === 1) {
return t(
'Successfully returned funds from {{sourceCount}} sources and funded {{sinkCount}} sinking fund.',
{ sourceCount, sinkCount },
);

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.

You shouldn't need all these cases, the translation software will allow i18next to choose the right pluralization for at least one of these if you use a variable called count and only one conditional. However that still doesn't handle all cases since some languages can have several plural forms—the best way would probably be to use https://www.i18next.com/translation-function/nesting#passing-options-to-nestings.

@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

🧹 Nitpick comments (2)
packages/loot-core/src/server/budget/cleanup-template.ts (1)

336-340: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider returning cleanup-applied when sources were processed.

Because this block is in the else branch of if (num_sources === 0), we know that funds were successfully returned from one or more sources. Returning cleanup-up-to-date here hides that information. If you remove this else if branch, the logic will fall through to cleanup-applied and correctly report Successfully returned funds from {{sourceCount}} sources... even if no sinks were funded because budgetAvailable was 0.

♻️ Proposed refactor
-    } else if (budgetAvailable === 0) {
-      return {
-        type: 'message',
-        message: 'cleanup-up-to-date',
-      };
     } else {
       return {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/loot-core/src/server/budget/cleanup-template.ts` around lines 336 -
340, Remove the `else if (budgetAvailable === 0)` branch in the cleanup result
logic so execution falls through to the existing `cleanup-applied` response
whenever sources were processed, including when no sinks could be funded.
Preserve the `num_sources === 0` handling and reuse the existing source-count
success message.
packages/desktop-client/src/budget/mutations.test.ts (1)

67-104: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use it.each for parametrized tests.

Consider using Vitest's it.each instead of a loop inside a single it block. This approach provides better test reporting because each iteration runs as a separate, independent test. If one case fails, it will output the specific parameters that caused the failure without preventing the remaining cases from executing.

💡 Proposed refactor to use `it.each`
-  it('translates cleanup notification counts with i18next pluralization', () => {
-    const cases = [
-      [
-        0,
-        0,
-        'Successfully returned funds from 0 sources and funded 0 sinking funds.',
-      ],
-      [
-        1,
-        1,
-        'Successfully returned funds from 1 source and funded 1 sinking fund.',
-      ],
-      [
-        1,
-        2,
-        'Successfully returned funds from 1 source and funded 2 sinking funds.',
-      ],
-      [
-        2,
-        1,
-        'Successfully returned funds from 2 sources and funded 1 sinking fund.',
-      ],
-      [
-        2,
-        2,
-        'Successfully returned funds from 2 sources and funded 2 sinking funds.',
-      ],
-    ] as const;
-
-    for (const [sourceCount, sinkCount, expected] of cases) {
-      expect(
-        translateBudgetTemplateNotification(
-          { message: 'cleanup-applied', sourceCount, sinkCount },
-          pluralT,
-        ).message,
-      ).toBe(expected);
-    }
-  });
+  it.each([
+    [
+      0,
+      0,
+      'Successfully returned funds from 0 sources and funded 0 sinking funds.',
+    ],
+    [
+      1,
+      1,
+      'Successfully returned funds from 1 source and funded 1 sinking fund.',
+    ],
+    [
+      1,
+      2,
+      'Successfully returned funds from 1 source and funded 2 sinking funds.',
+    ],
+    [
+      2,
+      1,
+      'Successfully returned funds from 2 sources and funded 1 sinking fund.',
+    ],
+    [
+      2,
+      2,
+      'Successfully returned funds from 2 sources and funded 2 sinking funds.',
+    ],
+  ])(
+    'translates cleanup notification counts with i18next pluralization (source: %i, sink: %i)',
+    (sourceCount, sinkCount, expected) => {
+      expect(
+        translateBudgetTemplateNotification(
+          { message: 'cleanup-applied', sourceCount, sinkCount },
+          pluralT,
+        ).message,
+      ).toBe(expected);
+    },
+  );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/desktop-client/src/budget/mutations.test.ts` around lines 67 - 104,
Refactor the cleanup notification test around
translateBudgetTemplateNotification to use Vitest’s it.each with the existing
cases as parameterized inputs. Remove the manual for loop and keep each
sourceCount, sinkCount, and expected message assertion unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/loot-core/src/server/budget/cleanup-template.ts`:
- Around line 323-329: Update the cleanup-applied-with-errors notification
return object in the cleanup flow to include type: 'error', matching the
equivalent num_sources === 0 error branch while preserving the existing fields.

---

Nitpick comments:
In `@packages/desktop-client/src/budget/mutations.test.ts`:
- Around line 67-104: Refactor the cleanup notification test around
translateBudgetTemplateNotification to use Vitest’s it.each with the existing
cases as parameterized inputs. Remove the manual for loop and keep each
sourceCount, sinkCount, and expected message assertion unchanged.

In `@packages/loot-core/src/server/budget/cleanup-template.ts`:
- Around line 336-340: Remove the `else if (budgetAvailable === 0)` branch in
the cleanup result logic so execution falls through to the existing
`cleanup-applied` response whenever sources were processed, including when no
sinks could be funded. Preserve the `num_sources === 0` handling and reuse the
existing source-count success message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85a30cb7-7ba8-4911-92e1-3d88307ccf68

📥 Commits

Reviewing files that changed from the base of the PR and between 5fb8fa8 and 55145a6.

📒 Files selected for processing (6)
  • packages/desktop-client/src/budget/mutations.test.ts
  • packages/desktop-client/src/budget/mutations.ts
  • packages/loot-core/src/server/budget/cleanup-template.ts
  • packages/loot-core/src/server/budget/goal-template.ts
  • packages/loot-core/src/server/budget/template-notes.ts
  • packages/loot-core/src/server/budget/template-notification.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/loot-core/src/server/budget/template-notes.ts
  • packages/loot-core/src/server/budget/goal-template.ts
  • packages/desktop-client/src/budget/mutations.ts

@DarthAmk97
DarthAmk97 force-pushed the fix/8413-budget-template-notification-i18n branch from a2500f8 to a2a0b8e Compare July 15, 2026 13:26

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/desktop-client/src/budget/mutations.ts`:
- Around line 69-91: Update formatCleanupApplied and the
cleanup-applied-with-errors formatting path to use full-sentence translation
keys with i18next nesting and count values, rather than translating
source/sinking fund fragments and interpolating a prebuilt sentence. Remove
reliance on the generic standalone keys, while preserving the existing
zero-default counts and error-case content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88e7db71-4c50-4bb7-b555-5991924d7d33

📥 Commits

Reviewing files that changed from the base of the PR and between a2500f8 and a2a0b8e.

📒 Files selected for processing (9)
  • packages/desktop-client/src/budget/mutations.test.ts
  • packages/desktop-client/src/budget/mutations.ts
  • packages/loot-core/src/server/budget/cleanup-template.ts
  • packages/loot-core/src/server/budget/goal-template.test.ts
  • packages/loot-core/src/server/budget/goal-template.ts
  • packages/loot-core/src/server/budget/template-notes.test.ts
  • packages/loot-core/src/server/budget/template-notes.ts
  • packages/loot-core/src/server/budget/template-notification.ts
  • upcoming-release-notes/translate-budget-template-notifications.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • upcoming-release-notes/translate-budget-template-notifications.md
  • packages/loot-core/src/server/budget/template-notification.ts
  • packages/loot-core/src/server/budget/cleanup-template.ts
  • packages/desktop-client/src/budget/mutations.test.ts
  • packages/loot-core/src/server/budget/template-notes.test.ts
  • packages/loot-core/src/server/budget/template-notes.ts
  • packages/loot-core/src/server/budget/goal-template.ts
  • packages/loot-core/src/server/budget/goal-template.test.ts

@DarthAmk97

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment on lines +69 to +71
// i18next-parser does not extract keys nested inside translation strings.
// t('budget-template-source', { count: 1, defaultValue_one: '{{count}} source', defaultValue_other: '{{count}} sources' })
// t('budget-template-sinking-fund', { count: 1, defaultValue_one: '{{count}} sinking fund', defaultValue_other: '{{count}} sinking funds' })

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.

Darn, this is kind of unfortunate. Perhaps we should open an upstream issue...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

are we then giving up on this trajectory? I seem to notice this issue has been closed?

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.

Why do you say the issue has been closed? It looks open to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

haha darn it, I saw the last thing by coderabbitai mentioning 8487 and thought it was about this 8478 my badd

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.

@youngcw I was leaving this PR open to give others a chance to comment, if you're fine with this approach then I'll just merge it

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.

The only reason I can think of to pause is if we wanted to update how the messages were handled with the new GUI system, but that can still be done later if we decide to

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.

I'm happy with this for now, I think it'll be a while until I get around to the way that things are applied at the moment, unless someone else wants to tackle it

@jfdoming
jfdoming added this pull request to the merge queue Jul 17, 2026
Merged via the queue into actualbudget:master with commit 79341b3 Jul 17, 2026
39 checks passed
RafaelEspino pushed a commit to RafaelEspino/actual that referenced this pull request Oct 28, 2026
* [AI] Fix budget template notification translations

* [AI] Address PR review feedback

* [AI] Preserve cleanup error notifications

* [AI] Use nested cleanup translation keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Notifications for some budget template actions are always shown in English (not marked as translatable)

4 participants