diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx index c642801ca2..716482db0d 100644 --- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx +++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx @@ -1,4 +1,5 @@ import React, { type CSSProperties, type MouseEventHandler } from 'react'; +import { useTranslation } from 'react-i18next'; import { Block } from '@actual-app/components/block'; import { styles } from '@actual-app/components/styles'; @@ -35,6 +36,7 @@ export function ToBudgetAmount({ isTotalsListTooltipDisabled = false, onContextMenu, }: ToBudgetAmountProps) { + const { t } = useTranslation(); const sheetName = useEnvelopeSheetName(envelopeBudget.toBudget); const sheetValue = useEnvelopeSheetValue({ name: envelopeBudget.toBudget, @@ -52,7 +54,7 @@ export function ToBudgetAmount({ return ( - {isNegative ? 'Overbudgeted:' : 'To Budget:'} + {isNegative ? t('Overbudgeted:') : t('To Budget:')} { + const retValue = [...filterFields]; + + if (retValue && retValue.length > 0) { + retValue.forEach(field => { + field[1] = mapField(field[0]); + }); + } + + return retValue; + }, []); + const [state, dispatch] = useReducer( (state, action) => { switch (action.type) { @@ -379,12 +391,12 @@ export function FilterButton({ onApply, compact, hover, exclude }) { onMenuSelect={name => { dispatch({ type: 'configure', field: name }); }} - items={filterFields + items={translatedFilterFields .filter(f => (exclude ? !exclude.includes(f[0]) : true)) .sort() .map(([name, text]) => ({ name, - text: titleFirst(mapField(text)), + text: titleFirst(text), }))} /> diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx index 4c10846cd1..e8652f4c00 100644 --- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx +++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx @@ -237,6 +237,18 @@ function ConditionEditor({ inputKey, } = condition; + const translatedConditions = useMemo(() => { + const retValue = [...conditionFields]; + + if (retValue && retValue.length > 0) { + retValue.forEach(field => { + field[1] = mapField(field[0]); + }); + } + + return retValue; + }, []); + let field = originalField; if (field === 'amount' && options) { if (options.inflow) { @@ -273,7 +285,7 @@ function ConditionEditor({ return ( onChange('field', value)} /> @@ -581,6 +593,12 @@ function ConditionsList({ onChangeConditions, }) { function addCondition(index) { + if (conditionFields && conditionFields.length > 0) { + conditionFields.forEach(field => { + field[1] = mapField(field[0]); + }); + } + // (remove the inflow and outflow pseudo-fields since they’d be a pain to get right) let fields = conditionFields .map(f => f[0]) diff --git a/packages/loot-core/src/shared/rules.ts b/packages/loot-core/src/shared/rules.ts index 0fd8c6a74e..09d4d5628e 100644 --- a/packages/loot-core/src/shared/rules.ts +++ b/packages/loot-core/src/shared/rules.ts @@ -156,6 +156,8 @@ export function mapField(field, opts?) { return t('cleared'); case 'reconciled': return t('reconciled'); + case 'transfer': + return t('transfer'); default: return field; } diff --git a/upcoming-release-notes/4770.md b/upcoming-release-notes/4770.md new file mode 100644 index 0000000000..b211b2c7e4 --- /dev/null +++ b/upcoming-release-notes/4770.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [lelemm] +--- + +Missing translations [rules and to budget]