Update translated text and use Goose to update small things in wallet

merge-requests/3333/head
danidfra 2025-04-01 17:45:07 -03:00
rodzic 0957c5b92e
commit 21fc7c8ed9
13 zmienionych plików z 114 dodań i 66 usunięć

Wyświetl plik

@ -100,7 +100,7 @@ const messages = defineMessages({
profileExternal: { id: 'account.profile_external', defaultMessage: 'View profile on {domain}' }, profileExternal: { id: 'account.profile_external', defaultMessage: 'View profile on {domain}' },
header: { id: 'account.header.alt', defaultMessage: 'Profile header' }, header: { id: 'account.header.alt', defaultMessage: 'Profile header' },
subscribeFeed: { id: 'account.rss_feed', defaultMessage: 'Subscribe to RSS feed' }, subscribeFeed: { id: 'account.rss_feed', defaultMessage: 'Subscribe to RSS feed' },
method: { id: 'payment_method.send_to', defaultMessage: 'Send {method} to {target}' }, method: { id: 'payment_method.send_to', defaultMessage: 'Send sats via {method} to {target}' },
}); });
interface IHeader { interface IHeader {

Wyświetl plik

@ -89,7 +89,7 @@ const ZapsModal: React.FC<IZapsModal> = ({ onClose, statusId }) => {
return ( return (
<div key={index}> <div key={index}>
<Text weight='bold'> <Text weight='bold'>
{account.type === 'zap' ? shortNumberFormat(account.amount / 1000) : shortNumberFormat(account.amount)} {account.type === 'lightning' ? shortNumberFormat(account.amount / 1000) : shortNumberFormat(account.amount)}
</Text> </Text>
<AccountContainer id={account.id} note={account.comment} emoji='⚡' /> <AccountContainer id={account.id} note={account.comment} emoji='⚡' />
</div> </div>

Wyświetl plik

@ -47,54 +47,91 @@ const CreateWallet = () => {
} }
return ( return (
<Stack className='rounded-lg border p-6' space={4}> <Stack
className='rounded-lg border border-gray-200 p-8
dark:border-gray-700'
space={4}
>
<Stack space={3} justifyContent='center' alignItems='center'> <Stack space={3} justifyContent='center' alignItems='center'>
{!formActive {!formActive ? (
? <>
( <div className='mb-2 flex size-16 items-center justify-center rounded-full bg-primary-100 dark:bg-primary-800'>
<> <Icon
<Text theme='default' size='2xl'> className='size-8 text-primary-500 dark:text-primary-400'
{intl.formatMessage(messages.title)} src={plusIcon}
/>
</div>
<Text
theme='default'
size='2xl'
weight='bold'
align='center'
className='mb-1 text-gray-900 dark:text-gray-100'
>
{intl.formatMessage(messages.title)}
</Text>
<HStack space={3} className='mt-2'>
<Text
theme='default'
size='lg'
align='center'
className='text-gray-800 dark:text-gray-200'
>
{intl.formatMessage(messages.question)}
</Text> </Text>
<HStack space={2}> <Button
<Text theme='default' size='lg'> theme='primary'
{intl.formatMessage(messages.question)} text={intl.formatMessage(messages.button)}
</Text> onClick={() => setFormActive(!formActive)}
<Button icon={plusIcon} theme='primary' text={intl.formatMessage(messages.button)} onClick={() => setFormActive(!formActive)} /> className='px-6 font-medium'
</HStack> />
</> </HStack>
) </>
: ) : (
( <Stack space={5} className='w-full'>
<Stack space={4} className='w-full'> <Form onSubmit={handleSubmit}>
<Form onSubmit={handleSubmit}> <Stack className='rounded-lg p-4'>
<Stack> <HStack alignItems='center' space={2}>
<HStack alignItems='center' space={1}> <Text
<Text> size='lg'
{intl.formatMessage(messages.mints)} weight='medium'
</Text> className='text-gray-900 dark:text-gray-100'
<Tooltip text={'Mint: A kind of digital bank that issues tokens backed by Bitcoin, like “Bitcoin gift cards” with built-in privacy.'}> >
<div> {intl.formatMessage(messages.mints)}
<Icon src={helpIcon} /> </Text>
</div> <Tooltip text={'Mint: A kind of digital bank that issues tokens backed by Bitcoin, like \'Bitcoin gift cards\' with built-in privacy.'}>
</Tooltip> <div className='text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'>
</HStack> <Icon src={helpIcon} />
</div>
</Tooltip>
</HStack>
<div>
<MintEditor items={mints} setItems={setMints} /> <MintEditor items={mints} setItems={setMints} />
</Stack> </div>
</Stack>
<FormActions> <FormActions>
<Button to='/wallet' onClick={()=> setFormActive(false)} theme='tertiary'> <Button
<FormattedMessage id='common.cancel' defaultMessage='Cancel' /> to='/wallet'
</Button> onClick={() => setFormActive(false)}
theme='tertiary'
className='px-6 text-gray-700 transition-colors hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800'
>
<FormattedMessage id='common.cancel' defaultMessage='Cancel' />
</Button>
<Button theme={isLoading ? 'secondary' : 'primary'} type='submit' disabled={isLoading}> <Button
<FormattedMessage id='common.save' defaultMessage='Save' /> theme={isLoading ? 'secondary' : 'primary'}
</Button> type='submit'
</FormActions> disabled={isLoading}
</Form> className='px-6 font-medium'
</Stack> >
) <FormattedMessage id='common.save' defaultMessage='Save' />
} </Button>
</FormActions>
</Form>
</Stack>
)}
</Stack> </Stack>
</Stack> </Stack>
); );

Wyświetl plik

@ -26,7 +26,7 @@ const messages = defineMessages({
}); });
const paymentMethods = { const paymentMethods = {
zap: 'zap', lightning: 'lightning',
cashu: 'cashu', cashu: 'cashu',
}; };
@ -45,13 +45,15 @@ const Wallet = () => {
return ( return (
<> <>
{isLoading ? {isLoading ?
<Stack className='h-screen justify-center'> <Stack className='h-screen items-center justify-center'>
<Spinner size={40} withText={false} /> <div className='rounded-lg border border-gray-200 p-10 dark:border-gray-700'>
<Spinner size={50} withText={false} />
</div>
</Stack> </Stack>
: :
( (
<Column label={intl.formatMessage(messages.wallet)} transparent withHeader={false} slim> <Column label={intl.formatMessage(messages.wallet)} transparent withHeader={false} slim>
<Card className='space-y-4'> <Card className='space-y-4 overflow-hidden'>
<CardHeader> <CardHeader>
<CardTitle title={intl.formatMessage(messages.wallet)} /> <CardTitle title={intl.formatMessage(messages.wallet)} />
</CardHeader> </CardHeader>
@ -59,7 +61,11 @@ const Wallet = () => {
{walletData ? ( {walletData ? (
<> <>
<CardBody> <CardBody>
<Stack className='rounded-lg border p-6 black:border-gray-500 dark:border-gray-500' alignItems='center' space={4}> <Stack
className='rounded-lg border border-gray-200 p-8 dark:border-gray-700'
alignItems='center'
space={4}
>
<Balance /> <Balance />
</Stack> </Stack>
</CardBody> </CardBody>
@ -70,8 +76,13 @@ const Wallet = () => {
<CardBody> <CardBody>
<Transactions limit={4} /> <Transactions limit={4} />
{hasTransactions && <div className='flex w-full justify-center'> {hasTransactions && <div className='mt-4 flex w-full justify-center'>
<Button icon={moreIcon} theme='primary' to='/wallet/transactions'> <Button
icon={moreIcon}
theme='primary'
to='/wallet/transactions'
className='px-6 font-medium'
>
{intl.formatMessage(messages.more)} {intl.formatMessage(messages.more)}
</Button> </Button>
</div>} </div>}
@ -91,7 +102,7 @@ const Wallet = () => {
items={paymentMethods} items={paymentMethods}
defaultValue={method} defaultValue={method}
onChange={(event: React.ChangeEvent<HTMLSelectElement>) => { onChange={(event: React.ChangeEvent<HTMLSelectElement>) => {
changeMethod((event.target.value as 'cashu' | 'zap')); changeMethod((event.target.value as 'cashu' | 'lightning'));
}} }}
/> />
</ListItem> </ListItem>

Wyświetl plik

@ -128,8 +128,8 @@ const PayRequestForm = ({ account, status, onClose }: IPayRequestForm) => {
<Text weight='semibold'> <Text weight='semibold'>
<FormattedMessage <FormattedMessage
id='payment_method.send_to' id='payment_method.send_to'
defaultMessage='Send {method} to {target}' defaultMessage='Send sats via {method} to {target}'
values={{ target: emojifyText(account.display_name, account.emojis), method: amount > 1 ? `${paymentMethod}s` : paymentMethod }} values={{ target: emojifyText(account.display_name, account.emojis), method: paymentMethod }}
/> />
</Text> </Text>
<Avatar src={account.avatar} size={50} /> <Avatar src={account.avatar} size={50} />

Wyświetl plik

@ -4,14 +4,14 @@ import { create } from 'zustand';
enableMapSet(); enableMapSet();
interface IPaymentMethod { interface IPaymentMethod {
method: 'cashu' | 'zap'; method: 'cashu' | 'lightning';
changeMethod: (method: 'cashu' | 'zap') => void; changeMethod: (method: 'cashu' | 'lightning') => void;
} }
export const usePaymentMethod = create<IPaymentMethod>( export const usePaymentMethod = create<IPaymentMethod>(
(set) => ({ (set) => ({
method: localStorage.getItem('soapbox:payment_method') as 'cashu' | 'zap' || 'cashu', method: localStorage.getItem('soapbox:payment_method') as 'cashu' | 'lightning' || 'cashu',
changeMethod: (method: 'cashu' | 'zap') => { changeMethod: (method: 'cashu' | 'lightning') => {
localStorage.setItem('soapbox:payment_method', method); localStorage.setItem('soapbox:payment_method', method);
set({ method }); set({ method });
}, },

Wyświetl plik

@ -1523,5 +1523,5 @@
"payment_method.comment_input.placeholder": "تعليق إختياري", "payment_method.comment_input.placeholder": "تعليق إختياري",
"zap.open_wallet": "فتح المحفظة", "zap.open_wallet": "فتح المحفظة",
"zap.send_to": "أرسل zaps إلى {target}", "zap.send_to": "أرسل zaps إلى {target}",
"payment_method.send_to": "أرسل {method} إلى {target}" "payment_method.send_to": "أرسل sats عبر {method} إلى {target}"
} }

Wyświetl plik

@ -1297,7 +1297,7 @@
"patron.title": "Funding Goal", "patron.title": "Funding Goal",
"payment_method.button.text.raw": "Zap {amount} sats", "payment_method.button.text.raw": "Zap {amount} sats",
"payment_method.comment_input.placeholder": "Optional comment", "payment_method.comment_input.placeholder": "Optional comment",
"payment_method.send_to": "Send {method} to {target}", "payment_method.send_to": "Send sats via {method} to {target}",
"payment_method.split_message.deducted": "{amountDeducted} sats will deducted*", "payment_method.split_message.deducted": "{amountDeducted} sats will deducted*",
"pinned_accounts.title": "{name}s choices", "pinned_accounts.title": "{name}s choices",
"pinned_statuses.none": "No pins to show.", "pinned_statuses.none": "No pins to show.",

Wyświetl plik

@ -1630,5 +1630,5 @@
"payment_method.comment_input.placeholder": "Comentario opcional", "payment_method.comment_input.placeholder": "Comentario opcional",
"zap.open_wallet": "Abrir Wallet", "zap.open_wallet": "Abrir Wallet",
"zap.send_to": "Enviar zaps a {target}", "zap.send_to": "Enviar zaps a {target}",
"payment_method.send_to": "Enviar {method} a {target}" "payment_method.send_to": "Enviar sats a través de {method} a {target}"
} }

Wyświetl plik

@ -1686,7 +1686,7 @@
"zap.next": "Ar Aghaidh", "zap.next": "Ar Aghaidh",
"zap.open_wallet": "Oscail Sparán", "zap.open_wallet": "Oscail Sparán",
"zap.send_to": "Seol zaps chuig {target}", "zap.send_to": "Seol zaps chuig {target}",
"payment_method.send_to": "Seol {method} chuig {target}", "payment_method.send_to": "Seol sats trí {method} chuig {target}",
"payment_method.split_message.deducted": "Asbhainfear {amountDeducted} sats*", "payment_method.split_message.deducted": "Asbhainfear {amountDeducted} sats*",
"zap.split_message.receiver": "Gheobhaidh {receiver} {amountReceiver} sats*", "zap.split_message.receiver": "Gheobhaidh {receiver} {amountReceiver} sats*",
"zap_split.question": "Cén fáth a bhfuil mé ag íoc seo?", "zap_split.question": "Cén fáth a bhfuil mé ag íoc seo?",

Wyświetl plik

@ -1639,7 +1639,7 @@
"payment_method.comment_input.placeholder": "Comentário opcional", "payment_method.comment_input.placeholder": "Comentário opcional",
"zap.open_wallet": "Abrir Carteira", "zap.open_wallet": "Abrir Carteira",
"zap.send_to": "Enviar zaps para {target}", "zap.send_to": "Enviar zaps para {target}",
"payment_method.send_to": "Enviar {method} para {target}", "payment_method.send_to": "Enviar sats via {method} para {target}",
"payment_method.split_message.deducted": "{amountDeducted} sats serão deduzidos*", "payment_method.split_message.deducted": "{amountDeducted} sats serão deduzidos*",
"zap.split_message.receiver": "{receiver} receberá {amountReceiver} sats*", "zap.split_message.receiver": "{receiver} receberá {amountReceiver} sats*",
"zap_split.question": "Por que estou pagando isso?", "zap_split.question": "Por que estou pagando isso?",

Wyświetl plik

@ -1618,6 +1618,6 @@
"who_to_follow.title": "Quem Seguir", "who_to_follow.title": "Quem Seguir",
"payment_method.comment_input.placeholder": "Comentário opcional", "payment_method.comment_input.placeholder": "Comentário opcional",
"zap.open_wallet": "Abrir Carteira", "zap.open_wallet": "Abrir Carteira",
"payment_method.send_to": "Enviar {method} para {target}", "payment_method.send_to": "Enviar sats através de {method} para {target}",
"zap.send_to": "Enviar zaps para {target}" "zap.send_to": "Enviar zaps para {target}"
} }

Wyświetl plik

@ -1623,6 +1623,6 @@
"payment_method.button.text.raw": "打闪 {amount} 聪", "payment_method.button.text.raw": "打闪 {amount} 聪",
"payment_method.comment_input.placeholder": "可选评论", "payment_method.comment_input.placeholder": "可选评论",
"zap.open_wallet": "打开钱包", "zap.open_wallet": "打开钱包",
"payment_method.send_to": "发送打闪给 {target}", "payment_method.send_to": "通过 {method} 发送 sats 到 {target}",
"zap.send_to": "发送打闪给 {target}" "zap.send_to": "发送打闪给 {target}"
} }