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

[WIP] Translation: desktop-client/src/components/budget/BudgetTotals.tsx (#3367)


* i18 translation

* realease note

* translate 'arial-label' text

* translate 'text'

* fixing 'text' translation

* <Trans> component for HTML tag

* Lint

---------

Co-authored-by: default avatarJulian Dominguez-Schatz <julian.dominguezschatz@gmail.com>
parent 8e6fb4c6
No related branches found
No related tags found
No related merge requests found
import React, { type ComponentProps, memo, useRef, useState } from 'react'; import React, { type ComponentProps, memo, useRef, useState } from 'react';
import { useTranslation, Trans } from 'react-i18next';
import { SvgDotsHorizontalTriple } from '../../icons/v1'; import { SvgDotsHorizontalTriple } from '../../icons/v1';
import { theme, styles } from '../../style'; import { theme, styles } from '../../style';
...@@ -23,6 +24,7 @@ export const BudgetTotals = memo(function BudgetTotals({ ...@@ -23,6 +24,7 @@ export const BudgetTotals = memo(function BudgetTotals({
expandAllCategories, expandAllCategories,
collapseAllCategories, collapseAllCategories,
}: BudgetTotalsProps) { }: BudgetTotalsProps) {
const { t } = useTranslation();
const [menuOpen, setMenuOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false);
const triggerRef = useRef(null); const triggerRef = useRef(null);
...@@ -54,11 +56,13 @@ export const BudgetTotals = memo(function BudgetTotals({ ...@@ -54,11 +56,13 @@ export const BudgetTotals = memo(function BudgetTotals({
WebkitUserSelect: 'none', WebkitUserSelect: 'none',
}} }}
> >
<View style={{ flexGrow: '1' }}>Category</View> <View style={{ flexGrow: '1' }}>
<Trans>Category</Trans>
</View>
<Button <Button
ref={triggerRef} ref={triggerRef}
variant="bare" variant="bare"
aria-label="Menu" aria-label={t('Menu')}
onPress={() => setMenuOpen(true)} onPress={() => setMenuOpen(true)}
style={{ color: 'currentColor', padding: 3 }} style={{ color: 'currentColor', padding: 3 }}
> >
...@@ -89,15 +93,15 @@ export const BudgetTotals = memo(function BudgetTotals({ ...@@ -89,15 +93,15 @@ export const BudgetTotals = memo(function BudgetTotals({
items={[ items={[
{ {
name: 'toggle-visibility', name: 'toggle-visibility',
text: 'Toggle hidden categories', text: t('Toggle hidden categories'),
}, },
{ {
name: 'expandAllCategories', name: 'expandAllCategories',
text: 'Expand all', text: t('Expand all'),
}, },
{ {
name: 'collapseAllCategories', name: 'collapseAllCategories',
text: 'Collapse all', text: t('Collapse all'),
}, },
]} ]}
/> />
......
---
category: Maintenance
authors: [nmathey]
---
Support translations in Translation support for desktop-client/src/components/budget/BudgetTotals.tsx
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