Skip to content

Commit

Permalink
Merge remote-tracking branch 'org/master' into calendar_report
Browse files Browse the repository at this point in the history
  • Loading branch information
lelemm committed Nov 12, 2024
2 parents 1e1b748 + 9e47801 commit 1f5ca75
Show file tree
Hide file tree
Showing 82 changed files with 727 additions and 490 deletions.
16 changes: 10 additions & 6 deletions packages/desktop-client/src/components/ManageRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, {
type SetStateAction,
type Dispatch,
} from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';

import { useSchedules } from 'loot-core/client/data-hooks/schedules';
Expand Down Expand Up @@ -199,7 +200,9 @@ export function ManageRules({
]);

if (someDeletionsFailed) {
alert('Some rules were not deleted because they are linked to schedules');
alert(
t('Some rules were not deleted because they are linked to schedules'),
);
}

await loadRules();
Expand Down Expand Up @@ -262,6 +265,7 @@ export function ManageRules({
const onHover = useCallback(id => {
setHoveredRule(id);
}, []);
const { t } = useTranslation();

return (
<SelectedProvider instance={selectedInst}>
Expand All @@ -283,19 +287,19 @@ export function ManageRules({
}}
>
<Text>
Rules are always run in the order that you see them.{' '}
{t('Rules are always run in the order that you see them.')}{' '}
<Link
variant="external"
to="https://actualbudget.org/docs/budgeting/rules/"
linkColor="muted"
>
Learn more
{t('Learn more')}
</Link>
</Text>
</View>
<View style={{ flex: 1 }} />
<Search
placeholder="Filter rules..."
placeholder={t('Filter rules...')}
value={filter}
onChange={onSearchChange}
/>
Expand All @@ -308,7 +312,7 @@ export function ManageRules({
style={{ marginBottom: -1 }}
>
{filteredRules.length === 0 ? (
<EmptyMessage text="No rules" style={{ marginTop: 15 }} />
<EmptyMessage text={t('No rules')} style={{ marginTop: 15 }} />
) : (
<RulesList
rules={filteredRules}
Expand Down Expand Up @@ -336,7 +340,7 @@ export function ManageRules({
</Button>
)}
<Button variant="primary" onPress={onCreateRule}>
Create new rule
{t('Create new rule')}
</Button>
</Stack>
</View>
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/ManageRulesPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';

import { t } from 'i18next';

import { ManageRules } from './ManageRules';
import { Page } from './Page';

export function ManageRulesPage() {
return (
<Page header="Rules">
<Page header={t('Rules')}>
<ManageRules isModal={false} payeeId={null} />
</Page>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/Notes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useEffect, useRef, type CSSProperties } from 'react';
import ReactMarkdown from 'react-markdown';

import { css } from '@emotion/css';
import { t } from 'i18next';
import remarkGfm from 'remark-gfm';

import { theme } from '../style';
Expand Down Expand Up @@ -122,7 +123,7 @@ export function Notes({
value={notes || ''}
onChange={e => onChange?.(e.target.value)}
onBlur={e => onBlur?.(e.target.value)}
placeholder="Notes (markdown supported)"
placeholder={t('Notes (markdown supported)')}
/>
) : (
<Text className={css([markdownStyles, getStyle?.(editable)])}>
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/NotesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import React, {
type CSSProperties,
} from 'react';

import { t } from 'i18next';

import { send } from 'loot-core/src/platform/client/fetch';

import { useNotes } from '../hooks/useNotes';
Expand Down Expand Up @@ -59,7 +61,7 @@ export function NotesButton({
<Button
ref={triggerRef}
variant="bare"
aria-label="View notes"
aria-label={t('View notes')}
className={!hasNotes && !isOpen ? 'hover-visible' : ''}
style={{
color: defaultColor,
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import React, {
import { useDispatch, useSelector } from 'react-redux';

import { css } from '@emotion/css';
import { t } from 'i18next';

import { removeNotification } from 'loot-core/client/actions';
import { type State } from 'loot-core/src/client/state-types';
Expand Down Expand Up @@ -231,7 +232,7 @@ function Notification({
</Stack>
<Button
variant="bare"
aria-label="Close"
aria-label={t('Close')}
style={{ flexShrink: 0, color: 'currentColor' }}
onPress={onRemove}
>
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/ThemeSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useRef, useState, type CSSProperties } from 'react';

import { t } from 'i18next';

import type { Theme } from 'loot-core/src/types/prefs';

import { SvgMoonStars, SvgSun, SvgSystem } from '../icons/v2';
Expand Down Expand Up @@ -45,7 +47,7 @@ export function ThemeSelector({ style }: ThemeSelectorProps) {
<Button
ref={triggerRef}
variant="bare"
aria-label="Switch theme"
aria-label={t('Switch theme')}
onPress={() => setMenuOpen(true)}
style={style}
>
Expand Down
7 changes: 4 additions & 3 deletions packages/desktop-client/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
import { Routes, Route, useLocation } from 'react-router-dom';

import { css } from '@emotion/css';
import { t } from 'i18next';

import * as Platform from 'loot-core/src/client/platform';
import * as queries from 'loot-core/src/client/queries';
Expand Down Expand Up @@ -206,7 +207,7 @@ function SyncButton({ style, isMobile = false }: SyncButtonProps) {
return (
<Button
variant="bare"
aria-label="Sync"
aria-label={t('Sync')}
className={css({
...(isMobile
? {
Expand Down Expand Up @@ -290,7 +291,7 @@ export function Titlebar({ style }: TitlebarProps) {
>
{(floatingSidebar || sidebar.alwaysFloats) && (
<Button
aria-label="Sidebar menu"
aria-label={t('Sidebar menu')}
variant="bare"
style={{ marginRight: 8 }}
onHoverStart={e => {
Expand Down Expand Up @@ -322,7 +323,7 @@ export function Titlebar({ style }: TitlebarProps) {
height={10}
style={{ marginRight: 5, color: 'currentColor' }}
/>{' '}
Back
{t('Back')}
</Button>
) : null
}
Expand Down
12 changes: 8 additions & 4 deletions packages/desktop-client/src/components/UpdateNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';

import { type State } from 'loot-core/src/client/state-types';
Expand All @@ -13,6 +14,7 @@ import { Text } from './common/Text';
import { View } from './common/View';

export function UpdateNotification() {
const { t } = useTranslation();
const updateInfo = useSelector((state: State) => state.app.updateInfo);
const showUpdateNotification = useSelector(
(state: State) => state.app.showUpdateNotification,
Expand Down Expand Up @@ -40,7 +42,9 @@ export function UpdateNotification() {
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<View style={{ marginRight: 10, fontWeight: 700 }}>
<Text>App updated to {updateInfo.version}</Text>
<Text>
{t('App updated to {{version}}', { version: updateInfo.version })}
</Text>
</View>
<View style={{ flex: 1 }} />
<View style={{ marginTop: -1 }}>
Expand All @@ -53,7 +57,7 @@ export function UpdateNotification() {
textDecoration: 'underline',
}}
>
Restart
{t('Restart')}
</Link>{' '}
(
<Link
Expand All @@ -68,12 +72,12 @@ export function UpdateNotification() {
)
}
>
notes
{t('notes')}
</Link>
)
<Button
variant="bare"
aria-label="Close"
aria-label={t('Close')}
style={{ display: 'inline', padding: '1px 7px 2px 7px' }}
onPress={() => {
// Set a flag to never show an update notification again for this session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function SidebarGroup({
{ name: 'rename', text: t('Rename') },
!group.is_income && {
name: 'toggle-visibility',
text: group.hidden ? t('Show') : t('Hide'),
text: group.hidden ? 'Show' : 'Hide',
},
onDelete && { name: 'delete', text: t('Delete') },
...(isGoalTemplatesEnabled
Expand Down
7 changes: 4 additions & 3 deletions packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useHotkeysContext } from 'react-hotkeys-hook';

import { css } from '@emotion/css';
import { AutoTextSize } from 'auto-text-size';
import { t } from 'i18next';

import { useModalState } from '../../hooks/useModalState';
import { AnimatedLoading } from '../../icons/AnimatedLoading';
Expand Down Expand Up @@ -100,7 +101,7 @@ export const Modal = ({
<ReactAriaModal>
{modalProps => (
<Dialog
aria-label="Modal dialog"
aria-label={t('Modal dialog')}
className={css(styles.lightScrollbar)}
style={{
outline: 'none', // remove focus outline
Expand Down Expand Up @@ -329,7 +330,7 @@ export function ModalHeader({
>
{showLogo && (
<SvgLogo
aria-label="Modal logo"
aria-label={t('Modal logo')}
width={30}
height={30}
style={{ justifyContent: 'center', alignSelf: 'center' }}
Expand Down Expand Up @@ -472,7 +473,7 @@ export function ModalCloseButton({ onPress, style }: ModalCloseButtonProps) {
variant="bare"
onPress={onPress}
style={{ padding: '10px 10px' }}
aria-label="Close"
aria-label={t('Close')}
>
<SvgDelete width={10} style={style} />
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { type ComponentPropsWithoutRef } from 'react';

import { t } from 'i18next';

import { useNavigate } from '../../hooks/useNavigate';
import { SvgCheveronLeft } from '../../icons/v1';
import { styles } from '../../style';
Expand Down Expand Up @@ -35,7 +37,7 @@ export function MobileBackButton({
marginRight: 5,
}}
>
Back
{t('Back')}
</Text>
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { t } from 'i18next';

import { replaceModal, syncAndDownload } from 'loot-core/src/client/actions';
import * as queries from 'loot-core/src/client/queries';

Expand Down Expand Up @@ -137,9 +139,9 @@ function EmptyMessage() {
return (
<View style={{ flex: 1, padding: 30 }}>
<Text style={styles.text}>
For Actual to be useful, you need to add an account. You can link an
account to automatically download transactions, or manage it locally
yourself.
{t(
'For Actual to be useful, you need to add an account. You can link an account to automatically download transactions, or manage it locally yourself.',
)}
</Text>
</View>
);
Expand All @@ -164,11 +166,11 @@ function AccountList({
<Page
header={
<MobilePageHeader
title="Accounts"
title={t('Accounts')}
rightContent={
<Button
variant="bare"
aria-label="Add account"
aria-label={t('Add account')}
style={{ margin: 10 }}
onPress={onAddAccount}
>
Expand Down
Loading

0 comments on commit 1f5ca75

Please sign in to comment.