Skip to content
Snippets Groups Projects
Unverified Commit 933804e8 authored by Ali Gradina's avatar Ali Gradina Committed by GitHub
Browse files

Translation for IncomeHeader, BalanceMenu & BudgetMenu .tsx (#3426)

parent 0a59f793
No related branches found
No related tags found
No related merge requests found
import React from 'react'; import React from 'react';
import { Trans } from 'react-i18next';
import { Button } from '../common/Button2'; import { Button } from '../common/Button2';
import { View } from '../common/View'; import { View } from '../common/View';
...@@ -24,7 +25,7 @@ export function IncomeHeader({ ...@@ -24,7 +25,7 @@ export function IncomeHeader({
}} }}
> >
<Button onPress={onShowNewGroup} style={{ fontSize: 12, margin: 10 }}> <Button onPress={onShowNewGroup} style={{ fontSize: 12, margin: 10 }}>
Add Group <Trans>Add Group</Trans>
</Button> </Button>
</View> </View>
<RenderMonths <RenderMonths
......
import React, { type ComponentPropsWithoutRef } from 'react'; import React, { type ComponentPropsWithoutRef } from 'react';
import { useTranslation } from 'react-i18next';
import { rolloverBudget } from 'loot-core/src/client/queries'; import { rolloverBudget } from 'loot-core/src/client/queries';
...@@ -23,10 +24,13 @@ export function BalanceMenu({ ...@@ -23,10 +24,13 @@ export function BalanceMenu({
onCover, onCover,
...props ...props
}: BalanceMenuProps) { }: BalanceMenuProps) {
const { t } = useTranslation();
const carryover = useRolloverSheetValue( const carryover = useRolloverSheetValue(
rolloverBudget.catCarryover(categoryId), rolloverBudget.catCarryover(categoryId),
); );
const balance = useRolloverSheetValue(rolloverBudget.catBalance(categoryId)); const balance = useRolloverSheetValue(rolloverBudget.catBalance(categoryId));
return ( return (
<Menu <Menu
{...props} {...props}
...@@ -50,7 +54,7 @@ export function BalanceMenu({ ...@@ -50,7 +54,7 @@ export function BalanceMenu({
? [ ? [
{ {
name: 'transfer', name: 'transfer',
text: 'Transfer to another category', text: t('Transfer to another category'),
}, },
] ]
: []), : []),
...@@ -58,15 +62,15 @@ export function BalanceMenu({ ...@@ -58,15 +62,15 @@ export function BalanceMenu({
? [ ? [
{ {
name: 'cover', name: 'cover',
text: 'Cover overspending', text: t('Cover overspending'),
}, },
] ]
: []), : []),
{ {
name: 'carryover', name: 'carryover',
text: carryover text: carryover
? 'Remove overspending rollover' ? t('Remove overspending rollover')
: 'Rollover overspending', : t('Rollover overspending'),
}, },
]} ]}
/> />
......
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 { Menu } from '../../common/Menu'; import { Menu } from '../../common/Menu';
...@@ -17,6 +18,8 @@ export function BudgetMenu({ ...@@ -17,6 +18,8 @@ export function BudgetMenu({
onApplyBudgetTemplate, onApplyBudgetTemplate,
...props ...props
}: BudgetMenuProps) { }: BudgetMenuProps) {
const { t } = useTranslation();
const isGoalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled'); const isGoalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled');
const onMenuSelect = (name: string) => { const onMenuSelect = (name: string) => {
switch (name) { switch (name) {
...@@ -47,25 +50,25 @@ export function BudgetMenu({ ...@@ -47,25 +50,25 @@ export function BudgetMenu({
items={[ items={[
{ {
name: 'copy-single-last', name: 'copy-single-last',
text: 'Copy last month’s budget', text: t('Copy last month’s budget'),
}, },
{ {
name: 'set-single-3-avg', name: 'set-single-3-avg',
text: 'Set to 3 month average', text: t('Set to 3 month average'),
}, },
{ {
name: 'set-single-6-avg', name: 'set-single-6-avg',
text: 'Set to 6 month average', text: t('Set to 6 month average'),
}, },
{ {
name: 'set-single-12-avg', name: 'set-single-12-avg',
text: 'Set to yearly average', text: t('Set to yearly average'),
}, },
...(isGoalTemplatesEnabled ...(isGoalTemplatesEnabled
? [ ? [
{ {
name: 'apply-single-category-template', name: 'apply-single-category-template',
text: 'Apply budget template', text: t('Apply budget template'),
}, },
] ]
: []), : []),
......
---
category: Maintenance
authors: [a-gradina]
---
Support translations in desktop-client/components/budget.
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