Skip to content

A local-first personal finance app

🌍 improve translation strings - part 2 (#4154)

Matt Fiddaman90dc05010200
diff --git a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png
index 4c86c135f6..47f634662c 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png
index da91ec0a42..d42dab83e0 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png
index f6dea23498..f369fcb2e3 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/App.tsx b/packages/desktop-client/src/components/App.tsx
index 1051fce30e..74000f5d37 100644
--- a/packages/desktop-client/src/components/App.tsx
+++ b/packages/desktop-client/src/components/App.tsx
@@ -137,9 +137,9 @@ function AppInner() {
id: 'login-expired',
title: t('Login expired'),
sticky: true,
- message: t('Login expired, please login again.'),
+ message: t('Login expired, please log in again.'),
button: {
- title: t('Go to login'),
+ title: t('Go to log in'),
action: () => dispatch(signOut()),
},
}),
diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx
index bc6331e269..c08aac2f9c 100644
--- a/packages/desktop-client/src/components/accounts/Account.tsx
+++ b/packages/desktop-client/src/components/accounts/Account.tsx
@@ -645,7 +645,7 @@ class AccountInternal extends PureComponent<
const res = await window.Actual.openFileDialog({
filters: [
{
- name: t('Financial Files'),
+ name: t('Financial files'),
extensions: ['qif', 'ofx', 'qfx', 'csv', 'tsv', 'xml'],
},
],
@@ -680,7 +680,7 @@ class AccountInternal extends PureComponent<
window.Actual.saveFile(
exportedTransactions,
filename,
- t('Export Transactions'),
+ t('Export transactions'),
);
};
diff --git a/packages/desktop-client/src/components/accounts/Reconcile.tsx b/packages/desktop-client/src/components/accounts/Reconcile.tsx
index e3136bea02..6d52b7bebc 100644
--- a/packages/desktop-client/src/components/accounts/Reconcile.tsx
+++ b/packages/desktop-client/src/components/accounts/Reconcile.tsx
@@ -5,6 +5,7 @@ import * as queries from 'loot-core/src/client/queries';
import { type Query } from 'loot-core/src/shared/query';
import { currencyToInteger } from 'loot-core/src/shared/util';
import { type AccountEntity } from 'loot-core/types/models';
+import { type TransObjectLiteral } from 'loot-core/types/util';
import { SvgCheckCircle1 } from '../../icons/v2';
import { styles, theme } from '../../style';
@@ -82,23 +83,27 @@ export function ReconcilingMessage({
<View style={{ color: theme.tableText }}>
<Text style={{ fontStyle: 'italic', textAlign: 'center' }}>
<Trans>
- Your cleared balance <strong>{clearedBalance}</strong> needs{' '}
- <strong>{difference}</strong> to match
+ 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}</Text>
+ <Text style={{ fontWeight: 700 }}>
+ {{ bankBalance } as TransObjectLiteral}
+ </Text>
</Trans>
</Text>
</View>
)}
<View style={{ marginLeft: 15 }}>
<Button variant="primary" onPress={onDone}>
- <Trans>Done Reconciling</Trans>
+ <Trans>Done reconciling</Trans>
</Button>
</View>
{targetDiff !== 0 && (
<View style={{ marginLeft: 15 }}>
<Button onPress={() => onCreateTransaction(targetDiff)}>
- <Trans>Create Reconciliation Transaction</Trans>
+ <Trans>Create reconciliation transaction</Trans>
</Button>
</View>
)}
diff --git a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
index f29b7c5dc0..60cd3e207d 100644
--- a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
@@ -531,7 +531,7 @@ export function CreatePayeeButton({
style={{ marginRight: 5, display: 'inline-block' }}
/>
)}
- <Trans>Create Payee β€œ{{ payeeName }}”</Trans>
+ <Trans>Create payee β€œ{{ payeeName }}”</Trans>
</View>
);
}
diff --git a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
index a1bd0f28a4..320c29dc7b 100644
--- a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
+++ b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
@@ -5,10 +5,12 @@ import React, {
type CSSProperties,
useCallback,
} from 'react';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import { css } from '@emotion/css';
+import { type TransObjectLiteral } from 'loot-core/types/util';
+
import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { SvgArrowThinRight } from '../../icons/v1';
import { theme, styles } from '../../style';
@@ -148,47 +150,86 @@ export function BalanceWithCarryover({
<span style={{ fontWeight: 'bold' }}>
{getDifferenceToGoal(balanceValue) === 0 ? (
<span style={{ color: theme.noticeText }}>
- {t('Fully funded')}
+ <Trans>Fully funded</Trans>
</span>
) : getDifferenceToGoal(balanceValue) > 0 ? (
<span style={{ color: theme.noticeText }}>
- {t('Overfunded ({{amount}})', {
- amount: format(
- getDifferenceToGoal(balanceValue),
- 'financial',
- ),
- })}
+ <Trans>
+ Overfunded (
+ {{
+ amount: format(
+ getDifferenceToGoal(balanceValue),
+ 'financial',
+ ),
+ }}
+ )
+ </Trans>
</span>
) : (
<span style={{ color: theme.errorText }}>
- {t('Underfunded ({{amount}})', {
- amount: format(
- getDifferenceToGoal(balanceValue),
- 'financial',
- ),
- })}
+ <Trans>
+ Underfunded (
+ {{
+ amount: format(
+ getDifferenceToGoal(balanceValue),
+ 'financial',
+ ),
+ }}
+ )
+ </Trans>
</span>
)}
</span>
<GoalTooltipRow>
- <div>{t('Goal Type:')}</div>
- <div>{longGoalValue === 1 ? t('Long') : t('Template')}</div>
+ <Trans>
+ <div>Goal Type:</div>
+ <div>
+ {
+ {
+ type:
+ longGoalValue === 1
+ ? t('Long', { context: 'noun' })
+ : t('Template'),
+ } as TransObjectLiteral
+ }
+ </div>
+ </Trans>
</GoalTooltipRow>
<GoalTooltipRow>
- <div>{t('Goal:')}</div>
- <div>{format(goalValue, 'financial')}</div>
+ <Trans>
+ <div>Goal:</div>
+ <div>
+ {
+ {
+ amount: format(goalValue, 'financial'),
+ } as TransObjectLiteral
+ }
+ </div>
+ </Trans>
</GoalTooltipRow>
<GoalTooltipRow>
{longGoalValue !== 1 ? (
- <>
- <div>{t('Budgeted:')}</div>
- <div>{format(budgetedValue, 'financial')}</div>
- </>
+ <Trans>
+ <div>Budgeted:</div>
+ <div>
+ {
+ {
+ amount: format(budgetedValue, 'financial'),
+ } as TransObjectLiteral
+ }
+ </div>
+ </Trans>
) : (
- <>
- <div>{t('Balance:')}</div>
- <div>{format(balanceValue, type)}</div>
- </>
+ <Trans>
+ <div>Balance:</div>
+ <div>
+ {
+ {
+ amount: format(balanceValue, type),
+ } as TransObjectLiteral
+ }
+ </div>
+ </Trans>
)}
</GoalTooltipRow>
</View>
diff --git a/packages/desktop-client/src/components/budget/SidebarCategory.tsx b/packages/desktop-client/src/components/budget/SidebarCategory.tsx
index bdd3f55a54..02373dcfca 100644
--- a/packages/desktop-client/src/components/budget/SidebarCategory.tsx
+++ b/packages/desktop-client/src/components/budget/SidebarCategory.tsx
@@ -192,7 +192,7 @@ export function SidebarCategory({
onBlur={() => onEditName(null)}
style={{ paddingLeft: 13, ...(isLast && { borderBottomWidth: 0 }) }}
inputProps={{
- placeholder: temporary ? t('New Category Name') : '',
+ placeholder: temporary ? t('New category name') : '',
}}
/>
</View>
diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.tsx b/packages/desktop-client/src/components/budget/SidebarGroup.tsx
index 87e6eaad4d..c2109682bf 100644
--- a/packages/desktop-client/src/components/budget/SidebarGroup.tsx
+++ b/packages/desktop-client/src/components/budget/SidebarGroup.tsx
@@ -228,7 +228,7 @@ export function SidebarGroup({
style={{ fontWeight: 600 }}
inputProps={{
style: { marginLeft: 20 },
- placeholder: temporary ? t('New Group Name') : '',
+ placeholder: temporary ? t('New group name') : '',
}}
/>
</View>
diff --git a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
index 5c810c17cd..47414c28e7 100644
--- a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
@@ -48,7 +48,7 @@ export function CoverMenu({
return (
<View style={{ padding: 10 }}>
<View style={{ marginBottom: 5 }}>
- <Trans>Cover from category:</Trans>
+ <Trans>Cover from a category:</Trans>
</View>
<InitialFocus>
diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx
index ff07f7cdb8..1c29d819eb 100644
--- a/packages/desktop-client/src/components/budget/index.tsx
+++ b/packages/desktop-client/src/components/budget/index.tsx
@@ -177,7 +177,7 @@ function BudgetInner(props: BudgetInnerProps) {
addNotification({
type: 'error',
message: t(
- 'Category β€˜{{name}}β€˜ already exists in group (May be Hidden)',
+ 'Category β€œ{{name}}” already exists in group (it may be hidden)',
{ name },
),
}),
diff --git a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx
index 2fb18beec0..7e65d730e2 100644
--- a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx
+++ b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetTotal.tsx
@@ -4,7 +4,7 @@ import React, {
type ComponentType,
type ReactNode,
} from 'react';
-import { useTranslation } from 'react-i18next';
+import { Trans } from 'react-i18next';
import { theme, styles } from '../../../../style';
import { Text } from '../../../common/Text';
@@ -32,7 +32,6 @@ export function BudgetTotal<
ProgressComponent,
style,
}: BudgetTotalProps<CurrentField, TargetField>) {
- const { t } = useTranslation();
return (
<View
style={{
@@ -51,14 +50,24 @@ export function BudgetTotal<
</View>
<Text>
- <CellValue binding={current} type="financial" />
- <Text style={{ color: theme.pageTextSubdued, fontStyle: 'italic' }}>
- {' '}
- {t('of')}{' '}
- <CellValue binding={target} type="financial">
- {props => <CellValueText {...props} style={styles.notFixed} />}
- </CellValue>
- </Text>
+ <Trans
+ i18nKey="<allocatedAmount /> <italic>of <totalAmount /></italic>"
+ components={{
+ allocatedAmount: <CellValue binding={current} type="financial" />,
+ italic: (
+ <Text
+ style={{ color: theme.pageTextSubdued, fontStyle: 'italic' }}
+ />
+ ),
+ totalAmount: (
+ <CellValue binding={target} type="financial">
+ {props => (
+ <CellValueText {...props} style={styles.notFixed} />
+ )}
+ </CellValue>
+ ),
+ }}
+ />
</Text>
</View>
</View>
diff --git a/packages/desktop-client/src/components/filters/NameFilter.tsx b/packages/desktop-client/src/components/filters/NameFilter.tsx
index 77fb85132a..827b15fe86 100644
--- a/packages/desktop-client/src/components/filters/NameFilter.tsx
+++ b/packages/desktop-client/src/components/filters/NameFilter.tsx
@@ -50,7 +50,7 @@ export function NameFilter({
>
<FormField style={{ flex: 1 }}>
<FormLabel
- title={t('Filter Name')}
+ title={t('Filter name')}
htmlFor="name-field"
style={{ userSelect: 'none' }}
/>
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.tsx b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
index b9f117fd64..299c284002 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
@@ -187,7 +187,7 @@ function HeaderLogin({ error }) {
style={{ fontSize: 15 }}
to={'/login/password?error=' + error}
>
- <Trans>Login with Password</Trans>
+ <Trans>Log in with password</Trans>
</Link>
) : (
<span>
diff --git a/packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx b/packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
index 238f5319a1..3a59f525b1 100644
--- a/packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/OpenIdForm.tsx
@@ -379,7 +379,7 @@ const openIdProviders: (OpenIdProviderOption | typeof Menu.line)[] = [
variant="external"
to="https://docs.goauthentik.io/integrations/services/actual-budget/"
>
- <Trans>Configure OAuth2 Provider</Trans>
+ <Trans>Configure OAuth2 provider</Trans>
</Link>
</Text>
),
@@ -434,7 +434,7 @@ function OpenIdProviderSelector({
return (
<FormField style={{ flex: 1, marginTop: 20 }}>
- <FormLabel title={t('OpenID Provider')} htmlFor="provider-selector" />
+ <FormLabel title={t('OpenID provider')} htmlFor="provider-selector" />
<Select
options={openIdProviders.map(provider =>
provider === Menu.line ? Menu.line : [provider.value, provider.label],
diff --git a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
index 2a5ff6cede..5fdd24685f 100644
--- a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
@@ -1,5 +1,5 @@
import React, { type CSSProperties, useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import { css } from '@emotion/css';
@@ -39,12 +39,13 @@ function AccountHeader<SheetFieldName extends SheetFields<'account'>>({
amount,
style = {},
}: AccountHeaderProps<SheetFieldName>) {
+ const { t } = useTranslation();
const navigate = useNavigate();
return (
<Button
variant="bare"
- aria-label={`View ${name} transactions`}
+ aria-label={t('View {{name}} transactions', { name })}
onPress={() => navigate(`/accounts/${id}`)}
style={{
flex: 1,
@@ -192,13 +193,14 @@ function AccountCard({
}
function EmptyMessage() {
- const { t } = useTranslation();
return (
<View style={{ flex: 1, padding: 30 }}>
<Text style={styles.text}>
- {t(
- 'For Actual to be useful, you need to add an account. You can link an account to automatically download transactions, or manage it locally yourself.',
- )}
+ <Trans>
+ For Actual to be useful, you need to <strong>add an account</strong>.
+ You can link an account to automatically download transactions, or
+ manage it locally yourself.
+ </Trans>
</Text>
</View>
);
@@ -255,7 +257,7 @@ function AccountList({
>
{accounts.length === 0 && <EmptyMessage />}
<PullToRefresh onRefresh={onSync}>
- <View aria-label="Account list" style={{ margin: 10 }}>
+ <View aria-label={t('Account list')} style={{ margin: 10 }}>
{onBudgetAccounts.length > 0 && (
<AccountHeader
id="onbudget"
diff --git a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
index 8e96583490..e96abcdc8e 100644
--- a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
@@ -91,7 +91,7 @@ function BudgetPageMenu({
},
{
name: 'toggle-hidden-categories',
- text: `${!showHiddenCategories ? t('Show') : t('Hide')} ${t('hidden categories')}`,
+ text: `${!showHiddenCategories ? t('Show hidden categories') : t('Hide hidden categories')}`,
},
{
name: 'switch-budget-file',
diff --git a/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx b/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx
index 2177502e88..20e068cbb3 100644
--- a/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx
+++ b/packages/desktop-client/src/components/modals/ConfirmTransactionEditModal.tsx
@@ -1,6 +1,6 @@
// @ts-strict-ignore
import React from 'react';
-import { useTranslation } from 'react-i18next'; // Import useTranslation
+import { useTranslation, Trans } from 'react-i18next';
import { Block } from '../common/Block';
import { Button } from '../common/Button2';
@@ -19,7 +19,7 @@ export function ConfirmTransactionEditModal({
onConfirm,
confirmReason,
}: ConfirmTransactionEditProps) {
- const { t } = useTranslation(); // Initialize translation hook
+ const { t } = useTranslation();
return (
<Modal
@@ -29,49 +29,56 @@ export function ConfirmTransactionEditModal({
{({ state: { close } }) => (
<>
<ModalHeader
- title={t('Reconciled Transaction')} // Use translation for title
+ title={t('Reconciled Transaction')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View style={{ lineHeight: 1.5 }}>
{confirmReason === 'batchDeleteWithReconciled' ? (
<Block>
- {t(
- 'Deleting reconciled transactions may bring your reconciliation out of balance.',
- )}
+ <Trans>
+ Deleting reconciled transactions may bring your reconciliation
+ out of balance.
+ </Trans>
</Block>
) : confirmReason === 'batchEditWithReconciled' ? (
<Block>
- {t(
- 'Editing reconciled transactions may bring your reconciliation out of balance.',
- )}
+ <Trans>
+ Editing reconciled transactions may bring your reconciliation
+ out of balance.
+ </Trans>
</Block>
) : confirmReason === 'batchDuplicateWithReconciled' ? (
<Block>
- {t(
- 'Duplicating reconciled transactions may bring your reconciliation out of balance.',
- )}
+ <Trans>
+ Duplicating reconciled transactions may bring your
+ reconciliation out of balance.
+ </Trans>
</Block>
) : confirmReason === 'editReconciled' ? (
<Block>
- {t(
- 'Saving your changes to this reconciled transaction may bring your reconciliation out of balance.',
- )}
+ <Trans>
+ Saving your changes to this reconciled transaction may bring
+ your reconciliation out of balance.
+ </Trans>
</Block>
) : confirmReason === 'unlockReconciled' ? (
<Block>
- {t(
- 'Unlocking this transaction means you wonβ€˜t be warned about changes that can impact your reconciled balance. (Changes to amount, account, payee, etc).',
- )}
+ <Trans>
+ Unlocking this transaction means you wonβ€˜t be warned about
+ changes that can impact your reconciled balance. (Changes to
+ amount, account, payee, etc).
+ </Trans>
</Block>
) : confirmReason === 'deleteReconciled' ? (
<Block>
- {t(
- 'Deleting this reconciled transaction may bring your reconciliation out of balance.',
- )}
+ <Trans>
+ Deleting reconciled transactions may bring your reconciliation
+ out of balance.
+ </Trans>
</Block>
) : (
<Block>
- {t('Are you sure you want to edit this transaction?')}
+ <Trans>Are you sure you want to edit this transaction?</Trans>
</Block>
)}
@@ -90,25 +97,25 @@ export function ConfirmTransactionEditModal({
}}
>
<Button
- aria-label={t('Cancel')} // Use translation for aria-label
+ aria-label={t('Cancel')}
style={{ marginRight: 10 }}
onPress={() => {
close();
onCancel();
}}
>
- {t('Cancel')} {/* Use translation for Cancel */}
+ <Trans>Cancel</Trans>
</Button>
<InitialFocus>
<Button
- aria-label={t('Confirm')} // Use translation for aria-label
+ aria-label={t('Confirm')}
variant="primary"
onPress={() => {
close();
onConfirm();
}}
>
- {t('Confirm')} {/* Use translation for Confirm */}
+ <Trans>Confirm</Trans>
</Button>
</InitialFocus>
</View>
diff --git a/packages/desktop-client/src/components/modals/CoverModal.tsx b/packages/desktop-client/src/components/modals/CoverModal.tsx
index 8123d80f8f..5f846e3b8e 100644
--- a/packages/desktop-client/src/components/modals/CoverModal.tsx
+++ b/packages/desktop-client/src/components/modals/CoverModal.tsx
@@ -80,7 +80,7 @@ export function CoverModal({
rightContent={<ModalCloseButton onPress={close} />}
/>
<View>
- <FieldLabel title={t('Cover from category:')} />
+ <FieldLabel title={t('Cover from a category:')} />
<TapField value={fromCategory?.name} onClick={onCategoryClick} />
</View>
diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
index 81f0f3e98a..fa4dc00ddd 100644
--- a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
+++ b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import { type FormEvent, useState } from 'react';
import { Form } from 'react-aria-components';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import { closeModal } from 'loot-core/client/actions';
import { createAccount } from 'loot-core/client/queries/queriesSlice';
@@ -132,7 +132,7 @@ export function CreateLocalAccountModal() {
verticalAlign: 'center',
}}
>
- {t('Off budget')}
+ <Trans>Off budget</Trans>
</label>
</View>
<div
@@ -144,16 +144,17 @@ export function CreateLocalAccountModal() {
}}
>
<Text>
- {t('This cannot be changed later.')} <br /> {'\n'}
- {t('See')}{' '}
- <Link
- variant="external"
- linkColor="muted"
- to="https://actualbudget.org/docs/accounts/#off-budget-accounts"
- >
- {t('Accounts Overview')}
- </Link>{' '}
- {t('for more information.')}
+ <Trans>
+ This cannot be changed later. See{' '}
+ <Link
+ variant="external"
+ linkColor="muted"
+ to="https://actualbudget.org/docs/accounts/#off-budget-accounts"
+ >
+ Accounts Overview
+ </Link>{' '}
+ for more information.
+ </Trans>
</Text>
</div>
</View>
diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
index 6016a6ad54..3da771f9c6 100644
--- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx
+++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
@@ -334,7 +334,7 @@ function ScheduleDescription({ id }) {
textOverflow: 'ellipsis',
}}
>
- <Trans>Payee</Trans>:{' '}
+ <Trans>Payee:</Trans>{' '}
<DisplayId
type="payees"
id={schedule._payee}
@@ -343,12 +343,13 @@ function ScheduleDescription({ id }) {
</Text>
<Text style={{ margin: '0 5px' }}> β€” </Text>
<Text style={{ flexShrink: 0 }}>
- <Trans>Amount</Trans>: {formatAmount(schedule._amount)}
+ <Trans>Amount:</Trans> {formatAmount(schedule._amount)}
</Text>
<Text style={{ margin: '0 5px' }}> β€” </Text>
<Text style={{ flexShrink: 0 }}>
- <Trans>Next</Trans>:{' '}
- {monthUtils.format(schedule.next_date, dateFormat)}
+ <Trans>
+ Next: {{ month: monthUtils.format(schedule.next_date, dateFormat) }}
+ </Trans>
</Text>
</View>
<StatusBadge status={status} />
diff --git a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
index b22ed2a457..249c366074 100644
--- a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
+++ b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
@@ -25,6 +25,8 @@ export function EnvelopeBudgetSummaryModal({
month,
onBudgetAction,
}: EnvelopeBudgetSummaryModalProps) {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const prevMonthName = format(prevMonth(month), 'MMM');
const sheetValue =
@@ -36,12 +38,11 @@ export function EnvelopeBudgetSummaryModal({
const { showUndoNotification } = useUndo();
const { list: categories } = useCategories();
const categoriesById = groupById(categories);
- const { t } = useTranslation();
const openTransferAvailableModal = () => {
dispatch(
pushModal('transfer', {
- title: t('Transfer: To Budget'),
+ title: t('Transfer to category'),
month,
amount: sheetValue,
onSubmit: (amount, toCategoryId) => {
@@ -52,7 +53,10 @@ export function EnvelopeBudgetSummaryModal({
});
dispatch(collapseModals('transfer'));
showUndoNotification({
- message: `Transferred ${integerToCurrency(amount)} to ${categoriesById[toCategoryId].name}`,
+ message: t('Transferred {{amount}} to {{categoryName}}', {
+ amount: integerToCurrency(amount),
+ categoryName: categoriesById[toCategoryId].name,
+ }),
});
},
}),
@@ -62,7 +66,7 @@ export function EnvelopeBudgetSummaryModal({
const openCoverOverbudgetedModal = () => {
dispatch(
pushModal('cover', {
- title: t('Cover: Overbudgeted'),
+ title: t('Cover overbudgeted'),
month,
showToBeBudgeted: false,
onSubmit: categoryId => {
@@ -71,7 +75,9 @@ export function EnvelopeBudgetSummaryModal({
});
dispatch(collapseModals('cover'));
showUndoNotification({
- message: `Covered overbudgeted from ${categoriesById[categoryId].name}`,
+ message: t('Covered overbudgeted from {{categoryName}}', {
+ categoryName: categoriesById[categoryId].name,
+ }),
});
},
}),
diff --git a/packages/desktop-client/src/components/modals/HoldBufferModal.tsx b/packages/desktop-client/src/components/modals/HoldBufferModal.tsx
index 38ce1d5bb8..199411c00c 100644
--- a/packages/desktop-client/src/components/modals/HoldBufferModal.tsx
+++ b/packages/desktop-client/src/components/modals/HoldBufferModal.tsx
@@ -33,7 +33,7 @@ export function HoldBufferModal({ onSubmit }: HoldBufferModalProps) {
{({ state: { close } }) => (
<>
<ModalHeader
- title={t('Hold Buffer')}
+ title={t('Hold for next month')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View>
diff --git a/packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx b/packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx
index 95d3262c25..3d9f4f202a 100644
--- a/packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx
+++ b/packages/desktop-client/src/components/modals/KeyboardShortcutModal.tsx
@@ -1,5 +1,5 @@
import { type CSSProperties } from 'react';
-import { useTranslation } from 'react-i18next'; // Import useTranslation from i18next
+import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import * as Platform from 'loot-core/src/client/platform';
@@ -151,7 +151,7 @@ function Shortcut({
export function KeyboardShortcutModal() {
const location = useLocation();
- const { t } = useTranslation(); // Initialize useTranslation
+ const { t } = useTranslation();
const onBudget = location.pathname.startsWith('/budget');
const onAccounts = location.pathname.startsWith('/accounts');
const ctrl = Platform.OS === 'mac' ? '⌘' : 'Ctrl';
@@ -160,7 +160,7 @@ export function KeyboardShortcutModal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title={t('Keyboard Shortcuts')} // Translate title
+ title={t('Keyboard shortcuts')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View
@@ -212,7 +212,7 @@ export function KeyboardShortcutModal() {
description={t('Bank sync')}
meta={ctrl}
/>
- <GroupHeading group={t('With transaction(s) selected')} />
+ <GroupHeading group={t('With transactions selected')} />
<Shortcut
shortcut="F"
description={t('Filter to the selected transactions')}
diff --git a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
index c3c303dc03..97f7b9aa22 100644
--- a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
@@ -197,7 +197,7 @@ export function ConfirmChangeDocumentDirModal({
}}
onPress={() => moveDirectory(close)}
>
- <Trans>Change Directory</Trans>
+ <Trans>Change directory</Trans>
</ButtonWithLoading>
</View>
</View>
diff --git a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
index 224aaa0f08..f56e582cef 100644
--- a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
@@ -101,9 +101,9 @@ export function DuplicateFileModal({
);
if (onComplete) onComplete({ status: 'success' });
} catch (e) {
- const newError = new Error(t('Failed to duplicate budget'));
+ const newError = new Error(t('Failed to duplicate budget file'));
if (onComplete) onComplete({ status: 'failed', error: newError });
- else console.error('Failed to duplicate budget:', e);
+ else console.error('Failed to duplicate budget file:', e);
dispatch(
addNotification({
type: 'error',
diff --git a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
index d6275e817f..0e2a0b0d9b 100644
--- a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
@@ -109,14 +109,12 @@ function SelfSignedCertLocationSettings() {
}}
>
<Text>
- <strong>
- <Trans>Server self-signed certificate</Trans>
- </strong>{' '}
- <small style={{ marginLeft: '0.5rem' }}>
- <i>
- <Trans>enables a secure connection</Trans>
- </i>
- </small>
+ <Trans>
+ <strong>Server self-signed certificate</strong>{' '}
+ <small style={{ marginLeft: '0.5rem' }}>
+ <i>enables a secure connection</i>
+ </small>
+ </Trans>
</Text>
<View style={{ flexDirection: 'row', gap: '0.5rem', width: '100%' }}>
<Text
@@ -142,6 +140,8 @@ function SelfSignedCertLocationSettings() {
}
export function FilesSettingsModal() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
function closeModal(close: () => void) {
@@ -154,7 +154,7 @@ export function FilesSettingsModal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title="Settings"
+ title={t('Settings')}
rightContent={
<ModalCloseButton onPress={() => closeModal(close)} />
}
diff --git a/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
index c298517682..2cb68b565e 100644
--- a/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
@@ -127,7 +127,7 @@ export function CalendarGraph({
marginRight: 4,
}}
>
- <Trans>Income</Trans>:
+ <Trans>Income:</Trans>
</View>
<View
style={{
@@ -156,7 +156,7 @@ export function CalendarGraph({
marginRight: 4,
}}
>
- <Trans>Expenses</Trans>:
+ <Trans>Expenses:</Trans>
</View>
<View
style={{
diff --git a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
index abe16c4448..9866847d4d 100644
--- a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
@@ -1,6 +1,6 @@
// @ts-strict-ignore
import React, { type ComponentProps, type CSSProperties } from 'react';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import { css } from '@emotion/css';
import {
@@ -78,10 +78,15 @@ const CustomTooltip = ({
<div>
<div style={{ marginBottom: 10 }}>
<strong>
- {t('Day:') + ' '}
- {Number(payload[0].payload.day) >= 28
- ? t('28+')
- : payload[0].payload.day}
+ <Trans>
+ Day:{' '}
+ {{
+ dayOfMonth:
+ Number(payload[0].payload.day) >= 28
+ ? t('28+')
+ : payload[0].payload.day,
+ }}
+ </Trans>
</strong>
</div>
<div style={{ lineHeight: 1.5 }}>
diff --git a/packages/desktop-client/src/components/reports/reports/Calendar.tsx b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
index 759c69c18e..d1d83b45ec 100644
--- a/packages/desktop-client/src/components/reports/reports/Calendar.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
@@ -918,7 +918,7 @@ function CalendarCardHeader({
marginRight: 4,
}}
>
- <Trans>Income</Trans>:
+ <Trans>Income:</Trans>
</View>
<View style={{ color: chartTheme.colors.blue }}>
<PrivacyFilter>{amountToCurrency(totalIncome)}</PrivacyFilter>
@@ -930,7 +930,7 @@ function CalendarCardHeader({
marginRight: 4,
}}
>
- <Trans>Expenses</Trans>:
+ <Trans>Expenses:</Trans>
</View>
<View style={{ color: chartTheme.colors.red }}>
<PrivacyFilter>{amountToCurrency(totalExpense)}</PrivacyFilter>
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
index c2efb7cff4..2dce3356bd 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
@@ -271,7 +271,11 @@ function CashFlowInner({ widget }: CashFlowInnerProps) {
>
<AlignedText
style={{ marginBottom: 5, minWidth: 160 }}
- left={<Block>Income:</Block>}
+ left={
+ <Block>
+ <Trans>Income:</Trans>
+ </Block>
+ }
right={
<Text style={{ fontWeight: 600 }}>
<PrivacyFilter>{integerToCurrency(totalIncome)}</PrivacyFilter>
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
index c88d0abad4..092ab465aa 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import { useLocation, useParams } from 'react-router-dom';
import * as d from 'date-fns';
@@ -17,6 +17,7 @@ import {
type DataEntity,
} from 'loot-core/types/models/reports';
import { type RuleConditionEntity } from 'loot-core/types/models/rule';
+import { type TransObjectLiteral } from 'loot-core/types/util';
import { useAccounts } from '../../../hooks/useAccounts';
import { useCategories } from '../../../hooks/useCategories';
@@ -697,22 +698,27 @@ function CustomReportInner({ report: initialReport }: CustomReportInnerProps) {
header={
isNarrowWidth ? (
<MobilePageHeader
- title={
- report.name
- ? t('Custom Report: {{name}}', { name: report.name })
- : t('Custom Report: Unsaved report')
- }
+ title={t('Custom Report: {{name}}', {
+ name: report.name ?? t('Unsaved report'),
+ })}
leftContent={<MobileBackButton onPress={onBackClick} />}
/>
) : (
<PageHeader
title={
- <>
- <Text>{t('Custom Report:')}</Text>
+ <Trans>
+ <Text>Custom Report:</Text>{' '}
<Text style={{ marginLeft: 5, color: theme.pageTextPositive }}>
- {report.name || t('Unsaved report')}
+ {
+ {
+ name:
+ report.name?.length > 0
+ ? report.name
+ : t('Unsaved report'),
+ } as TransObjectLiteral
+ }
</Text>
- </>
+ </Trans>
}
/>
)
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
index 7c79430ae6..86d69c070c 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
+++ b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import * as d from 'date-fns';
+import { t } from 'i18next';
import { type useSpreadsheet } from 'loot-core/src/client/SpreadsheetProvider';
import { send } from 'loot-core/src/platform/client/fetch';
@@ -149,11 +150,11 @@ function recalculate(
isConcise: boolean,
) {
const [startingBalance, income, expense] = data;
- const convIncome = income.map(t => {
- return { ...t, isTransfer: t.isTransfer !== null };
+ const convIncome = income.map(trans => {
+ return { ...trans, isTransfer: trans.isTransfer !== null };
});
- const convExpense = expense.map(t => {
- return { ...t, isTransfer: t.isTransfer !== null };
+ const convExpense = expense.map(trans => {
+ return { ...trans, isTransfer: trans.isTransfer !== null };
});
const dates = isConcise
? monthUtils.rangeInclusive(
@@ -209,19 +210,28 @@ function recalculate(
</strong>
</div>
<div style={{ lineHeight: 1.5 }}>
- <AlignedText left="Income:" right={integerToCurrency(income)} />
- <AlignedText left="Expenses:" right={integerToCurrency(expense)} />
<AlignedText
- left="Change:"
+ left={t('Income:')}
+ right={integerToCurrency(income)}
+ />
+ <AlignedText
+ left={t('Expenses:')}
+ right={integerToCurrency(expense)}
+ />
+ <AlignedText
+ left={t('Change:')}
right={<strong>{integerToCurrency(income + expense)}</strong>}
/>
{creditTransfers + debitTransfers !== 0 && (
<AlignedText
- left="Transfers:"
+ left={t('Transfers:')}
right={integerToCurrency(creditTransfers + debitTransfers)}
/>
)}
- <AlignedText left="Balance:" right={integerToCurrency(balance)} />
+ <AlignedText
+ left={t('Balance:')}
+ right={integerToCurrency(balance)}
+ />
</div>
</div>
);
diff --git a/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx b/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
index 54944bd85d..321d87de98 100644
--- a/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
+++ b/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
@@ -971,7 +971,7 @@ function NoTransactionsMessage(props: NoTransactionsMessageProps) {
>
{props.error ? (
<Text style={{ color: theme.errorText }}>
- <Trans>Could not search: {props.error}</Trans>
+ <Trans>Could not search: {{ errorReason: props.error }}</Trans>
</Text>
) : props.transactionsMode === 'matched' ? (
t('No matching transactions')
diff --git a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
index 773d460c05..2e42538671 100644
--- a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
+++ b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
@@ -79,7 +79,7 @@ export function ScheduleLink({
{({ state: { close } }) => (
<>
<ModalHeader
- title={t('Link Schedule')}
+ title={t('Link schedule')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View
diff --git a/packages/desktop-client/src/components/settings/Encryption.tsx b/packages/desktop-client/src/components/settings/Encryption.tsx
index fa65538415..da47d999c8 100644
--- a/packages/desktop-client/src/components/settings/Encryption.tsx
+++ b/packages/desktop-client/src/components/settings/Encryption.tsx
@@ -54,7 +54,7 @@ export function EncryptionSettings() {
<Setting
primaryAction={
<Button isDisabled>
- <Trans>Enable encryption…</Trans>
+ <Trans>Enable encryption</Trans>
</Button>
}
>
diff --git a/packages/desktop-client/src/components/settings/Format.tsx b/packages/desktop-client/src/components/settings/Format.tsx
index 03226f3dc8..0e5789cfb5 100644
--- a/packages/desktop-client/src/components/settings/Format.tsx
+++ b/packages/desktop-client/src/components/settings/Format.tsx
@@ -21,17 +21,24 @@ import { Setting } from './UI';
// Follows Pikaday 'firstDay' numbering
// https://github.com/Pikaday/Pikaday
-const daysOfWeek: { value: SyncedPrefs['firstDayOfWeekIdx']; label: string }[] =
- [
- { value: '0', label: 'Sunday' },
- { value: '1', label: 'Monday' },
- { value: '2', label: 'Tuesday' },
- { value: '3', label: 'Wednesday' },
- { value: '4', label: 'Thursday' },
- { value: '5', label: 'Friday' },
- { value: '6', label: 'Saturday' },
- ];
+function useDaysOfWeek() {
+ const { t } = useTranslation();
+
+ const daysOfWeek: {
+ value: SyncedPrefs['firstDayOfWeekIdx'];
+ label: string;
+ }[] = [
+ { 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;
+ return { daysOfWeek };
+}
const dateFormats: { value: SyncedPrefs['dateFormat']; label: string }[] = [
{ value: 'MM/dd/yyyy', label: 'MM/DD/YYYY' },
{ value: 'dd/MM/yyyy', label: 'DD/MM/YYYY' },
@@ -69,6 +76,8 @@ export function FormatSettings() {
const numberFormat = _numberFormat || 'comma-dot';
const [hideFraction, setHideFractionPref] = useSyncedPref('hideFraction');
+ const { daysOfWeek } = useDaysOfWeek();
+
const selectButtonClassName = css({
'&[data-hovered]': {
backgroundColor: theme.buttonNormalBackgroundHover,
diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx
index 18252c0970..96337d9d45 100644
--- a/packages/desktop-client/src/components/settings/index.tsx
+++ b/packages/desktop-client/src/components/settings/index.tsx
@@ -183,14 +183,16 @@ export function Settings() {
>
{/* The only spot to close a budget on mobile */}
<FormField>
- <FormLabel title={t('Budget Name')} />
+ <FormLabel title={t('Budget name')} />
<Input
value={budgetName}
disabled
style={{ color: theme.buttonNormalDisabledText }}
/>
</FormField>
- <Button onPress={onCloseBudget}>{t('Close Budget')}</Button>
+ <Button onPress={onCloseBudget}>
+ <Trans>Close budget</Trans>
+ </Button>
</View>
)}
<About />
diff --git a/packages/desktop-client/src/components/spreadsheet/CellValue.tsx b/packages/desktop-client/src/components/spreadsheet/CellValue.tsx
index 2171d99406..579a80ff00 100644
--- a/packages/desktop-client/src/components/spreadsheet/CellValue.tsx
+++ b/packages/desktop-client/src/components/spreadsheet/CellValue.tsx
@@ -44,7 +44,7 @@ export function CellValue<
const { fullSheetName } = useSheetName(binding);
const sheetValue = useSheetValue(binding);
- return children ? (
+ return typeof children === 'function' ? (
<>{children({ type, name: fullSheetName, value: sheetValue })}</>
) : (
<CellValueText
diff --git a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
index 69f3879335..e1608c0952 100644
--- a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
+++ b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
@@ -5,7 +5,7 @@ import React, {
type CSSProperties,
type ReactNode,
} from 'react';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import {
format as formatDate,
@@ -53,6 +53,8 @@ const TransactionRow = memo(function TransactionRow({
fields,
selected,
}: TransactionRowProps) {
+ const { t } = useTranslation();
+
const category = useCategory(transaction.category || '');
const account = useAccount(transaction.account);
@@ -124,8 +126,12 @@ const TransactionRow = memo(function TransactionRow({
);
case 'account':
return (
- <Field key={i} width="flex" title={account?.name || 'No account'}>
- {account?.name || 'No account'}
+ <Field
+ key={i}
+ width="flex"
+ title={account?.name || t('No account')}
+ >
+ {account?.name || t('No account')}
</Field>
);
case 'notes':
@@ -165,7 +171,6 @@ export function SimpleTransactionsTable({
fields = ['date', 'payee', 'amount'],
style,
}: SimpleTransactionsTableProps) {
- const { t } = useTranslation();
const dateFormat = useDateFormat() || 'MM/dd/yyyy';
const selectedItems = useSelectedItems();
const dispatchSelected = useSelectedDispatch();
@@ -212,43 +217,43 @@ export function SimpleTransactionsTable({
case 'date':
return (
<Field key={i} width={100}>
- {t('Date')}
+ <Trans>Date</Trans>
</Field>
);
case 'imported_payee':
return (
<Field key={i} width="flex">
- {t('Imported payee')}
+ <Trans>Imported payee</Trans>
</Field>
);
case 'payee':
return (
<Field key={i} width="flex">
- {t('Payee')}
+ <Trans>Payee</Trans>
</Field>
);
case 'category':
return (
<Field key={i} width="flex">
- {t('Category')}
+ <Trans>Category</Trans>
</Field>
);
case 'account':
return (
<Field key={i} width="flex">
- {t('Account')}
+ <Trans>Account</Trans>
</Field>
);
case 'notes':
return (
<Field key={i} width="flex">
- {t('Notes')}
+ <Trans>Notes</Trans>
</Field>
);
case 'amount':
return (
<Field key={i} width={75} style={{ textAlign: 'right' }}>
- {t('Amount')}
+ <Trans>Amount</Trans>
</Field>
);
default:
diff --git a/packages/loot-core/src/client/actions/budgets.ts b/packages/loot-core/src/client/actions/budgets.ts
index ab549a2351..e5eab6e3f5 100644
--- a/packages/loot-core/src/client/actions/budgets.ts
+++ b/packages/loot-core/src/client/actions/budgets.ts
@@ -181,7 +181,7 @@ export function duplicateBudget({
try {
dispatch(
setAppState({
- loadingText: t('Duplicating: {{oldName}} -- to: {{newName}}', {
+ loadingText: t('Duplicating: {{oldName}} to: {{newName}}', {
oldName,
newName,
}),
diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts
index e5e96bac5d..7657dbd828 100644
--- a/packages/loot-core/src/server/main.ts
+++ b/packages/loot-core/src/server/main.ts
@@ -2032,7 +2032,7 @@ handlers['duplicate-budget'] = async function ({
await fs.removeDirRecursively(newBudgetDir);
}
} catch {} // Ignore cleanup errors
- throw new Error(`Failed to duplicate budget: ${error.message}`);
+ throw new Error(`Failed to duplicate budget file: ${error.message}`);
}
// load in and validate
diff --git a/packages/loot-core/src/shared/errors.ts b/packages/loot-core/src/shared/errors.ts
index 6718952e07..615c810d38 100644
--- a/packages/loot-core/src/shared/errors.ts
+++ b/packages/loot-core/src/shared/errors.ts
@@ -101,7 +101,7 @@ export function getSyncError(error, id) {
return t('This budget cannot be loaded with this version of the app.');
} else if (error === 'budget-not-found') {
return t(
- 'Budget β€œ{id}” not found. Check the id of your budget in the Advanced section of the settings page.',
+ 'Budget β€œ{{id}}” not found. Check the ID of your budget in the Advanced section of the settings page.',
{ id },
);
} else {
diff --git a/upcoming-release-notes/4154.md b/upcoming-release-notes/4154.md
new file mode 100644
index 0000000000..0bfed88276
--- /dev/null
+++ b/upcoming-release-notes/4154.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [matt-fidd]
+---
+
+Improve translation strings and update some wording