Skip to content
Snippets Groups Projects
Unverified Commit 0a59f793 authored by NickFR's avatar NickFR Committed by GitHub
Browse files

Translation: desktop-client/src/components/budget/BalanceWithCarryover.tsx (#3352)

parent cfa9ac09
No related branches found
No related tags found
No related merge requests found
// @ts-strict-ignore // @ts-strict-ignore
import React, { type ComponentPropsWithoutRef } from 'react'; import React, { type ComponentPropsWithoutRef } from 'react';
import { useTranslation } from 'react-i18next';
import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { SvgArrowThinRight } from '../../icons/v1'; import { SvgArrowThinRight } from '../../icons/v1';
...@@ -77,6 +78,7 @@ export function BalanceWithCarryover({ ...@@ -77,6 +78,7 @@ export function BalanceWithCarryover({
carryoverIndicator = DefaultCarryoverIndicator, carryoverIndicator = DefaultCarryoverIndicator,
...props ...props
}: BalanceWithCarryoverProps) { }: BalanceWithCarryoverProps) {
const { t } = useTranslation();
const carryoverValue = useSheetValue(carryover); const carryoverValue = useSheetValue(carryover);
const balanceValue = useSheetValue(balance); const balanceValue = useSheetValue(balance);
const goalValue = useSheetValue(goal); const goalValue = useSheetValue(goal);
...@@ -132,34 +134,40 @@ export function BalanceWithCarryover({ ...@@ -132,34 +134,40 @@ export function BalanceWithCarryover({
<View style={{ padding: 10 }}> <View style={{ padding: 10 }}>
<span style={{ fontWeight: 'bold' }}> <span style={{ fontWeight: 'bold' }}>
{differenceToGoal === 0 ? ( {differenceToGoal === 0 ? (
<span style={{ color: theme.noticeText }}>Fully funded</span> <span style={{ color: theme.noticeText }}>
{t('Fully funded')}
</span>
) : differenceToGoal > 0 ? ( ) : differenceToGoal > 0 ? (
<span style={{ color: theme.noticeText }}> <span style={{ color: theme.noticeText }}>
Overfunded ({format(differenceToGoal, 'financial')}) {t('Overfunded ({{amount}})', {
amount: format(differenceToGoal, 'financial'),
})}
</span> </span>
) : ( ) : (
<span style={{ color: theme.errorText }}> <span style={{ color: theme.errorText }}>
Underfunded ({format(differenceToGoal, 'financial')}) {t('Underfunded ({{amount}})', {
amount: format(differenceToGoal, 'financial'),
})}
</span> </span>
)} )}
</span> </span>
<GoalTooltipRow> <GoalTooltipRow>
<div>Goal Type:</div> <div>{t('Goal Type:')}</div>
<div>{longGoalValue === 1 ? 'Long' : 'Template'}</div> <div>{longGoalValue === 1 ? 'Long' : 'Template'}</div>
</GoalTooltipRow> </GoalTooltipRow>
<GoalTooltipRow> <GoalTooltipRow>
<div>Goal:</div> <div>{t('Goal:')}</div>
<div>{format(goalValue, 'financial')}</div> <div>{format(goalValue, 'financial')}</div>
</GoalTooltipRow> </GoalTooltipRow>
<GoalTooltipRow> <GoalTooltipRow>
{longGoalValue !== 1 ? ( {longGoalValue !== 1 ? (
<> <>
<div>Budgeted:</div> <div>{t('Budgeted:')}</div>
<div>{format(budgetedValue, 'financial')}</div> <div>{format(budgetedValue, 'financial')}</div>
</> </>
) : ( ) : (
<> <>
<div>Balance:</div> <div>{t('Balance:')}</div>
<div>{format(balanceValue, 'financial')}</div> <div>{format(balanceValue, 'financial')}</div>
</> </>
)} )}
......
---
category: Maintenance
authors: [nmathey]
---
Support translations in Translation support for desktop-client/src/components/budget/BalanceWithCarryover.tsx
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment