Skip to content

Commit

Permalink
[WIP] Translation: desktop-client/src/components/budget/BudgetTotals.…
Browse files Browse the repository at this point in the history
…tsx (#3367)

* i18 translation

* realease note

* translate 'arial-label' text

* translate 'text'

* fixing 'text' translation

* <Trans> component for HTML tag

* Lint

---------

Co-authored-by: Julian Dominguez-Schatz <[email protected]>
  • Loading branch information
nmathey and jfdoming authored Sep 5, 2024
1 parent 8e6fb4c commit fca1bcc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/desktop-client/src/components/budget/BudgetTotals.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { type ComponentProps, memo, useRef, useState } from 'react';
import { useTranslation, Trans } from 'react-i18next';

import { SvgDotsHorizontalTriple } from '../../icons/v1';
import { theme, styles } from '../../style';
Expand All @@ -23,6 +24,7 @@ export const BudgetTotals = memo(function BudgetTotals({
expandAllCategories,
collapseAllCategories,
}: BudgetTotalsProps) {
const { t } = useTranslation();
const [menuOpen, setMenuOpen] = useState(false);
const triggerRef = useRef(null);

Expand Down Expand Up @@ -54,11 +56,13 @@ export const BudgetTotals = memo(function BudgetTotals({
WebkitUserSelect: 'none',
}}
>
<View style={{ flexGrow: '1' }}>Category</View>
<View style={{ flexGrow: '1' }}>
<Trans>Category</Trans>
</View>
<Button
ref={triggerRef}
variant="bare"
aria-label="Menu"
aria-label={t('Menu')}
onPress={() => setMenuOpen(true)}
style={{ color: 'currentColor', padding: 3 }}
>
Expand Down Expand Up @@ -89,15 +93,15 @@ export const BudgetTotals = memo(function BudgetTotals({
items={[
{
name: 'toggle-visibility',
text: 'Toggle hidden categories',
text: t('Toggle hidden categories'),
},
{
name: 'expandAllCategories',
text: 'Expand all',
text: t('Expand all'),
},
{
name: 'collapseAllCategories',
text: 'Collapse all',
text: t('Collapse all'),
},
]}
/>
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3367.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [nmathey]
---

Support translations in Translation support for desktop-client/src/components/budget/BudgetTotals.tsx

0 comments on commit fca1bcc

Please sign in to comment.