Skip to content

Commit

Permalink
Translation: desktop-client/src/components/reports/reports/CustomRepo…
Browse files Browse the repository at this point in the history
…rt.tsx
  • Loading branch information
AhmedElbohoty committed Oct 23, 2024
1 parent 34f3cca commit 80f5757
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState, useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';

import * as d from 'date-fns';
Expand Down Expand Up @@ -102,6 +103,7 @@ function useSelectedCategories(
}

export function CustomReport() {
const { t } = useTranslation();
const categories = useCategories();
const { isNarrowWidth } = useResponsive();
const [_firstDayOfWeekIdx] = useSyncedPref('firstDayOfWeekIdx');
Expand Down Expand Up @@ -644,16 +646,20 @@ export function CustomReport() {
header={
isNarrowWidth ? (
<MobilePageHeader
title={`Custom Report: ${report.name || 'Unsaved report'}`}
title={
report.name
? t('Custom Report: {{name}}', { name: report.name })
: t('Custom Report: Unsaved report')
}
leftContent={<MobileBackButton onPress={onBackClick} />}
/>
) : (
<PageHeader
title={
<>
<Text>Custom Report:</Text>
<Text>{t('Custom Report:')}</Text>
<Text style={{ marginLeft: 5, color: theme.pageTextPositive }}>
{report.name || 'Unsaved report'}
{report.name || t('Unsaved report')}
</Text>
</>
}
Expand Down Expand Up @@ -766,8 +772,9 @@ export function CustomReport() {

{hasWarning && (
<Warning style={{ paddingTop: 5, paddingBottom: 5 }}>
This report is configured to use a non-existing filter value
(i.e. category/account/payee).
{t(
'This report is configured to use a non-existing filter value (i.e. category/account/payee).',
)}
</Warning>
)}
</View>
Expand Down Expand Up @@ -830,7 +837,7 @@ export function CustomReport() {
intervalsCount={intervals.length}
/>
) : (
<LoadingIndicator message="Loading report..." />
<LoadingIndicator message={t('Loading report...')} />
)}
</View>
</View>
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3722.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [AhmedElbohoty]
---

Translation support for desktop-client/src/components/reports/reports/CustomReport.tsx

0 comments on commit 80f5757

Please sign in to comment.