Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌍 improve translation strings - part 2 #4154

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

matt-fidd
Copy link
Contributor

Carrying on from #4041

This is the first of a series of changes to improve the translatable strings generated with react-i18n. At the moment, some sentences are broken up and lose context once exported.

I've also fixed any typos I've seen and migrated every file I've been in so far to use <Trans> inside React components where possible for consistency. There are also some places where the text used for the same action is inconsistent across the app - I've changed these where possible too.

Down to "O" now. I don't think I need to bother with release notes for the rest of these unless you do?

@matt-fidd matt-fidd requested a review from jfdoming January 14, 2025 23:35
@actual-github-bot actual-github-bot bot changed the title 🌍 improve translation strings - part 2 [WIP] 🌍 improve translation strings - part 2 Jan 14, 2025
@matt-fidd
Copy link
Contributor Author

/update-vrt

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 518bd08
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67892dc74e1fa10009985725
😎 Deploy Preview https://deploy-preview-4154.demo.actualbudget.org
📱 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 site configuration.

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
13 6.02 MB → 6.02 MB (+3.19 kB) +0.05%
Changeset
File Δ Size
src/components/modals/ConfirmTransactionEditModal.tsx 📈 +653 B (+16.68%) 3.82 kB → 4.46 kB
src/components/budget/tracking/budgetsummary/BudgetTotal.tsx 📈 +245 B (+13.63%) 1.76 kB → 2 kB
src/components/budget/BalanceWithCarryover.tsx 📈 +863 B (+13.39%) 6.29 kB → 7.14 kB
src/components/transactions/SimpleTransactionsTable.tsx 📈 +643 B (+10.11%) 6.21 kB → 6.84 kB
src/components/settings/Format.tsx 📈 +217 B (+4.47%) 4.74 kB → 4.96 kB
src/components/modals/EnvelopeBudgetSummaryModal.tsx 📈 +145 B (+4.28%) 3.31 kB → 3.45 kB
src/components/accounts/Reconcile.tsx 📈 +146 B (+2.74%) 5.2 kB → 5.34 kB
src/components/mobile/accounts/Accounts.tsx 📈 +234 B (+2.74%) 8.33 kB → 8.56 kB
src/components/reports/graphs/SpendingGraph.tsx 📈 +164 B (+2.02%) 7.94 kB → 8.1 kB
src/components/settings/index.tsx 📈 +87 B (+1.18%) 7.21 kB → 7.29 kB
src/components/reports/reports/CashFlow.tsx 📈 +98 B (+1.07%) 8.96 kB → 9.05 kB
src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx 📈 +49 B (+0.70%) 6.81 kB → 6.86 kB
src/components/modals/BudgetPageMenuModal.tsx 📈 +10 B (+0.50%) 1.96 kB → 1.97 kB
src/components/modals/CreateLocalAccountModal.tsx 📈 +33 B (+0.45%) 7.17 kB → 7.2 kB
src/components/modals/HoldBufferModal.tsx 📈 +8 B (+0.35%) 2.24 kB → 2.24 kB
src/components/modals/manager/DuplicateFileModal.tsx 📈 +10 B (+0.14%) 7.03 kB → 7.04 kB
src/components/schedules/ScheduleDetails.tsx 📈 +39 B (+0.12%) 30.8 kB → 30.84 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/errors.ts 📈 +2 B (+0.04%) 4.87 kB → 4.87 kB
src/components/App.tsx 📈 +2 B (+0.03%) 5.81 kB → 5.82 kB
src/components/budget/index.tsx 📈 +3 B (+0.03%) 9.13 kB → 9.13 kB
src/components/manager/subscribe/Login.tsx 📈 +1 B (+0.01%) 9.5 kB → 9.5 kB
src/components/reports/reports/CustomReport.tsx 📉 -1 B (-0.00%) 23.51 kB → 23.51 kB
src/components/modals/KeyboardShortcutModal.tsx 📉 -2 B (-0.02%) 12.65 kB → 12.64 kB
src/components/settings/Encryption.tsx 📉 -3 B (-0.06%) 5.08 kB → 5.07 kB
src/components/modals/EditRuleModal.jsx 📉 -36 B (-0.09%) 41.32 kB → 41.28 kB
home/runner/work/actual/actual/packages/loot-core/src/client/actions/budgets.ts 📉 -7 B (-0.11%) 6.42 kB → 6.42 kB
src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx 📉 -2 B (-0.14%) 1.37 kB → 1.36 kB
src/components/reports/reports/Calendar.tsx 📉 -130 B (-0.49%) 26.07 kB → 25.95 kB
src/components/modals/manager/FilesSettingsModal.tsx 📉 -35 B (-0.57%) 6 kB → 5.97 kB
src/components/reports/graphs/CalendarGraph.tsx 📉 -166 B (-1.87%) 8.65 kB → 8.49 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.78 MB → 3.78 MB (+2.81 kB) +0.07%
static/js/narrow.js 84.3 kB → 84.53 kB (+234 B) +0.27%
static/js/wide.js 100.98 kB → 101.12 kB (+146 B) +0.14%
static/js/ReportRouter.js 1.59 MB → 1.59 MB (+14 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/AppliedFilters.js 10.21 kB 0%
static/js/useAccountPreviewTransactions.js 1.63 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/en.js 96.91 kB 0%
static/js/uk.js 120.47 kB 0%
static/js/en-GB.js 96.9 kB 0%

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.33 MB → 1.33 MB (+7 B) +0.00%
Changeset
File Δ Size
packages/loot-core/src/shared/errors.ts 📈 +2 B (+0.03%) 5.68 kB → 5.69 kB
packages/loot-core/src/server/main.ts 📈 +5 B (+0.01%) 69.34 kB → 69.35 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.33 MB → 1.33 MB (+7 B) +0.00%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@matt-fidd matt-fidd force-pushed the translations-2 branch 2 times, most recently from bb884f7 to f80d091 Compare January 15, 2025 00:24
@matt-fidd
Copy link
Contributor Author

/update-vrt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jfdoming interesting...it makes sense but I hadn't thought of it.

This is a new string that's not in weblate yet, and so pulls in as nothing when the translations are fetched.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah ok, you've got me convinced to use cimode 😅 will take a look as soon as I can

@matt-fidd matt-fidd changed the title [WIP] 🌍 improve translation strings - part 2 🌍 improve translation strings - part 2 Jan 15, 2025
Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

Walkthrough

This pull request encompasses a comprehensive set of modifications across multiple files in the desktop client and core packages, primarily focusing on internationalization (i18n), text formatting, and error message improvements. The changes span numerous components, with a consistent theme of enhancing translation capabilities, improving text capitalization, and refining user-facing messages. Key areas of modification include integrating the Trans component from react-i18next, updating text capitalization, improving error message clarity, and ensuring consistent localization across the application. The modifications do not fundamentally alter the underlying application logic but instead concentrate on improving the user interface's text presentation and translation support.

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • MikesGlitch

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a47e00c and 518bd08.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Functional
  • GitHub Check: Visual regression
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: Analyze
  • GitHub Check: build (ubuntu-latest)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (10)
packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx (1)

104-106: LGTM! Consider one minor consistency improvement.

The error message changes appropriately specify "budget file" instead of just "budget", which aligns with the PR's goal of improving translation string clarity and consistency.

For complete consistency, consider updating the error message in the notification dispatch as well:

         dispatch(
           addNotification({
             type: 'error',
-            message: t('Failed to duplicate budget file.'),
+            message: t('Failed to duplicate budget file'),
           }),
         );

This removes the trailing period to match the format of the other error messages.

packages/desktop-client/src/components/schedules/ScheduleDetails.tsx (1)

974-976: Consider standardizing error message handling across the component.

While this specific error message is well-formatted for translation, other error messages in the component (e.g., schedule saving error with URL) could benefit from the same named interpolation pattern for consistency.

Example of consistent error message formatting:

- error: t('An error occurred while saving. Please visit https://actualbudget.org/contact/ for support.'),
+ error: t('An error occurred while saving. Please visit {{supportUrl}} for support.', { supportUrl: 'https://actualbudget.org/contact/' }),
packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx (1)

81-89: Good use of Trans component, with minor optimization opportunities

The transition to using the Trans component with proper interpolation is a good improvement for translation handling. However, there are a couple of potential optimizations:

  1. Consider extracting the '28+' translation outside the interpolation:
+ const dayPlus = t('28+');
  <Trans>
    Day:{' '}
    {{
      dayOfMonth:
        Number(payload[0].payload.day) >= 28
-         ? t('28+')
+         ? dayPlus
          : payload[0].payload.day,
    }}
  </Trans>
  1. Consider extracting the magic number 28 into a named constant for better maintainability:
+ const LAST_DAY_THRESHOLD = 28;
  <Trans>
    Day:{' '}
    {{
      dayOfMonth:
-       Number(payload[0].payload.day) >= 28
+       Number(payload[0].payload.day) >= LAST_DAY_THRESHOLD
          ? dayPlus
          : payload[0].payload.day,
    }}
  </Trans>
packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx (2)

143-143: Consider using Trans component for modal title consistency.

While using t('Settings') works correctly, consider using the Trans component for consistency with other translated strings in this file:

-title={t('Settings')}
+title={<Trans>Settings</Trans>}

This would maintain a consistent approach to translations throughout the component.

Also applies to: 157-157


Line range hint 143-190: Consider enhancing keyboard accessibility for scrollable content.

The file paths are displayed in scrollable containers. Consider adding keyboard navigation support to allow users to scroll these containers using arrow keys. This would improve accessibility for keyboard users.

Example implementation:

function handleKeyDown(e: React.KeyboardEvent) {
  const container = e.currentTarget;
  if (e.key === 'ArrowLeft') {
    container.scrollLeft -= 50;
  } else if (e.key === 'ArrowRight') {
    container.scrollLeft += 50;
  }
}

Then add to the scrollable Text component:

 <Text
   title={documentDir}
+  tabIndex={0}
+  onKeyDown={handleKeyDown}
   style={{
     /* existing styles */
   }}
 >
packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx (1)

78-80: Consider standardizing variable naming across notifications.

The implementation is good and consistent with the transfer message pattern. Consider standardizing the variable name to sourceCategoryName to be more explicit about its role in the context of covering overbudgeted amounts.

-            message: t('Covered overbudgeted from {{categoryName}}', {
-              categoryName: categoriesById[categoryId].name,
+            message: t('Covered overbudgeted from {{sourceCategoryName}}', {
+              sourceCategoryName: categoriesById[categoryId].name,
packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx (1)

55-57: Consider adding translation comments for better context.

While the translation string is now properly structured with placeholders, adding a translation comment would help translators understand what usedAmount and allocatedAmount represent in this context.

 <Trans>
+  {/* Translators: Shows budget usage, e.g., "$500 of $1000" */}
   {{ usedAmount: '' }} of {{ allocatedAmount: '' }}
 </Trans>
packages/desktop-client/src/components/settings/Format.tsx (1)

24-41: Well-structured hook for days of week translations.

Good improvements:

  • Proper typing with SyncedPrefs
  • Translations moved to a reusable hook
  • Consistent structure for all days

Consider adding a JSDoc comment to document the hook's purpose and return type.

+/**
+ * Hook to provide translated days of the week
+ * @returns {{ daysOfWeek: Array<{ value: SyncedPrefs['firstDayOfWeekIdx']; label: string }> }}
+ */
 function useDaysOfWeek() {
packages/desktop-client/src/components/accounts/Reconcile.tsx (1)

86-93: Improved translation string structure with proper typing.

Good improvements:

  • Proper use of TransObjectLiteral type
  • Clear placeholders for dynamic values
  • Maintained HTML structure within translation

Consider adding a translation comment to explain the context and placeholders.

 <Trans>
+  {/* Translators: Shows reconciliation status with bank balance comparison */}
   Your cleared balance{' '}
   <strong>{{ clearedBalance } as TransObjectLiteral}</strong>{' '}
   needs <strong>{{ difference } as TransObjectLiteral}</strong> to
   match
   <br /> your bank&apos;s balance of{' '}
   <Text style={{ fontWeight: 700 }}>
     {{ bankBalance } as TransObjectLiteral}
   </Text>
 </Trans>
packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx (1)

214-234: Consider extracting label translations to constants.

While the translation implementation is correct, consider extracting these frequently used labels to constants at the top of the file to improve maintainability and reusability.

+const CASH_FLOW_LABELS = {
+  income: t('Income:'),
+  expenses: t('Expenses:'),
+  change: t('Change:'),
+  transfers: t('Transfers:'),
+  balance: t('Balance:'),
+};

 // Then in the JSX:
-              left={t('Income:')}
+              left={CASH_FLOW_LABELS.income}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b92fa70 and 397d0be.

⛔ Files ignored due to path filters (27)
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (39)
  • packages/desktop-client/src/components/App.tsx (1 hunks)
  • packages/desktop-client/src/components/accounts/Account.tsx (2 hunks)
  • packages/desktop-client/src/components/accounts/Reconcile.tsx (2 hunks)
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (2 hunks)
  • packages/desktop-client/src/components/budget/SidebarCategory.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/SidebarGroup.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/index.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx (2 hunks)
  • packages/desktop-client/src/components/filters/NameFilter.tsx (1 hunks)
  • packages/desktop-client/src/components/manager/subscribe/Login.tsx (1 hunks)
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx (2 hunks)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx (3 hunks)
  • packages/desktop-client/src/components/modals/EditRuleModal.jsx (2 hunks)
  • packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx (5 hunks)
  • packages/desktop-client/src/components/modals/HoldBufferModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx (3 hunks)
  • packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/reports/Calendar.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/reports/CashFlow.tsx (1 hunks)
  • packages/desktop-client/src/components/reports/reports/CustomReport.tsx (3 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx (3 hunks)
  • packages/desktop-client/src/components/schedules/ScheduleDetails.tsx (1 hunks)
  • packages/desktop-client/src/components/schedules/ScheduleLink.tsx (1 hunks)
  • packages/desktop-client/src/components/settings/Encryption.tsx (1 hunks)
  • packages/desktop-client/src/components/settings/Format.tsx (2 hunks)
  • packages/desktop-client/src/components/settings/index.tsx (1 hunks)
  • packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx (4 hunks)
  • packages/loot-core/src/client/actions/budgets.ts (1 hunks)
  • packages/loot-core/src/server/main.ts (1 hunks)
  • packages/loot-core/src/shared/errors.ts (1 hunks)
✅ Files skipped from review due to trivial changes (23)
  • packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
  • packages/desktop-client/src/components/manager/subscribe/Login.tsx
  • packages/desktop-client/src/components/budget/SidebarGroup.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/schedules/ScheduleLink.tsx
  • packages/desktop-client/src/components/filters/NameFilter.tsx
  • packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx
  • packages/desktop-client/src/components/modals/HoldBufferModal.tsx
  • packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
  • packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx
  • packages/desktop-client/src/components/settings/Encryption.tsx
  • packages/desktop-client/src/components/modals/EditRuleModal.jsx
  • packages/desktop-client/src/components/accounts/Account.tsx
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
  • packages/loot-core/src/server/main.ts
  • packages/desktop-client/src/components/budget/SidebarCategory.tsx
  • packages/desktop-client/src/components/reports/reports/Calendar.tsx
  • packages/desktop-client/src/components/reports/reports/CashFlow.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
  • packages/desktop-client/src/components/settings/index.tsx
  • packages/loot-core/src/client/actions/budgets.ts
  • packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
🧰 Additional context used
📓 Learnings (3)
packages/loot-core/src/shared/errors.ts (1)
Learnt from: tlesicka
PR: actualbudget/actual#3689
File: packages/loot-core/src/server/main.ts:1873-1877
Timestamp: 2024-11-10T16:45:25.627Z
Learning: In the `duplicate-budget` function in `packages/loot-core/src/server/main.ts`, when `loadBudget` returns an object with an `error` property where `error` is a string, returning `error` directly is consistent with the function's declared return type `Promise<string>`.
packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx (4)
Learnt from: tlesicka
PR: actualbudget/actual#3689
File: packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx:181-196
Timestamp: 2024-11-10T16:45:25.627Z
Learning: After refactoring `nameError` in `DuplicateFileModal.tsx`, it's not necessary to use `setNameError` in the `onPress` handlers when validation fails.
Learnt from: tlesicka
PR: actualbudget/actual#3689
File: packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx:144-156
Timestamp: 2024-11-10T16:45:31.225Z
Learning: In `packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx`, styles for buttons may differ for each button in the future, so avoid suggesting extraction of common styles in this file.
Learnt from: tlesicka
PR: actualbudget/actual#3689
File: packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx:181-196
Timestamp: 2024-11-10T16:45:25.627Z
Learning: In `DuplicateFileModal.tsx`, `trim()` is performed during the blur event when validating `newName`, so additional trimming is not necessary in the `onPress` handlers.
Learnt from: tlesicka
PR: actualbudget/actual#3689
File: packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx:0-0
Timestamp: 2024-11-10T16:45:25.627Z
Learning: In `DuplicateFileModal.tsx`, the `validateAndSetName` function trims `newName` before validation and duplication.
packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (1)
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-11-10T16:45:31.225Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.
🔇 Additional comments (30)
packages/desktop-client/src/components/schedules/ScheduleDetails.tsx (1)

974-974: Great improvement to the translation string!

The change from direct interpolation {props.error} to named interpolation {{ errorReason: props.error }} is a good practice for internationalization. Named interpolations provide better context for translators and prevent potential issues with word order in different languages.

packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx (1)

3-3: LGTM: Import change aligns with i18n best practices

Adding the Trans component import is appropriate for handling complex translations with interpolation.

packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx (1)

112-117: Well-structured translation implementation!

The use of Trans component here is appropriate as it keeps the entire string, including HTML formatting, as a single translatable unit. This prevents sentence fragmentation and maintains context for translators.

packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx (4)

28-29: LGTM! Good hook placement.

Moving the translation hook to the start of the component follows React hooks best practices and improves code organization.


45-45: Great improvement to the modal title!

The new title "Transfer to category" is clearer and more translation-friendly by:

  • Using simpler language
  • Removing unnecessary punctuation
  • Providing better context for translators

56-59: Excellent i18n implementation!

The notification message now:

  • Uses proper i18next interpolation syntax
  • Has descriptive variable names
  • Allows for flexible word order in different languages

69-69: Consistent improvement in modal title!

The simplified title maintains the pattern of improvements seen earlier:

  • Removes unnecessary punctuation
  • Uses more natural language
  • Maintains consistency with other modal titles
packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx (1)

7-7: LGTM! Import statement added correctly.

The Trans component import aligns with the PR's objective of improving translation handling.

packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx (3)

3-3: LGTM! Import statement updated correctly.

Good practice to keep both useTranslation and Trans imports together.


38-77: Well-structured translation blocks for different scenarios.

The translation strings are now properly structured and provide better context for translators. Each condition has its own clear, complete sentence.


100-118: Consistent pattern for accessibility and visible text.

Good practice using:

  • t() for aria-labels
  • Trans component for visible button text
packages/desktop-client/src/components/settings/Format.tsx (1)

79-80: LGTM! Clean hook usage.

The hook is properly destructured and used in the component.

packages/desktop-client/src/components/accounts/Reconcile.tsx (2)

8-8: LGTM! Type import added correctly.

Good addition of TransObjectLiteral type for improved type safety.


100-106: Consistent capitalization in UI text.

Good improvements in text consistency:

  • "Done reconciling" instead of "Done Reconciling"
  • "Create reconciliation transaction" instead of "Create Reconciliation Transaction"
packages/loot-core/src/shared/errors.ts (1)

104-106: LGTM! Improved error message clarity and translation support.

The changes enhance the error message by:

  • Using proper {{id}} syntax for i18n variable interpolation
  • Correcting capitalization of "ID"
  • Adding helpful context about where to find the budget ID in settings
packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx (1)

4-4: LGTM! Enhanced translation support for complex text.

The changes properly implement the Trans component for text containing links and HTML elements, which is the recommended approach for handling complex translations in react-i18next.

Also applies to: 130-130, 142-152

packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx (2)

129-134: LGTM! Proper handling of dynamic text translation.

The account field correctly uses the t() function for the dynamic "No account" fallback text while preserving the account name display.


220-220: LGTM! Consistent use of Trans component for static labels.

Table headers now properly use the Trans component for static text, improving translation management.

Also applies to: 226-226, 232-232, 238-238, 244-244, 250-250, 256-256

packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx (1)

153-154: LGTM! Good variable renaming to avoid conflicts.

The parameter renaming from t to trans in map functions prevents confusion with the translation function.

Also applies to: 156-157

packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (5)

8-8: LGTM!

The necessary imports for the Trans component and TransObjectLiteral type are correctly added.

Also applies to: 12-12


153-153: LGTM!

The static text is correctly wrapped with the Trans component for translation.


157-166: LGTM!

The translation is correctly implemented with dynamic value interpolation for the amount.


170-179: LGTM!

The translation is correctly implemented with dynamic value interpolation for the amount.


184-205: LGTM!

The translations are correctly implemented with:

  • Dynamic value interpolation for goal type and amount
  • Proper type casting using TransObjectLiteral
packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (3)

2-2: LGTM!

The necessary import for the Trans component is correctly added.


198-202: LGTM!

The translation is correctly implemented with HTML-like elements for rich text formatting.


259-259: LGTM!

The aria-label is correctly implemented with translation support, improving accessibility.

packages/desktop-client/src/components/reports/reports/CustomReport.tsx (3)

2-2: LGTM!

The necessary imports for the Trans component and TransObjectLiteral type are correctly added.

Also applies to: 20-20


701-703: LGTM!

The translation is correctly implemented with dynamic value interpolation for the report name.


709-718: LGTM!

The translation is correctly implemented with:

  • HTML-like elements for text formatting
  • Dynamic value interpolation for the report name
  • Proper type casting using TransObjectLiteral

@matt-fidd
Copy link
Contributor Author

/update-vrt

@matt-fidd
Copy link
Contributor Author

/update-vrt

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 (4)
packages/desktop-client/src/components/settings/Format.tsx (2)

24-41: Memoize the days array to prevent unnecessary re-renders.

The daysOfWeek array is recreated on every render. Consider using useMemo to optimize performance.

 function useDaysOfWeek() {
   const { t } = useTranslation();
 
-  const daysOfWeek: {
-    value: SyncedPrefs['firstDayOfWeekIdx'];
-    label: string;
-  }[] = [
+  const daysOfWeek = React.useMemo(() => ([
     { value: '0', label: t('Sunday') },
     { value: '1', label: t('Monday') },
     { value: '2', label: t('Tuesday') },
     { value: '3', label: t('Wednesday') },
     { value: '4', label: t('Thursday') },
     { value: '5', label: t('Friday') },
     { value: '6', label: t('Saturday') },
-  ] as const;
+  ] as const), [t]);
 
   return { daysOfWeek };
 }

Line range hint 1-1: Consider enabling TypeScript strict mode.

The file currently disables strict type checking with @ts-strict-ignore. Consider addressing the TypeScript errors and enabling strict mode for better type safety.

packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (2)

153-179: Consider extracting funding status messages for better maintainability.

The translation implementation looks good, but the nested conditional rendering could be simplified by extracting the funding status messages into a separate component or helper function.

Example refactor:

const FundingStatus = ({ difference, format }) => {
  if (difference === 0) {
    return (
      <span style={{ color: theme.noticeText }}>
        <Trans>Fully funded</Trans>
      </span>
    );
  }
  
  const isOverfunded = difference > 0;
  return (
    <span style={{ color: isOverfunded ? theme.noticeText : theme.errorText }}>
      <Trans>
        {isOverfunded ? 'Overfunded (' : 'Underfunded ('}
        {{ amount: format(difference, 'financial') }}
        )
      </Trans>
    </span>
  );
};

184-205: Consider creating a type-safe translation key mapping.

While the current implementation works, we could improve type safety for translation keys by creating a mapping between the goal types and their translations.

Example:

const GOAL_TYPE_TRANSLATIONS = {
  LONG: 'Long',
  TEMPLATE: 'Template',
} as const;

// Then use it like:
type: longGoalValue === 1 
  ? t(GOAL_TYPE_TRANSLATIONS.LONG) 
  : t(GOAL_TYPE_TRANSLATIONS.TEMPLATE)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 397d0be and a47e00c.

⛔ Files ignored due to path filters (27)
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (39)
  • packages/desktop-client/src/components/App.tsx (1 hunks)
  • packages/desktop-client/src/components/accounts/Account.tsx (2 hunks)
  • packages/desktop-client/src/components/accounts/Reconcile.tsx (2 hunks)
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (2 hunks)
  • packages/desktop-client/src/components/budget/SidebarCategory.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/SidebarGroup.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/index.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx (2 hunks)
  • packages/desktop-client/src/components/filters/NameFilter.tsx (1 hunks)
  • packages/desktop-client/src/components/manager/subscribe/Login.tsx (1 hunks)
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx (2 hunks)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx (3 hunks)
  • packages/desktop-client/src/components/modals/EditRuleModal.jsx (2 hunks)
  • packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx (5 hunks)
  • packages/desktop-client/src/components/modals/HoldBufferModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx (3 hunks)
  • packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/reports/Calendar.tsx (2 hunks)
  • packages/desktop-client/src/components/reports/reports/CashFlow.tsx (1 hunks)
  • packages/desktop-client/src/components/reports/reports/CustomReport.tsx (3 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx (3 hunks)
  • packages/desktop-client/src/components/schedules/ScheduleDetails.tsx (1 hunks)
  • packages/desktop-client/src/components/schedules/ScheduleLink.tsx (1 hunks)
  • packages/desktop-client/src/components/settings/Encryption.tsx (1 hunks)
  • packages/desktop-client/src/components/settings/Format.tsx (2 hunks)
  • packages/desktop-client/src/components/settings/index.tsx (1 hunks)
  • packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx (4 hunks)
  • packages/loot-core/src/client/actions/budgets.ts (1 hunks)
  • packages/loot-core/src/server/main.ts (1 hunks)
  • packages/loot-core/src/shared/errors.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (36)
  • packages/desktop-client/src/components/filters/NameFilter.tsx
  • packages/desktop-client/src/components/budget/SidebarCategory.tsx
  • packages/desktop-client/src/components/manager/subscribe/Login.tsx
  • packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
  • packages/desktop-client/src/components/modals/HoldBufferModal.tsx
  • packages/desktop-client/src/components/reports/reports/CashFlow.tsx
  • packages/desktop-client/src/components/budget/SidebarGroup.tsx
  • packages/desktop-client/src/components/settings/Encryption.tsx
  • packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
  • packages/desktop-client/src/components/schedules/ScheduleLink.tsx
  • packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx
  • packages/loot-core/src/shared/errors.ts
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/settings/index.tsx
  • packages/loot-core/src/client/actions/budgets.ts
  • packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
  • packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
  • packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
  • packages/desktop-client/src/components/modals/EditRuleModal.jsx
  • packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
  • packages/desktop-client/src/components/accounts/Reconcile.tsx
  • packages/desktop-client/src/components/accounts/Account.tsx
  • packages/desktop-client/src/components/reports/reports/CustomReport.tsx
  • packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
  • packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
  • packages/desktop-client/src/components/reports/reports/Calendar.tsx
  • packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx
  • packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
  • packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
  • packages/loot-core/src/server/main.ts
  • packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
  • packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
  • packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
🔇 Additional comments (4)
packages/desktop-client/src/components/settings/Format.tsx (1)

79-79: LGTM! Good i18n improvement.

The usage of the new useDaysOfWeek hook effectively centralizes the translation logic for days of the week, making it more maintainable and consistent with the PR's goal of improving translation strings.

packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx (1)

7-7: LGTM! Import of Trans component aligns with i18n improvements.

The addition of the Trans component import is appropriate for the improved translation handling approach.

packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (2)

8-8: LGTM! Necessary imports for i18n improvements.

The addition of Trans component and TransObjectLiteral type imports supports the enhanced internationalization capabilities.

Also applies to: 12-13


209-229: LGTM! Verify translation string consistency across the application.

The implementation of budgeted and balance displays is correct. However, we should ensure that similar financial labels are translated consistently across the application.

✅ Verification successful

Translation implementation is consistent across the codebase

The implementation of "Budgeted" and "Balance" translations follows a consistent pattern using <Trans> components throughout the application, with proper formatting and structure maintained across all components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of "Budgeted" and "Balance" translations
# to verify consistency

echo "Checking 'Budgeted' translations:"
rg -l "Budgeted" --type ts --type tsx

echo "Checking 'Balance' translations:"
rg -l "Balance" --type ts --type tsx

Length of output: 294


Script:

#!/bin/bash
# Search with correct file type handling and comprehensive patterns

echo "Searching for 'Budgeted' translations:"
rg -i "budgeted" --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts -C 2

echo -e "\nSearching for 'Balance' translations:"
rg -i "balance" --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts -C 2 | grep -i "balance.*[\"'>]"

echo -e "\nSearching for Trans components with these terms:"
rg "<Trans>" --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts -A 3 -B 1 | grep -i -E "(budgeted|balance)"

Length of output: 76458

Copy link
Member

Choose a reason for hiding this comment

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

Is this expected to happen? The placeholder name is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

3 participants