From d08be58f95e1863fe93ffd8660049c2e0aff9430 Mon Sep 17 00:00:00 2001 From: Awais Alee Date: Wed, 13 Nov 2024 20:08:01 +0500 Subject: [PATCH] Marked files for translation (#3827) * Add translation files for desktop client * Add backend translation files for i18n integration * code refactored * code refactored * code refactored --- .../desktop-client/src/components/Modals.tsx | 18 +++-- .../components/modals/BudgetPageMenuModal.tsx | 8 ++- .../components/payees/ManagePayeesPage.jsx | 4 +- .../components/reports/SaveReportChoose.tsx | 8 ++- .../src/components/reports/SaveReportMenu.tsx | 20 +++--- .../src/components/util/DisplayId.tsx | 11 +-- .../src/server/budget/cleanup-template.ts | 20 +++--- .../src/server/budget/goaltemplates.ts | 10 ++- packages/loot-core/src/server/main.ts | 9 ++- packages/loot-core/src/server/mutators.ts | 4 +- packages/loot-core/src/server/sheet.ts | 5 +- packages/loot-core/src/shared/errors.ts | 71 ++++++++++++------- packages/loot-core/src/shared/rules.ts | 68 +++++++++--------- upcoming-release-notes/3827.md | 6 ++ 14 files changed, 162 insertions(+), 100 deletions(-) create mode 100644 upcoming-release-notes/3827.md diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index ef458ef87b4..a52f6fef71d 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -1,5 +1,6 @@ // @ts-strict-ignore import React, { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; import { useDispatch } from 'react-redux'; import { useLocation } from 'react-router-dom'; @@ -81,6 +82,8 @@ export function Modals() { } }, [location]); + const { t } = useTranslation(); + const modals = modalStack .map(({ name, options }) => { switch (name) { @@ -287,10 +290,12 @@ export function Modals() { Header={props => ( } + title={ + + } /> )} - inputPlaceholder="Category name" + inputPlaceholder={t('Category name')} buttonText="Add" onValidate={options.onValidate} onSubmit={options.onSubmit} @@ -306,12 +311,15 @@ export function Modals() { + } /> )} - inputPlaceholder="Category group name" - buttonText="Add" + inputPlaceholder={t('Category group name')} + buttonText={t('Add')} onValidate={options.onValidate} onSubmit={options.onSubmit} /> diff --git a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx index ad01f64d19f..8e96583490c 100644 --- a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx @@ -2,6 +2,7 @@ import React, { type ComponentPropsWithoutRef, type CSSProperties, } from 'react'; +import { useTranslation } from 'react-i18next'; import { useLocalPref } from '../../hooks/useLocalPref'; import { theme, styles } from '../../style'; @@ -77,6 +78,7 @@ function BudgetPageMenu({ throw new Error(`Unrecognized menu item: ${name}`); } }; + const { t } = useTranslation(); return (