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