Skip to content

A local-first personal finance app

Marked files for translation (#3444)

Ali Gradina3f85aedd0b83
diff --git a/packages/desktop-client/src/components/BankSyncStatus.tsx b/packages/desktop-client/src/components/BankSyncStatus.tsx
index 77ae6457d1..52130e0c19 100644
--- a/packages/desktop-client/src/components/BankSyncStatus.tsx
+++ b/packages/desktop-client/src/components/BankSyncStatus.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { Trans } from 'react-i18next';
import { useSelector } from 'react-redux';
import { useTransition, animated } from 'react-spring';
@@ -15,6 +16,7 @@ export function BankSyncStatus() {
(state: State) => state.account.accountsSyncing,
);
const accountsSyncingCount = accountsSyncing.length;
+ const count = accountsSyncingCount;
const transitions = useTransition(
accountsSyncingCount > 0 ? 'syncing' : null,
@@ -58,8 +60,9 @@ export function BankSyncStatus() {
iconStyle={{ color: theme.pillTextSelected }}
/>
<Text style={{ marginLeft: 5 }}>
- Syncing... {accountsSyncingCount} account
- {accountsSyncingCount > 1 && 's'} remaining
+ <Trans count={accountsSyncingCount}>
+ Syncing... {{ count }} accounts remaining
+ </Trans>
</Text>
</View>
</animated.div>
diff --git a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
index 6a126b389d..5c810c17cd 100644
--- a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
@@ -1,4 +1,5 @@
import React, { useMemo, useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { type CategoryEntity } from 'loot-core/src/types/models';
@@ -22,6 +23,8 @@ export function CoverMenu({
onSubmit,
onClose,
}: CoverMenuProps) {
+ const { t } = useTranslation();
+
const { grouped: originalCategoryGroups } = useCategories();
const [fromCategoryId, setFromCategoryId] = useState<string | null>(null);
@@ -44,7 +47,9 @@ export function CoverMenu({
}
return (
<View style={{ padding: 10 }}>
- <View style={{ marginBottom: 5 }}>Cover from category:</View>
+ <View style={{ marginBottom: 5 }}>
+ <Trans>Cover from category:</Trans>
+ </View>
<InitialFocus>
{node => (
@@ -56,7 +61,7 @@ export function CoverMenu({
inputProps={{
inputRef: node,
onEnter: event => !event.defaultPrevented && submit(),
- placeholder: '(none)',
+ placeholder: t('(none)'),
}}
showHiddenCategories={false}
/>
@@ -77,7 +82,7 @@ export function CoverMenu({
}}
onPress={submit}
>
- Transfer
+ <Trans>Transfer</Trans>
</Button>
</View>
</View>
diff --git a/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx b/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
index 449c13a4a3..86f005dc5b 100644
--- a/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
@@ -1,4 +1,5 @@
import React, { type ComponentProps, memo, useRef, useState } from 'react';
+import { useTranslation, Trans } from 'react-i18next';
import { css } from 'glamor';
@@ -74,7 +75,9 @@ export const BudgetTotalsMonth = memo(function BudgetTotalsMonth() {
}}
>
<View style={headerLabelStyle}>
- <Text style={{ color: theme.tableHeaderText }}>Budgeted</Text>
+ <Text style={{ color: theme.tableHeaderText }}>
+ <Trans>Budgeted</Trans>
+ </Text>
<EnvelopeCellValue
binding={envelopeBudget.totalBudgeted}
type="financial"
@@ -112,7 +115,9 @@ export function IncomeHeaderMonth() {
paddingRight: 10,
}}
>
- <View style={{ flex: 1, textAlign: 'right' }}>Received</View>
+ <View style={{ flex: 1, textAlign: 'right' }}>
+ <Trans>Received</Trans>
+ </View>
</Row>
);
}
@@ -191,6 +196,8 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
onBudgetAction,
onShowActivity,
}: ExpenseCategoryMonthProps) {
+ const { t } = useTranslation();
+
const budgetMenuTriggerRef = useRef(null);
const balanceMenuTriggerRef = useRef(null);
const [budgetMenuOpen, setBudgetMenuOpen] = useState(false);
@@ -268,7 +275,7 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
category: category.id,
});
showUndoNotification({
- message: `Budget set to last month’s budget.`,
+ message: t(`Budget set to last month’s budget.`),
});
}}
onSetMonthsAverage={numberOfMonths => {
@@ -284,7 +291,10 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
category: category.id,
});
showUndoNotification({
- message: `Budget set to ${numberOfMonths}-month average.`,
+ message: t(
+ 'Budget set to {{numberOfMonths}}-month average.',
+ { numberOfMonths },
+ ),
});
}}
onApplyBudgetTemplate={() => {
@@ -292,7 +302,7 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
category: category.id,
});
showUndoNotification({
- message: `Budget template applied.`,
+ message: t(`Budget template applied.`),
});
}}
/>
diff --git a/packages/desktop-client/src/components/budget/envelope/HoldMenu.tsx b/packages/desktop-client/src/components/budget/envelope/HoldMenu.tsx
index 3bf1a79df8..296d8a7cd9 100644
--- a/packages/desktop-client/src/components/budget/envelope/HoldMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/HoldMenu.tsx
@@ -4,6 +4,7 @@ import React, {
useEffect,
type ChangeEvent,
} from 'react';
+import { Trans } from 'react-i18next';
import { useSpreadsheet } from 'loot-core/src/client/SpreadsheetProvider';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
@@ -47,7 +48,9 @@ export function HoldMenu({ onSubmit, onClose }: HoldMenuProps) {
return (
<View style={{ padding: 10 }}>
- <View style={{ marginBottom: 5 }}>Hold this amount:</View>
+ <View style={{ marginBottom: 5 }}>
+ <Trans>Hold this amount:</Trans>
+ </View>
<View>
<InitialFocus>
<Input
@@ -74,7 +77,7 @@ export function HoldMenu({ onSubmit, onClose }: HoldMenuProps) {
}}
onPress={() => submit(amount)}
>
- Hold
+ <Trans>Hold</Trans>
</Button>
</View>
</View>
diff --git a/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx b/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
index f304eab3d4..d6bb64b772 100644
--- a/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
@@ -1,4 +1,5 @@
import React, { useMemo, useState } from 'react';
+import { Trans } from 'react-i18next';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util';
@@ -55,7 +56,9 @@ export function TransferMenu({
return (
<View style={{ padding: 10 }}>
- <View style={{ marginBottom: 5 }}>Transfer this amount:</View>
+ <View style={{ marginBottom: 5 }}>
+ <Trans>Transfer this amount:</Trans>
+ </View>
<View>
<InitialFocus>
<Input
@@ -95,7 +98,7 @@ export function TransferMenu({
}}
onPress={() => _onSubmit(amount, toCategoryId)}
>
- Transfer
+ <Trans>Transfer</Trans>
</Button>
</View>
</View>
diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
index 3f4c97da90..29723a1230 100644
--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
@@ -1,4 +1,5 @@
import React, { type ComponentPropsWithoutRef } from 'react';
+import { useTranslation } from 'react-i18next';
import { useFeatureFlag } from '../../../../hooks/useFeatureFlag';
import { Menu } from '../../../common/Menu';
@@ -25,6 +26,8 @@ export function BudgetMonthMenu({
onEndOfMonthCleanup,
...props
}: BudgetMonthMenuProps) {
+ const { t } = useTranslation();
+
const isGoalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled');
return (
<Menu
@@ -55,29 +58,29 @@ export function BudgetMonthMenu({
}
}}
items={[
- { name: 'copy-last', text: 'Copy last month’s budget' },
- { name: 'set-zero', text: 'Set budgets to zero' },
+ { name: 'copy-last', text: t('Copy last month’s budget') },
+ { name: 'set-zero', text: t('Set budgets to zero') },
{
name: 'set-3-avg',
- text: 'Set budgets to 3 month average',
+ text: t('Set budgets to 3 month average'),
},
...(isGoalTemplatesEnabled
? [
{
name: 'check-templates',
- text: 'Check templates',
+ text: t('Check templates'),
},
{
name: 'apply-goal-template',
- text: 'Apply budget template',
+ text: t('Apply budget template'),
},
{
name: 'overwrite-goal-template',
- text: 'Overwrite with budget template',
+ text: t('Overwrite with budget template'),
},
{
name: 'cleanup-goal-template',
- text: 'End of month cleanup',
+ text: t('End of month cleanup'),
},
]
: []),
diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx
index c3b75d1dbf..28978d6a13 100644
--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetMenu.tsx
@@ -1,4 +1,5 @@
import React, { type ComponentPropsWithoutRef } from 'react';
+import { useTranslation } from 'react-i18next';
import { envelopeBudget } from 'loot-core/client/queries';
@@ -21,6 +22,8 @@ export function ToBudgetMenu({
onResetHoldBuffer,
...props
}: ToBudgetMenuProps) {
+ const { t } = useTranslation();
+
const toBudget = useEnvelopeSheetValue(envelopeBudget.toBudget) ?? 0;
const forNextMonth = useEnvelopeSheetValue(envelopeBudget.forNextMonth);
const items = [
@@ -28,11 +31,11 @@ export function ToBudgetMenu({
? [
{
name: 'transfer',
- text: 'Move to a category',
+ text: t('Move to a category'),
},
{
name: 'buffer',
- text: 'Hold for next month',
+ text: t('Hold for next month'),
},
]
: []),
@@ -40,7 +43,7 @@ export function ToBudgetMenu({
? [
{
name: 'cover',
- text: 'Cover from a category',
+ text: t('Cover from a category'),
},
]
: []),
@@ -48,7 +51,7 @@ export function ToBudgetMenu({
? [
{
name: 'reset-buffer',
- text: 'Reset next month’s buffer',
+ text: t('Reset next month’s buffer'),
},
]
: []),
@@ -81,7 +84,7 @@ export function ToBudgetMenu({
: [
{
name: 'none',
- text: 'No actions available',
+ text: t('No actions available'),
disabled: true,
},
]
diff --git a/packages/desktop-client/src/components/budget/util.ts b/packages/desktop-client/src/components/budget/util.ts
index 342877ccc9..acea75fd39 100644
--- a/packages/desktop-client/src/components/budget/util.ts
+++ b/packages/desktop-client/src/components/budget/util.ts
@@ -1,4 +1,6 @@
// @ts-strict-ignore
+import { t } from 'i18next';
+
import { type useSpreadsheet } from 'loot-core/src/client/SpreadsheetProvider';
import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months';
@@ -18,15 +20,15 @@ export function addToBeBudgetedGroup(groups: CategoryGroupEntity[]) {
return [
{
id: 'to-be-budgeted',
- name: 'To Be Budgeted',
+ name: t('To Be Budgeted'),
categories: [
{
id: 'to-be-budgeted',
- name: 'To Be Budgeted',
+ name: t('To Be Budgeted'),
cat_group: 'to-be-budgeted',
group: {
id: 'to-be-budgeted',
- name: 'To Be Budgeted',
+ name: t('To Be Budgeted'),
},
},
],
diff --git a/packages/desktop-client/src/components/manager/ServerURL.tsx b/packages/desktop-client/src/components/manager/ServerURL.tsx
index 4979e8d19b..d2d96bc706 100644
--- a/packages/desktop-client/src/components/manager/ServerURL.tsx
+++ b/packages/desktop-client/src/components/manager/ServerURL.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { Trans } from 'react-i18next';
import { Link } from '../common/Link';
import { Text } from '../common/Text';
@@ -23,15 +24,17 @@ export function ServerURL() {
>
<Text>
{url ? (
- <>
+ <Trans>
Using server: <strong>{url}</strong>
- </>
+ </Trans>
) : (
- <strong>No server configured</strong>
+ <Trans>
+ <strong>No server configured</strong>
+ </Trans>
)}
</Text>
<Link variant="internal" to="/config-server" style={{ marginLeft: 15 }}>
- Change
+ <Trans>Change</Trans>
</Link>
</View>
);
diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
index 0894061e6a..a058630b08 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { send } from 'loot-core/src/platform/client/fetch';
@@ -13,6 +14,8 @@ import { Title } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
export function ChangePassword() {
+ const { t } = useTranslation();
+
const navigate = useNavigate();
const [error, setError] = useState(null);
const [msg, setMessage] = useState(null);
@@ -37,7 +40,7 @@ export function ChangePassword() {
if (error) {
setError(error);
} else {
- setMessage('Password successfully changed');
+ setMessage(t('Password successfully changed'));
await send('subscribe-sign-in', { password });
navigate('/');
}
@@ -45,7 +48,7 @@ export function ChangePassword() {
return (
<View style={{ maxWidth: 500, marginTop: -30 }}>
- <Title text="Change server password" />
+ <Title text={t('Change server password')} />
<Text
style={{
fontSize: 16,
@@ -53,8 +56,10 @@ export function ChangePassword() {
lineHeight: 1.4,
}}
>
- This will change the password for this server instance. All existing
- sessions will stay logged in.
+ <Trans>
+ This will change the password for this server instance. All existing
+ sessions will stay logged in.
+ </Trans>
</Text>
{error && (
@@ -90,7 +95,7 @@ export function ChangePassword() {
style={{ fontSize: 15, marginRight: 10 }}
onPress={() => navigate('/')}
>
- Cancel
+ <Trans>Cancel</Trans>
</Button>
}
onSetPassword={onSetPassword}
diff --git a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx
index 97f40aefc1..ae6c4db017 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx
@@ -1,11 +1,14 @@
// @ts-strict-ignore
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { ButtonWithLoading } from '../../common/Button2';
import { BigInput } from '../../common/Input';
import { View } from '../../common/View';
export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {
+ const { t } = useTranslation();
+
const [password1, setPassword1] = useState('');
const [password2, setPassword2] = useState('');
const [showPassword, setShowPassword] = useState(false);
@@ -40,14 +43,14 @@ export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {
>
<BigInput
autoFocus={true}
- placeholder="Password"
+ placeholder={t('Password')}
type={showPassword ? 'text' : 'password'}
value={password1}
onChangeValue={setPassword1}
onEnter={onSubmit}
/>
<BigInput
- placeholder="Confirm password"
+ placeholder={t('Confirm password')}
type={showPassword ? 'text' : 'password'}
value={password2}
onChangeValue={setPassword2}
@@ -64,7 +67,8 @@ export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {
}}
>
<label style={{ userSelect: 'none' }}>
- <input type="checkbox" onChange={onShowPassword} /> Show password
+ <input type="checkbox" onChange={onShowPassword} />{' '}
+ <Trans>Show password</Trans>
</label>
<View style={{ flex: 1 }} />
{buttons}
@@ -73,7 +77,7 @@ export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {
isLoading={loading}
onPress={onSubmit}
>
- OK
+ <Trans>OK</Trans>
</ButtonWithLoading>
</View>
</View>
diff --git a/packages/desktop-client/src/components/manager/subscribe/Error.tsx b/packages/desktop-client/src/components/manager/subscribe/Error.tsx
index c1328d43f9..9168d9fbe0 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Error.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Error.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React from 'react';
+import { Trans } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import { useNavigate } from '../../../hooks/useNavigate';
@@ -38,7 +39,7 @@ export function Error() {
{getErrorMessage(error)}
</Text>
<Button onPress={onTryAgain} style={{ marginTop: 20 }}>
- Try again
+ <Trans>Try again</Trans>
</Button>
</View>
);
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.tsx b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
index d81f9a52a8..bbc2c4f99b 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React, { useState, useEffect } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { useParams, useSearchParams } from 'react-router-dom';
@@ -18,6 +19,8 @@ import { View } from '../../common/View';
import { useBootstrapped, Title } from './common';
export function Login() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const { method = 'password' } = useParams();
const [searchParams, _setSearchParams] = useSearchParams();
@@ -93,7 +96,7 @@ export function Login() {
return (
<View style={{ maxWidth: 450, marginTop: -30, color: theme.pageText }}>
- <Title text="Sign in to this Actual instance" />
+ <Title text={t('Sign in to this Actual instance')} />
<Text
style={{
fontSize: 16,
@@ -101,8 +104,10 @@ export function Login() {
lineHeight: 1.4,
}}
>
- If you lost your password, you likely still have access to your server
- to manually reset it.
+ <Trans>
+ If you lost your password, you likely still have access to your server
+ to manually reset it.
+ </Trans>
</Text>
{error && (
@@ -122,7 +127,7 @@ export function Login() {
<View style={{ display: 'flex', flexDirection: 'row', marginTop: 30 }}>
<BigInput
autoFocus={true}
- placeholder="Password"
+ placeholder={t('Password')}
type="password"
onChangeValue={setPassword}
style={{ flex: 1, marginRight: 10 }}
@@ -134,7 +139,7 @@ export function Login() {
style={{ fontSize: 15 }}
onPress={onSubmit}
>
- Sign in
+ <Trans>Sign in</Trans>
</ButtonWithLoading>
</View>
)}
@@ -153,12 +158,12 @@ export function Login() {
style={{ fontSize: 15 }}
to={'/login/password?error=' + error}
>
- Login with Password
+ <Trans>Login with Password</Trans>
</Link>
)}
{!error && (
<span>
- Checking Header Token Login ...{' '}
+ <Trans>Checking Header Token Login ...</Trans>{' '}
<AnimatedLoading style={{ width: 20, height: 20 }} />
</span>
)}
@@ -176,7 +181,7 @@ export function Login() {
style={{ fontSize: 15, color: theme.pageTextLink, marginLeft: 10 }}
onPress={onDemo}
>
- Try Demo &rarr;
+ <Trans>Try Demo &rarr;</Trans>
</Button>
</View>
</View>
diff --git a/packages/desktop-client/src/components/modals/CoverModal.tsx b/packages/desktop-client/src/components/modals/CoverModal.tsx
index 49d758bb3c..30a94eb76f 100644
--- a/packages/desktop-client/src/components/modals/CoverModal.tsx
+++ b/packages/desktop-client/src/components/modals/CoverModal.tsx
@@ -1,4 +1,5 @@
import React, { useCallback, useMemo, useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/client/actions';
@@ -30,6 +31,8 @@ export function CoverModal({
showToBeBudgeted = true,
onSubmit,
}: CoverModalProps) {
+ const { t } = useTranslation();
+
const { grouped: originalCategoryGroups } = useCategories();
const [categoryGroups, categories] = useMemo(() => {
const expenseGroups = originalCategoryGroups.filter(g => !g.is_income);
@@ -77,7 +80,7 @@ export function CoverModal({
rightContent={<ModalCloseButton onPress={close} />}
/>
<View>
- <FieldLabel title="Cover from category:" />
+ <FieldLabel title={t('Cover from category:')} />
<TapField value={fromCategory?.name} onClick={onCategoryClick} />
</View>
@@ -100,7 +103,7 @@ export function CoverModal({
close();
}}
>
- Transfer
+ <Trans>Transfer</Trans>
</Button>
</View>
</>
diff --git a/packages/desktop-client/src/components/modals/TransferModal.tsx b/packages/desktop-client/src/components/modals/TransferModal.tsx
index 18656bc8e9..2abd515a61 100644
--- a/packages/desktop-client/src/components/modals/TransferModal.tsx
+++ b/packages/desktop-client/src/components/modals/TransferModal.tsx
@@ -1,4 +1,5 @@
import React, { useMemo, useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/client/actions';
@@ -34,6 +35,8 @@ export function TransferModal({
showToBeBudgeted,
onSubmit,
}: TransferModalProps) {
+ const { t } = useTranslation();
+
const { grouped: originalCategoryGroups } = useCategories();
const [categoryGroups, categories] = useMemo(() => {
const expenseGroups = originalCategoryGroups.filter(g => !g.is_income);
@@ -85,7 +88,7 @@ export function TransferModal({
/>
<View>
<View>
- <FieldLabel title="Transfer this amount:" />
+ <FieldLabel title={t('Transfer this amount:')} />
<InitialFocus>
<AmountInput
value={initialAmount}
@@ -133,7 +136,7 @@ export function TransferModal({
close();
}}
>
- Transfer
+ <Trans>Transfer</Trans>
</Button>
</View>
</View>
diff --git a/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx b/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx
index 98e6efdb16..3b93804fb8 100644
--- a/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/DeleteFileModal.tsx
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { deleteBudget } from 'loot-core/client/actions';
@@ -15,6 +16,8 @@ type DeleteFileProps = {
};
export function DeleteFileModal({ file }: DeleteFileProps) {
+ const { t } = useTranslation();
+
// If the state is "broken" that means it was created by another
// user. The current user should be able to delete the local file,
// but not the remote one
@@ -30,7 +33,7 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
{({ state: { close } }) => (
<>
<ModalHeader
- title={'Delete ' + file.name}
+ title={t('Delete {{fileName}}', { fileName: file.name })}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View
@@ -46,10 +49,12 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
{isCloudFile && (
<>
<Text>
- This is a <strong>hosted file</strong> which means it is
- stored on your server to make it available for download on any
- device. You can delete it from the server, which will also
- remove it from all of your devices.
+ <Trans>
+ This is a <strong>hosted file</strong> which means it is
+ stored on your server to make it available for download on
+ any device. You can delete it from the server, which will
+ also remove it from all of your devices.
+ </Trans>
</Text>
<ButtonWithLoading
@@ -75,7 +80,7 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
close();
}}
>
- Delete file from all devices
+ <Trans>Delete file from all devices</Trans>
</ButtonWithLoading>
</>
)}
@@ -84,26 +89,30 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
<>
{isCloudFile ? (
<Text>
- You can also delete just the local copy. This will remove
- all local data and the file will be listed as available for
- download.
+ <Trans>
+ You can also delete just the local copy. This will remove
+ all local data and the file will be listed as available
+ for download.
+ </Trans>
</Text>
) : (
<Text>
{file.state === 'broken' ? (
- <>
+ <Trans>
This is a <strong>hosted file</strong> but it was
created by another user. You can only delete the local
copy.
- </>
+ </Trans>
) : (
- <>
+ <Trans>
This a <strong>local file</strong> which is not stored
on a server.
- </>
+ </Trans>
)}{' '}
- Deleting it will remove it and all of its backups
- permanently.
+ <Trans>
+ Deleting it will remove it and all of its backups
+ permanently.
+ </Trans>
</Text>
)}
@@ -133,7 +142,7 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
close();
}}
>
- Delete file locally
+ <Trans>Delete file locally</Trans>
</ButtonWithLoading>
</>
)}
diff --git a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
index 659792e7af..d1041250ca 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';
@@ -29,6 +30,8 @@ function getErrorMessage(error: string): string {
}
export function ImportActualModal() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const [error, setError] = useState<string | null>(null);
const [importing, setImporting] = useState(false);
@@ -56,7 +59,7 @@ export function ImportActualModal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title="Import from Actual export"
+ title={t('Import from Actual export')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View style={{ ...styles.smallText, lineHeight: 1.5, marginTop: 20 }}>
@@ -68,15 +71,19 @@ export function ImportActualModal() {
<View style={{ '& > div': { lineHeight: '1.7em' } }}>
<Paragraph>
- You can import data from another Actual account or instance.
- First export your data from a different account, and it will
- give you a compressed file. This file is a simple zip file that
- contains the <code>db.sqlite</code> and{' '}
- <code>metadata.json</code> files.
+ <Trans>
+ You can import data from another Actual account or instance.
+ First export your data from a different account, and it will
+ give you a compressed file. This file is a simple zip file
+ that contains the <code>db.sqlite</code> and{' '}
+ <code>metadata.json</code> files.
+ </Trans>
</Paragraph>
<Paragraph>
- Select one of these compressed files and import it here.
+ <Trans>
+ Select one of these compressed files and import it here.
+ </Trans>
</Paragraph>
<View style={{ alignSelf: 'center' }}>
@@ -86,7 +93,7 @@ export function ImportActualModal() {
isLoading={importing}
onPress={onImport}
>
- Select file...
+ <Trans>Select file...</Trans>
</ButtonWithLoading>
</View>
</View>
diff --git a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx
index c1572539d8..3ced17d709 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/client/actions';
@@ -20,6 +21,8 @@ function getErrorMessage(error: 'not-ynab4' | boolean) {
}
export function ImportModal() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const [error] = useState(false);
@@ -51,7 +54,7 @@ export function ImportModal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title="Import From"
+ title={t('Import From')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View style={{ ...styles.smallText, lineHeight: 1.5 }}>
@@ -69,19 +72,23 @@ export function ImportModal() {
<Button style={itemStyle} onPress={() => onSelectType('ynab4')}>
<span style={{ fontWeight: 700 }}>YNAB4</span>
<View style={{ color: theme.pageTextLight }}>
- The old unsupported desktop app
+ <Trans>The old unsupported desktop app</Trans>
</View>
</Button>
<Button style={itemStyle} onPress={() => onSelectType('ynab5')}>
<span style={{ fontWeight: 700 }}>nYNAB</span>
<View style={{ color: theme.pageTextLight }}>
- <div>The newer web app</div>
+ <div>
+ <Trans>The newer web app</Trans>
+ </div>
</View>
</Button>
<Button style={itemStyle} onPress={() => onSelectType('actual')}>
<span style={{ fontWeight: 700 }}>Actual</span>
<View style={{ color: theme.pageTextLight }}>
- <div>Import a file exported from Actual</div>
+ <div>
+ <Trans>Import a file exported from Actual</Trans>
+ </div>
</View>
</Button>
</View>
diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
index 361ac5d46c..3d02baa794 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';
@@ -21,6 +22,8 @@ function getErrorMessage(error: string): string {
}
export function ImportYNAB4Modal() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const [error, setError] = useState<string | null>(null);
const [importing, setImporting] = useState(false);
@@ -48,7 +51,7 @@ export function ImportYNAB4Modal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title="Import from YNAB4"
+ title={t('Import from YNAB4')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View style={{ ...styles.smallText, lineHeight: 1.5, marginTop: 20 }}>
@@ -60,17 +63,21 @@ export function ImportYNAB4Modal() {
<View style={{ alignItems: 'center' }}>
<Paragraph>
- To import data from YNAB4, locate where your YNAB4 data is
- stored. It is usually in your Documents folder under YNAB. Your
- data is a directory inside that with the <code>.ynab4</code>{' '}
- suffix.
+ <Trans>
+ To import data from YNAB4, locate where your YNAB4 data is
+ stored. It is usually in your Documents folder under YNAB.
+ Your data is a directory inside that with the
+ <code>.ynab4</code> suffix.
+ </Trans>
</Paragraph>
<Paragraph>
- When you’ve located your data,{' '}
- <strong>compress it into a zip file</strong>. On macOS,
- right-click the folder and select “Compress”. On Windows,
- right-click and select “Send to &rarr; Compressed (zipped)
- folder”. Upload the zipped folder for importing.
+ <Trans>
+ When you’ve located your data,{' '}
+ <strong>compress it into a zip file</strong>. On macOS,
+ right-click the folder and select “Compress”. On Windows,
+ right-click and select “Send to &rarr; Compressed (zipped)
+ folder”. Upload the zipped folder for importing.
+ </Trans>
</Paragraph>
<View>
<ButtonWithLoading
@@ -79,7 +86,7 @@ export function ImportYNAB4Modal() {
isLoading={importing}
onPress={onImport}
>
- Select zip file...
+ <Trans>Select zip file...</Trans>
</ButtonWithLoading>
</View>
</View>
diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
index e05303b635..a17d9ab74b 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import React, { useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';
@@ -24,6 +25,8 @@ function getErrorMessage(error: string): string {
}
export function ImportYNAB5Modal() {
+ const { t } = useTranslation();
+
const dispatch = useDispatch();
const [error, setError] = useState<string | null>(null);
const [importing, setImporting] = useState(false);
@@ -51,7 +54,7 @@ export function ImportYNAB5Modal() {
{({ state: { close } }) => (
<>
<ModalHeader
- title="Import from nYNAB"
+ title={t('Import from nYNAB')}
rightContent={<ModalCloseButton onPress={close} />}
/>
<View style={{ ...styles.smallText, lineHeight: 1.5, marginTop: 20 }}>
@@ -68,21 +71,25 @@ export function ImportYNAB5Modal() {
}}
>
<Paragraph>
- <Link
- variant="external"
- to="https://actualbudget.org/docs/migration/nynab"
- >
- Read here
- </Link>{' '}
- for instructions on how to migrate your data from YNAB. You need
- to export your data as JSON, and that page explains how to do
- that.
+ <Trans>
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/migration/nynab"
+ >
+ Read here
+ </Link>{' '}
+ for instructions on how to migrate your data from YNAB. You
+ need to export your data as JSON, and that page explains how
+ to do that.
+ </Trans>
</Paragraph>
<Paragraph>
- Once you have exported your data, select the file and Actual
- will import it. Budgets may not match up exactly because things
- work slightly differently, but you should be able to fix up any
- problems.
+ <Trans>
+ Once you have exported your data, select the file and Actual
+ will import it. Budgets may not match up exactly because
+ things work slightly differently, but you should be able to
+ fix up any problems.
+ </Trans>
</Paragraph>
<View>
<ButtonWithLoading
@@ -91,7 +98,7 @@ export function ImportYNAB5Modal() {
isLoading={importing}
onPress={onImport}
>
- Select file...
+ <Trans>Select file...</Trans>
</ButtonWithLoading>
</View>
</View>
diff --git a/packages/desktop-client/src/components/payees/PayeeTableRow.tsx b/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
index 637a63da76..cd6fe5aeb2 100644
--- a/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
+++ b/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import { memo } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
import { type PayeeEntity } from 'loot-core/src/types/models';
@@ -24,6 +25,8 @@ type RuleButtonProps = {
};
function RuleButton({ ruleCount, focused, onEdit, onClick }: RuleButtonProps) {
+ const count = ruleCount;
+
return (
<Cell
name="rule-count"
@@ -46,11 +49,9 @@ function RuleButton({ ruleCount, focused, onEdit, onClick }: RuleButtonProps) {
>
<Text style={{ paddingRight: 5 }}>
{ruleCount > 0 ? (
- <>
- {ruleCount} associated {ruleCount === 1 ? 'rule' : 'rules'}
- </>
+ <Trans count={ruleCount}>{{ count }} associated rules</Trans>
) : (
- <>Create rule</>
+ <Trans>Create rule</Trans>
)}
</Text>
<SvgArrowThinRight style={{ width: 8, height: 8 }} />
@@ -95,6 +96,8 @@ export const PayeeTableRow = memo(
onUpdate,
style,
}: PayeeTableRowProps) => {
+ const { t } = useTranslation();
+
const { id } = payee;
const dispatchSelected = useSelectedDispatch();
const borderColor = selected
@@ -153,7 +156,7 @@ export const PayeeTableRow = memo(
}}
</CustomCell>
<InputCell
- value={(payee.transfer_acct ? 'Transfer: ' : '') + payee.name}
+ value={(payee.transfer_acct ? t('Transfer: ') : '') + payee.name}
valueStyle={
(!selected &&
payee.transfer_acct && { color: theme.pageTextSubdued }) ||
diff --git a/upcoming-release-notes/3444.md b/upcoming-release-notes/3444.md
new file mode 100644
index 0000000000..55f83991cb
--- /dev/null
+++ b/upcoming-release-notes/3444.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [a-gradina]
+---
+
+Support translations in various files.