A local-first personal finance app
📚 Translation batch #1 (#4408)
lelemm1cc2da1de382
diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsxindex a882d7397a..fb22b91d1d 100644--- a/packages/desktop-client/src/components/accounts/Account.tsx+++ b/packages/desktop-client/src/components/accounts/Account.tsx@@ -1881,7 +1881,7 @@ class AccountInternal extends PureComponent<fontStyle: 'italic',}}>- No transactions+ <Trans>No transactions</Trans></View>) : null}diff --git a/packages/desktop-client/src/components/budget/SidebarCategory.tsx b/packages/desktop-client/src/components/budget/SidebarCategory.tsxindex 4b72a94c14..0b08646ce7 100644--- a/packages/desktop-client/src/components/budget/SidebarCategory.tsx+++ b/packages/desktop-client/src/components/budget/SidebarCategory.tsx@@ -124,12 +124,12 @@ export function SidebarCategory({setMenuOpen(false);}}items={[- { name: 'rename', text: 'Rename' },+ { name: 'rename', text: t('Rename') },!categoryGroup?.hidden && {name: 'toggle-visibility',- text: category.hidden ? 'Show' : 'Hide',+ text: category.hidden ? t('Show') : t('Hide'),},- { name: 'delete', text: 'Delete' },+ { name: 'delete', text: t('Delete') },]}/></Popover>diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsxindex eae77e5eed..07957345c6 100644--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/TotalsList.tsx@@ -1,4 +1,5 @@import React, { type CSSProperties } from 'react';+import { Trans } from 'react-i18next';import { AlignedText } from '@actual-app/components/aligned-text';import { Block } from '@actual-app/components/block';@@ -120,10 +121,21 @@ export function TotalsList({ prevMonthName, style }: TotalsListProps) {</View><View>- <Block>Available funds</Block>- <Block>Overspent in {prevMonthName}</Block>- <Block>Budgeted</Block>- <Block>For next month</Block>+ <Block>+ <Trans>Available funds</Trans>+ </Block>++ <Block>+ <Trans>Overspent in {{ prevMonthName }}</Trans>+ </Block>++ <Block>+ <Trans>Budgeted</Trans>+ </Block>++ <Block>+ <Trans>For next month</Trans>+ </Block></View></View>);diff --git a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsxindex 23ba2248a3..2d0498a4f2 100644--- a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx+++ b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx@@ -5,6 +5,7 @@ import React, {useCallback,useState,} from 'react';+import { useTranslation } from 'react-i18next';import { NavLink } from 'react-router-dom';import { useSpring, animated, config } from 'react-spring';@@ -37,6 +38,7 @@ const HIDDEN_Y = TOTAL_HEIGHT;export const MOBILE_NAV_HEIGHT = ROW_HEIGHT + PILL_HEIGHT;export function MobileNavTabs() {+ const { t } = useTranslation();const { isNarrowWidth } = useResponsive();const [navbarState, setNavbarState] = useState<'default' | 'open' | 'hidden'>('default',@@ -90,49 +92,49 @@ export function MobileNavTabs() {const navTabs = [{- name: 'Budget',+ name: t('Budget'),path: '/budget',style: navTabStyle,Icon: SvgWallet,},{- name: 'Transaction',+ name: t('Transaction'),path: '/transactions/new',style: navTabStyle,Icon: SvgAdd,},{- name: 'Accounts',+ name: t('Accounts'),path: '/accounts',style: navTabStyle,Icon: SvgPiggyBank,},{- name: 'Reports',+ name: t('Reports'),path: '/reports',style: navTabStyle,Icon: SvgReports,},{- name: 'Schedules (Soon)',+ name: t('Schedules (Soon)'),path: '/schedules/soon',style: navTabStyle,Icon: SvgCalendar,},{- name: 'Payees (Soon)',+ name: t('Payees (Soon)'),path: '/payees/soon',style: navTabStyle,Icon: SvgStoreFront,},{- name: 'Rules (Soon)',+ name: t('Rules (Soon)'),path: '/rules/soon',style: navTabStyle,Icon: SvgTuning,},{- name: 'Settings',+ name: t('Settings'),path: '/settings',style: navTabStyle,Icon: SvgCog,diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsxindex 61cd9165fb..3ac2b75af2 100644--- a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx+++ b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx@@ -5,6 +5,7 @@ import React, {useMemo,useState,} from 'react';+import { useTranslation } from 'react-i18next';import { Button } from '@actual-app/components/button';import { styles } from '@actual-app/components/styles';@@ -230,6 +231,7 @@ function TransactionListWithPreviews({| 'uncategorized';readonly accountName: AccountEntity['name'] | string;}) {+ const { t } = useTranslation();const baseTransactionsQuery = useCallback(() =>queries.transactions(accountId).options({ splits: 'none' }).select('*'),@@ -340,7 +342,7 @@ function TransactionListWithPreviews({balanceUncleared={balanceQueries.uncleared}isLoadingMore={isLoadingMore}onLoadMore={loadMoreTransactions}- searchPlaceholder={`Search ${accountName}`}+ searchPlaceholder={t('Search {{accountName}}', { accountName })}onSearch={onSearch}onOpenTransaction={onOpenTransaction}onRefresh={onRefresh}diff --git a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsxindex 87a2f68d54..ae0b3b4ed6 100644--- a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx+++ b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx@@ -262,7 +262,7 @@ function AccountList({{onBudgetAccounts.length > 0 && (<AccountHeaderid="onbudget"- name="On budget"+ name={t('On budget')}amount={getOnBudgetBalance()}/>)}@@ -282,7 +282,7 @@ function AccountList({{offBudgetAccounts.length > 0 && (<AccountHeaderid="offbudget"- name="Off budget"+ name={t('Off budget')}amount={getOffBudgetBalance()}style={{ marginTop: 30 }}/>diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsxindex 2ae4eb17a5..94055efbf0 100644--- a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx+++ b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx@@ -488,7 +488,13 @@ const ExpenseCategory = memo(function ExpenseCategory({});dispatch(collapseModals(`${modalBudgetType}-balance-menu`));showUndoNotification({- message: `Covered ${category.name} overspending from ${categoriesById[fromCategoryId].name}.`,+ message: t(+ `Covered {{toCategoryName}} overspending from {{fromCategoryName}}.`,+ {+ toCategoryName: category.name,+ fromCategoryName: categoriesById[fromCategoryId].name,+ },+ ),});},}),@@ -502,6 +508,7 @@ const ExpenseCategory = memo(function ExpenseCategory({month,onBudgetAction,showUndoNotification,+ t,]);const onOpenBalanceMenu = useCallback(() => {diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsxindex ebc1ea7604..e0f15d20db 100644--- a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx@@ -7,7 +7,7 @@ import React, {useMemo,useCallback,} from 'react';-import { useTranslation } from 'react-i18next';+import { Trans, useTranslation } from 'react-i18next';import { useLocation, useParams } from 'react-router-dom';import { styles } from '@actual-app/components/styles';@@ -236,7 +236,7 @@ function Footer({marginLeft: 6,}}>- Select account+ <Trans>Select account</Trans></Text></Button>) : isAdding ? (@@ -254,7 +254,7 @@ function Footer({marginLeft: 5,}}>- Add transaction+ <Trans>Add transaction</Trans></Text></Button>) : (@@ -750,8 +750,8 @@ const TransactionEditInner = memo(function TransactionEditInner({title={transaction.payee == null? isAdding- ? 'New Transaction'- : 'Transaction'+ ? t('New Transaction')+ : t('Transaction'): title}leftContent={<MobileBackButton />}diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsxindex bc983b2b24..2fe59e36af 100644--- a/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx@@ -7,7 +7,7 @@ import React, {type CSSProperties,} from 'react';import { ListBox, Section, Header, Collection } from 'react-aria-components';-import { useTranslation } from 'react-i18next';+import { Trans, useTranslation } from 'react-i18next';import { Button } from '@actual-app/components/button';import { Menu, type MenuItemObject } from '@actual-app/components/menu';@@ -149,7 +149,9 @@ export function TransactionList({backgroundColor: theme.mobilePageBackground,}}>- <Text style={{ fontSize: 15 }}>No transactions</Text>+ <Text style={{ fontSize: 15 }}>+ <Trans>No transactions</Trans>+ </Text></View>)}items={sections}diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsxindex 1bde3e51d2..93b5f375ef 100644--- a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx@@ -4,6 +4,7 @@ import React, {} from 'react';import { mergeProps } from 'react-aria';import { ListBoxItem } from 'react-aria-components';+import { useTranslation } from 'react-i18next';import { Button } from '@actual-app/components/button';import { styles } from '@actual-app/components/styles';@@ -50,6 +51,7 @@ export function TransactionListItem({onLongPress,...props}: TransactionListItemProps) {+ const { t } = useTranslation();const { list: categories } = useCategories();const { value: transaction } = props;@@ -186,7 +188,7 @@ export function TransactionListItem({}),}}>- {prettyPayee || '(No payee)'}+ {prettyPayee || t('(No payee)')}</TextOneLine></View>{isPreview ? (diff --git a/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx b/packages/desktop-client/src/components/modals/CategoryMenuModal.tsxindex 4b3271769f..2a238c8c5c 100644--- a/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx+++ b/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx@@ -116,7 +116,9 @@ export function CategoryMenuModal({}}><Notes- notes={originalNotes?.length > 0 ? originalNotes : 'No notes'}+ notes={+ originalNotes?.length > 0 ? originalNotes : t('No notes')+ }editable={false}focused={false}getStyle={() => ({@@ -199,14 +201,14 @@ function AdditionalCategoryMenu({items={[!categoryGroup?.hidden && {name: 'toggleVisibility',- text: category.hidden ? 'Show' : 'Hide',+ text: category.hidden ? t('Show') : t('Hide'),icon: category.hidden ? SvgViewShow : SvgViewHide,iconSize: 16,},!categoryGroup?.hidden && Menu.line,{name: 'delete',- text: 'Delete',+ text: t('Delete'),icon: SvgTrash,iconSize: 15,},diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsxindex a30344bbcc..7cf6ee4711 100644--- a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx+++ b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx@@ -86,7 +86,7 @@ export function CreateLocalAccountModal() {/><View><Form onSubmit={onSubmit}>- <InlineField label="Name" width="100%">+ <InlineField label={t('Name')} width="100%"><InitialFocus><Inputname="name"@@ -161,7 +161,7 @@ export function CreateLocalAccountModal() {</View></View>- <InlineField label="Balance" width="100%">+ <InlineField label={t('Balance')} width="100%"><Inputname="balance"inputMode="decimal"diff --git a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportModal.tsxindex 13c1a6321b..661a893025 100644--- a/packages/desktop-client/src/components/modals/manager/ImportModal.tsx+++ b/packages/desktop-client/src/components/modals/manager/ImportModal.tsx@@ -67,8 +67,10 @@ export function ImportModal() {)}<Text style={{ marginBottom: 15 }}>- Select an app to import from, and we’ll guide you through the- process.+ <Trans>+ Select an app to import from, and we’ll guide you through the+ process.+ </Trans></Text><Button style={itemStyle} onPress={() => onSelectType('ynab4')}>diff --git a/packages/desktop-client/src/components/reports/ReportSidebar.tsx b/packages/desktop-client/src/components/reports/ReportSidebar.tsxindex 64a10a4a84..3a7259b7a4 100644--- a/packages/desktop-client/src/components/reports/ReportSidebar.tsx+++ b/packages/desktop-client/src/components/reports/ReportSidebar.tsx@@ -113,6 +113,26 @@ export function ReportSidebar({);};+ const [includeCurrentIntervalText, includeCurrentIntervalTooltip] =+ useMemo(() => {+ const rangeType = (+ ReportOptions.dateRangeType.get(customReportItems.dateRange) || ''+ ).toLowerCase();++ let text = t('Include current period');+ let tooltip = t('Include current period in live range');++ if (rangeType === 'month') {+ text = t('Include current Month');+ tooltip = t('Include current Month in live range');+ } else if (rangeType === 'year') {+ text = t('Include current Year');+ tooltip = t('Include current Year in live range');+ }++ return [text, tooltip];+ }, [customReportItems.dateRange, t]);+const onChangeMode = (cond: string) => {setSessionReport('mode', cond);onReportChange({ type: 'modify' });@@ -381,21 +401,8 @@ export function ReportSidebar({items={[{name: 'include-current-interval',- text:- 'Include current ' +- (- ReportOptions.dateRangeType.get(- customReportItems.dateRange,- ) || ''- ).toLowerCase(),- tooltip:- 'Include current ' +- (- ReportOptions.dateRangeType.get(- customReportItems.dateRange,- ) || ''- ).toLowerCase() +- ' in live range',+ text: includeCurrentIntervalText,+ tooltip: includeCurrentIntervalTooltip,toggle: customReportItems.includeCurrentInterval,disabled:customReportItems.isDateStatic ||@@ -405,26 +412,26 @@ export function ReportSidebar({},{name: 'show-hidden-categories',- text: 'Show hidden categories',- tooltip: 'Show hidden categories',+ text: t('Show hidden categories'),+ tooltip: t('Show hidden categories'),toggle: customReportItems.showHiddenCategories,},{name: 'show-empty-items',- text: 'Show empty rows',- tooltip: 'Show rows that are zero or blank',+ text: t('Show empty rows'),+ tooltip: t('Show rows that are zero or blank'),toggle: customReportItems.showEmpty,},{name: 'show-off-budget',- text: 'Show off budget',- tooltip: 'Show off budget accounts',+ text: t('Show off budget'),+ tooltip: t('Show off budget accounts'),toggle: customReportItems.showOffBudget,},{name: 'show-uncategorized',- text: 'Show uncategorized',- tooltip: 'Show uncategorized transactions',+ text: t('Show uncategorized'),+ tooltip: t('Show uncategorized transactions'),toggle: customReportItems.showUncategorized,},]}diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsxindex bf422b899c..918d462dcd 100644--- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx@@ -708,7 +708,9 @@ function CustomReportInner({ report: initialReport }: CustomReportInnerProps) {<PageHeadertitle={<Trans>- <Text>Custom Report:</Text>{' '}+ <Text>+ <Trans>Custom Report:</Trans>+ </Text>{' '}<Text style={{ marginLeft: 5, color: theme.pageTextPositive }}>{{diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsxindex 37e12483a5..e11aa372e8 100644--- a/packages/desktop-client/src/components/reports/reports/Spending.tsx+++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx@@ -457,8 +457,8 @@ function SpendingInternal({ widget }: SpendingInternalProps) {reportMode === 'single-month'? monthUtils.format(compareTo, 'MMM, yyyy'): reportMode === 'budget'- ? 'Budgeted'- : 'Average'+ ? t('Budgeted')+ : t('Average')}style={{ padding: 0, paddingBottom: 10 }}/>@@ -476,8 +476,20 @@ function SpendingInternal({ widget }: SpendingInternalProps) {style={{ marginBottom: 5, minWidth: 210 }}left={<Block>- Spent {monthUtils.format(compare, 'MMM, yyyy')}- {compare === monthUtils.currentMonth() && ' MTD'}:+ {compare === monthUtils.currentMonth()+ ? t('Spent {{monthYearFormatted}} MTD', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })+ : t('Spent {{monthYearFormatted}}:', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })}+ :</Block>}right={@@ -496,8 +508,19 @@ function SpendingInternal({ widget }: SpendingInternalProps) {style={{ marginBottom: 5, minWidth: 210 }}left={<Block>- Spent {monthUtils.format(compareTo, 'MMM, yyyy')}- {compare === monthUtils.currentMonth() && ' MTD'}:+ {compare === monthUtils.currentMonth()+ ? t('Spent {{monthYearFormatted}} MTD:', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })+ : t('Spent {{monthYearFormatted}}:', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })}</Block>}right={@@ -517,8 +540,11 @@ function SpendingInternal({ widget }: SpendingInternalProps) {style={{ marginBottom: 5, minWidth: 210 }}left={<Block>- Budgeted- {compare === monthUtils.currentMonth() && ' MTD'}:+ {compare === monthUtils.currentMonth() ? (+ <Trans>Budgeted MTD</Trans>+ ) : (+ <Trans>Budgeted</Trans>+ )}</Block>}right={@@ -537,8 +563,19 @@ function SpendingInternal({ widget }: SpendingInternalProps) {style={{ marginBottom: 5, minWidth: 210 }}left={<Block>- Spent Average- {compare === monthUtils.currentMonth() && ' MTD'}:+ {compare === monthUtils.currentMonth()+ ? t('Spent Average {{monthYearFormatted}} MTD:', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })+ : t('Spent Average {{monthYearFormatted}}:', {+ monthYearFormatted: monthUtils.format(+ compare,+ 'MMM, yyyy',+ ),+ })}</Block>}right={diff --git a/packages/desktop-client/src/components/settings/Export.tsx b/packages/desktop-client/src/components/settings/Export.tsxindex 9198b4c715..a2f42148d4 100644--- a/packages/desktop-client/src/components/settings/Export.tsx+++ b/packages/desktop-client/src/components/settings/Export.tsx@@ -1,5 +1,5 @@import React, { useState } from 'react';-import { useTranslation } from 'react-i18next';+import { Trans, useTranslation } from 'react-i18next';import { Block } from '@actual-app/components/block';import { ButtonWithLoading } from '@actual-app/components/button';@@ -59,16 +59,19 @@ export function ExportBudget() {}><Text>- <strong>Export</strong> your data as a zip file containing{' '}- <code>db.sqlite</code> and <code>metadata.json</code> files. It can be- imported into another Actual instance by closing an open file (if any),- then clicking the “Import file” button, then choosing “Actual.”+ <Trans>+ <strong>Export</strong> your data as a zip file containing{' '}+ <code>db.sqlite</code> and <code>metadata.json</code> files. It can be+ imported into another Actual instance by closing an open file (if+ any), then clicking the “Import file” button, then choosing “Actual.”+ </Trans></Text>{encryptKeyId ? (<Text>- {t(- 'Even though encryption is enabled, the exported zip file will not have any encryption.',- )}+ <Trans>+ Even though encryption is enabled, the exported zip file will not+ have any encryption.+ </Trans></Text>) : null}</Setting>diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsxindex dcfb709910..733f570088 100644--- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx@@ -10,7 +10,7 @@ import React, {useEffect,} from 'react';import { useHotkeys } from 'react-hotkeys-hook';-import { useTranslation } from 'react-i18next';+import { Trans, useTranslation } from 'react-i18next';import { Button } from '@actual-app/components/button';import { Popover } from '@actual-app/components/popover';@@ -1807,7 +1807,7 @@ function NewTransaction({data-testid="cancel-button"ref={cancelButtonRef}>- Cancel+ <Trans>Cancel</Trans></Button>{error ? (<TransactionError@@ -1827,7 +1827,7 @@ function NewTransaction({data-testid="add-button"ref={addButtonRef}>- Add+ <Trans>Add</Trans></Button>)}</View>diff --git a/upcoming-release-notes/4408.md b/upcoming-release-notes/4408.mdnew file mode 100644index 0000000000..7089479f72--- /dev/null+++ b/upcoming-release-notes/4408.md@@ -0,0 +1,6 @@+---+category: Enhancements+authors: [lelemm]+---++Extending translations for components: Account, SidebarCategory, TotalsList, MobileNavTabs, AccountTransactions (Mobile), Accounts (Mobile), BudgetTable (Mobile), TransactionEdit (Mobile), TransactionList (Mobile), TransactionListItem (Mobile), CategoryMenuModal, CreateLocalAccountModal, ImportModal, ReportSideBar, CustomReport, Spending, Export, TransactionsTable