Skip to content

Commit

Permalink
improve translation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fidd committed Dec 26, 2024
1 parent 110ed31 commit 8d411a3
Show file tree
Hide file tree
Showing 42 changed files with 536 additions and 390 deletions.
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function AppInner() {
id: 'login-expired',
title: t('Login expired'),
sticky: true,
message: t('Login expired, please login again.'),
message: t('Login expired, please log in again.'),
button: {
title: t('Go to login'),
action: signOut,
Expand Down
16 changes: 6 additions & 10 deletions packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ export function LoggedInUser({
userData?.displayName &&
!hasSyncedPrefs && (
<small>
<Trans>
(logged in as: <span>{userData?.displayName}</span>)
</Trans>
(<Trans>logged in as:</Trans> <span>{userData?.displayName}</span>)
</small>
)}
{!loading &&
Expand All @@ -216,13 +214,11 @@ export function LoggedInUser({
userData?.displayName &&
hasSyncedPrefs && (
<small>
<Trans>
(logged in as:{' '}
<span>
<PrivacyFilter>{userData?.displayName}</PrivacyFilter>
</span>
)
</Trans>
(<Trans>logged in as:</Trans>{' '}
<span>
<PrivacyFilter>{userData?.displayName}</PrivacyFilter>
</span>
)
</small>
)}

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export function Modals() {
/>
)}
inputPlaceholder={t('Category name')}
buttonText="Add"
buttonText={t('Add')}
onValidate={options.onValidate}
onSubmit={options.onSubmit}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function useErrorMessage() {

return (
<Trans>
An internal error occurred. Try to login again, or get{' '}
An internal error occurred. Try to log in again, or get{' '}
<Link variant="external" to="https://actualbudget.org/contact/">
in touch
</Link>{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ function UserAccessContent({
>
<Text>
<Trans>
Determine which users can view and manage your budgets..{' '}
<Link
variant="external"
to="https://actualbudget.org/docs/budgeting/users-access/"
linkColor="muted"
>
Learn more
</Link>
</Trans>
Determine which users can view and manage your budgets
</Trans>{' '}
<Link
variant="external"
to="https://actualbudget.org/docs/budgeting/users-access/"
linkColor="muted"
>
<Trans>Learn more</Trans>
</Link>
</Text>
</View>
<View style={{ flex: 1 }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function useGetUserDirectoryErrors() {
case 'unauthorized':
return t('You are not logged in.');
case 'token-expired':
return t('Login expired, please login again.');
return t('Login expired, please log in again.');
case 'user-cant-be-empty':
return t(
'Please enter a value for the username; the field cannot be empty.',
Expand Down Expand Up @@ -232,15 +232,15 @@ function UserDirectoryContent({
<Text>
<Trans>
Manage and view users who can create new budgets or be invited
to access existing ones.{' '}
<Link
variant="external"
to="https://actualbudget.org/docs/budgeting/users/"
linkColor="muted"
>
Learn more
</Link>
</Trans>
to access existing ones.
</Trans>{' '}
<Link
variant="external"
to="https://actualbudget.org/docs/budgeting/users/"
linkColor="muted"
>
<Trans>Learn more</Trans>
</Link>
</Text>
</View>
<View style={{ flex: 1 }} />
Expand Down Expand Up @@ -282,7 +282,7 @@ function UserDirectoryContent({
<Stack direction="row" align="center" justify="flex-end" spacing={2}>
{selectedInst.items.size > 0 && (
<Button onPress={onDeleteSelected}>
<Trans> Delete {selectedInst.items.size} users </Trans>
<Trans>Delete {{ count: selectedInst.items.size }} users</Trans>
</Button>
)}
<Button variant="primary" onPress={onAddUser}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ export function PayeeAutocomplete({
setFocusTransferPayees(!focusTransferPayees);
}}
>
<Trans>Make Transfer</Trans>
<Trans>Make transfer</Trans>
</Button>
)}
{showManagePayees && (
<Button type="menu" onClick={() => onManagePayees()}>
<Trans>Manage Payees</Trans>
<Trans>Manage payees</Trans>
</Button>
)}
</AutocompleteFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function IncomeHeader({
}}
>
<Button onPress={onShowNewGroup} style={{ fontSize: 12, margin: 10 }}>
<Trans>Add Group</Trans>
<Trans>Add group</Trans>
</Button>
</View>
<RenderMonths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function ChangePassword() {
case 'network-failure':
return 'Unable to contact the server';
default:
return 'Internal server error';
return 'Internal error';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function OpenIdForm({
addNotification({
type: 'error',
id: 'error',
title: t('Error getting openid config'),
title: t('Error getting OpenID config'),
sticky: true,
message: config.error,
});
Expand Down
85 changes: 52 additions & 33 deletions packages/desktop-client/src/components/modals/CloseAccountModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import React, { type FormEvent, useState, type CSSProperties } from 'react';
import { Form } from 'react-aria-components';
import { useTranslation } from 'react-i18next'; // Import useTranslation
import { useTranslation, Trans } from 'react-i18next';
import { useDispatch } from 'react-redux';

import {
Expand Down Expand Up @@ -119,17 +119,26 @@ export function CloseAccountModal({
/>
<View>
<Paragraph>
{t('Are you sure you want to close ')}
<strong>{account.name}</strong>?{' '}
<Trans>
Are you sure you want to close{' '}
<strong>
<Trans>{{ accountName: account.name }}</Trans>
</strong>
?{' '}
</Trans>
{canDelete ? (
<span>
This account has no transactions so it will be permanently
deleted.
<Trans>
This account has no transactions so it will be permanently
deleted.
</Trans>
</span>
) : (
<span>
This account has transactions so we can’t permanently delete
it.
<Trans>
This account has transactions so we can’t permanently delete
it.
</Trans>
</span>
)}
</Paragraph>
Expand All @@ -142,10 +151,14 @@ export function CloseAccountModal({
{balance !== 0 && (
<View>
<Paragraph>
This account has a balance of{' '}
<strong>{integerToCurrency(balance)}</strong>. To close this
account, select a different account to transfer this balance
to:
<Trans>
This account has a balance of{' '}
<strong>
<Trans>{{ balance: integerToCurrency(balance) }}</Trans>
</strong>
. To close this account, select a different account to
transfer this balance to:
</Trans>
</Paragraph>

<View style={{ marginBottom: 15 }}>
Expand Down Expand Up @@ -176,16 +189,18 @@ export function CloseAccountModal({

{transferError && (
<FormError style={{ marginBottom: 15 }}>
{t('Transfer is required')}
<Trans>Transfer is required</Trans>
</FormError>
)}

{needsCategory(account, transferAccountId, accounts) && (
<View style={{ marginBottom: 15 }}>
<Paragraph>
Since you are transferring the balance from an on budget
account to an off budget account, this transaction must
be categorized. Select a category:
<Trans>
Since you are transferring the balance from an on
budget account to an off budget account, this
transaction must be categorized. Select a category:
</Trans>
</Paragraph>

<CategoryAutocomplete
Expand Down Expand Up @@ -213,7 +228,9 @@ export function CloseAccountModal({
/>

{categoryError && (
<FormError>{t('Category is required')}</FormError>
<FormError>
<Trans>Category is required</Trans>
</FormError>
)}
</View>
)}
Expand All @@ -223,22 +240,24 @@ export function CloseAccountModal({
{!canDelete && (
<View style={{ marginBottom: 15 }}>
<Text style={{ fontSize: 12 }}>
{t('You can also')}{' '}
<Link
variant="text"
onClick={() => {
setLoading(true);
<Trans>
You can also{' '}
<Link
variant="text"
onClick={() => {
setLoading(true);

dispatch(forceCloseAccount(account.id));
close();
}}
style={{ color: theme.errorText }}
>
{t('force close')}
</Link>{' '}
the account which will delete it and all its transactions
permanently. Doing so may change your budget unexpectedly
since money in it may vanish.
dispatch(forceCloseAccount(account.id));
close();
}}
style={{ color: theme.errorText }}
>
force close
</Link>{' '}
the account which will delete it and all its transactions
permanently. Doing so may change your budget unexpectedly
since money in it may vanish.
</Trans>
</Text>
</View>
)}
Expand All @@ -256,7 +275,7 @@ export function CloseAccountModal({
}}
onPress={close}
>
{t('Cancel')}
<Trans>Cancel</Trans>
</Button>
<Button
type="submit"
Expand All @@ -265,7 +284,7 @@ export function CloseAccountModal({
height: isNarrowWidth ? styles.mobileMinHeight : undefined,
}}
>
{t('Close Account')}
<Trans>Close Account</Trans>
</Button>
</View>
</Form>
Expand Down
Loading

0 comments on commit 8d411a3

Please sign in to comment.