Skip to content

A local-first personal finance app

Fix translate payees page (#5514)

milanalexandre3e488ae8f764
diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
index 3d28907c98..9b0b0dc5cd 100644
--- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx
+++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
@@ -1126,8 +1126,8 @@ export function EditRuleModal({
data-testid="conditions-op"
style={{ display: 'inline-flex' }}
fields={[
- ['and', 'all'],
- ['or', 'any'],
+ ['and', t('all')],
+ ['or', t('any')],
]}
value={conditionsOp}
onChange={onChangeConditionsOp}
diff --git a/packages/desktop-client/src/components/payees/ManagePayees.tsx b/packages/desktop-client/src/components/payees/ManagePayees.tsx
index c83ffc7410..7eadae4ac4 100644
--- a/packages/desktop-client/src/components/payees/ManagePayees.tsx
+++ b/packages/desktop-client/src/components/payees/ManagePayees.tsx
@@ -38,10 +38,6 @@ import { useDispatch } from '@desktop-client/redux';
const getPayeesById = memoizeOne((payees: PayeeEntity[]) => groupById(payees));
-function plural(count: number, singleText: string, pluralText: string) {
- return count === 1 ? singleText : pluralText;
-}
-
function PayeeTableHeader() {
const dispatchSelected = useSelectedDispatch();
const selectedItems = useSelectedItems();
@@ -238,9 +234,9 @@ export const ManagePayees = ({
>
{buttonsDisabled
? t('No payees selected')
- : selected.items.size +
- ' ' +
- t(plural(selected.items.size, 'payee', 'payees'))}
+ : t('{{count}} payees', {
+ count: selected.items.size,
+ })}
<SvgExpandArrow width={8} height={8} style={{ marginLeft: 5 }} />
</Button>
@@ -275,13 +271,9 @@ export const ManagePayees = ({
>
{orphanedOnly
? t('Show all payees')
- : t(
- `Show ${
- orphanedPayees.length === 1
- ? '1 unused payee'
- : `${orphanedPayees.length} unused payees`
- }`,
- )}
+ : t('Show {{count}} unused payees', {
+ count: orphanedPayees.length,
+ })}
</Button>
)}
</View>
diff --git a/upcoming-release-notes/5514.md b/upcoming-release-notes/5514.md
new file mode 100644
index 0000000000..c99c71ce0e
--- /dev/null
+++ b/upcoming-release-notes/5514.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [milanalexandre]
+---
+
+Adds translations to the "rules" page