From f0c7be9b012964f144735953ad24e7ed8ca539d0 Mon Sep 17 00:00:00 2001 From: danidfra Date: Tue, 18 Mar 2025 11:31:11 -0300 Subject: [PATCH] Update translated text in zap-modal --- src/features/zap/components/pay-request-form.tsx | 9 +++++---- src/locales/en.json | 4 ++-- src/locales/es.json | 2 +- src/locales/ga.json | 4 ++-- src/locales/pt-BR.json | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/features/zap/components/pay-request-form.tsx b/src/features/zap/components/pay-request-form.tsx index 0b508e8a6..e2d4d6fc6 100644 --- a/src/features/zap/components/pay-request-form.tsx +++ b/src/features/zap/components/pay-request-form.tsx @@ -24,6 +24,7 @@ import Text from 'soapbox/components/ui/text.tsx'; import { usePaymentMethod } from 'soapbox/features/zap/usePaymentMethod.ts'; import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts'; import { emojifyText } from 'soapbox/utils/emojify.tsx'; +import { capitalize } from 'soapbox/utils/strings.ts'; import PaymentButton from './zap-button/payment-button.tsx'; @@ -46,8 +47,8 @@ interface IPayRequestForm { const closeIcon = xIcon; const messages = defineMessages({ - zap_button_rounded: { id: 'zap.button.text.rounded', defaultMessage: 'Zap {amount}K sats' }, - zap_button: { id: 'payment_method.button.text.raw', defaultMessage: 'Zap {amount} sats' }, + zap_button_rounded: { id: 'zap.button.text.rounded', defaultMessage: '{method} {amount}K sats' }, + zap_button: { id: 'payment_method.button.text.raw', defaultMessage: '{method} {amount} sats' }, zap_commentPlaceholder: { id: 'payment_method.comment_input.placeholder', defaultMessage: 'Optional comment' }, }); @@ -106,9 +107,9 @@ const PayRequestForm = ({ account, status, onClose }: IPayRequestForm) => { const renderPaymentButtonText = () => { if (amount >= 1000) { - return intl.formatMessage(messages.zap_button_rounded, { amount: Math.round((amount / 1000) * 10) / 10 }); + return intl.formatMessage(messages.zap_button_rounded, { amount: Math.round((amount / 1000) * 10) / 10, method: isCashu ? 'Nutzap' : capitalize(paymentMethod) }); } - return intl.formatMessage(messages.zap_button, { amount: amount }); + return intl.formatMessage(messages.zap_button, { amount: amount, method: isCashu ? 'Nutzap' : capitalize(paymentMethod) }); }; useEffect(() => { diff --git a/src/locales/en.json b/src/locales/en.json index 416621125..18e747361 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1727,8 +1727,8 @@ "video.play": "Play", "video.unmute": "Unmute sound", "who_to_follow.title": "People To Follow", - "payment_method.button.text.raw": "Zap {amount} sats", - "zap.button.text.rounded": "Zap {amount}K sats", + "payment_method.button.text.raw": "{method} {amount} sats", + "zap.button.text.rounded": "{method} {amount}K sats", "payment_method.comment_input.placeholder": "Optional comment", "zap.finish": "Finish", "zap.next": "Next", diff --git a/src/locales/es.json b/src/locales/es.json index 6df0403ed..bac461ddb 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1626,7 +1626,7 @@ "video.play": "Reproducir", "video.unmute": "Dejar de silenciar sonido", "who_to_follow.title": "Personas a seguir", - "payment_method.button.text.raw": "Zap {amount} sats", + "payment_method.button.text.raw": "{method} {amount} sats", "payment_method.comment_input.placeholder": "Comentario opcional", "zap.open_wallet": "Abrir Wallet", "zap.send_to": "Enviar zaps a {target}", diff --git a/src/locales/ga.json b/src/locales/ga.json index a7de77b12..d8d70e1e6 100644 --- a/src/locales/ga.json +++ b/src/locales/ga.json @@ -1679,8 +1679,8 @@ "video.play": "Seinn", "video.unmute": "Fuaim gan iomrá", "who_to_follow.title": "Daoine le Leanúint", - "payment_method.button.text.raw": "Suíonn Zap {amount}", - "zap.button.text.rounded": "Zap {amount}K shuíonn", + "payment_method.button.text.raw": "Suíonn {method} {amount}", + "zap.button.text.rounded": "{method} {amount}K shuíonn", "payment_method.comment_input.placeholder": "Nóta roghnach", "zap.finish": "Críochnaigh", "zap.next": "Ar Aghaidh", diff --git a/src/locales/pt-BR.json b/src/locales/pt-BR.json index 1657c2da3..298539676 100644 --- a/src/locales/pt-BR.json +++ b/src/locales/pt-BR.json @@ -1635,7 +1635,7 @@ "video.play": "Reproduzir", "video.unmute": "Reativar som", "who_to_follow.title": "Quem seguir", - "payment_method.button.text.raw": "Zap {amount} sats", + "payment_method.button.text.raw": "{method} {amount} sats", "payment_method.comment_input.placeholder": "Comentário opcional", "zap.open_wallet": "Abrir Carteira", "zap.send_to": "Enviar zaps para {target}",