Skip to content

Commit

Permalink
use proper translation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
qedi-r committed Oct 10, 2024
1 parent 4ac887a commit 67d1719
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/desktop-client/src/components/accounts/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useState, useRef, Fragment } from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { Trans } from 'react-i18next';

import { t } from 'i18next';
import { Trans, useTranslation } from 'react-i18next';

import { useLocalPref } from '../../hooks/useLocalPref';
import { useSplitsExpanded } from '../../hooks/useSplitsExpanded';
Expand Down Expand Up @@ -92,6 +90,7 @@ export function AccountHeader({
onMakeAsSplitTransaction,
onMakeAsNonSplitTransactions,
}) {
const { t } = useTranslation();
const [menuOpen, setMenuOpen] = useState(false);
const searchInput = useRef(null);
const triggerRef = useRef(null);
Expand Down Expand Up @@ -421,6 +420,8 @@ function AccountNameField({
onSaveName,
onExposeName,
}) {
const { t } = useTranslation();

if (editingName) {
return (
<Fragment>
Expand Down Expand Up @@ -527,6 +528,7 @@ function AccountMenu({
onReconcile,
onMenuSelect,
}) {
const { t } = useTranslation();
const [tooltip, setTooltip] = useState('default');
const syncServerStatus = useSyncServerStatus();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { type ComponentProps, Fragment, useRef, useState } from 'react';

import { t } from 'i18next';
import { type ComponentProps, Fragment, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { type AccountEntity } from 'loot-core/types/models';

Expand Down Expand Up @@ -40,6 +39,7 @@ export function AccountMenuModal({
onEditNotes,
onClose,
}: AccountMenuModalProps) {
const { t } = useTranslation();
const account = useAccount(accountId);
const accounts = useAccounts();
const originalNotes = useNotes(`account-${accountId}`);
Expand Down

0 comments on commit 67d1719

Please sign in to comment.