From 38a1e9d1b8315850272de31d8a55033f1e289c8a Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Sat, 22 Nov 2025 14:46:35 +0100 Subject: [PATCH] Add localized payment information labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces hardcoded Croatian text in ViewLocationCard with i18n translations. Adds payment information labels (amount, recipient, IBAN, etc.) to both Croatian and English language files for proper internationalization support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/ui/ViewLocationCard.tsx | 30 +++++++++++++++++++++++++++++- messages/en.json | 12 +++++++++++- messages/hr.json | 12 +++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/app/ui/ViewLocationCard.tsx b/app/ui/ViewLocationCard.tsx index 8bc6c18..d69763a 100644 --- a/app/ui/ViewLocationCard.tsx +++ b/app/ui/ViewLocationCard.tsx @@ -7,6 +7,7 @@ import { formatCurrency } from "../lib/formatStrings"; import { useTranslations } from "next-intl"; import { ViewBillBadge } from "./ViewBillBadge"; import { Pdf417Barcode } from "./Pdf417Barcode"; +import { PaymentParams } from "hub-3a-payment-encoder"; export interface ViewLocationCardProps { location: BillingLocation @@ -19,6 +20,21 @@ export const ViewLocationCard:FC = ({location: { _id, nam // sum all the billAmounts (only for bills billed to tenant) const monthlyExpense = bills.reduce((acc, bill) => (bill.paid && (bill.billedTo ?? BilledTo.Tenant) === BilledTo.Tenant) ? acc + (bill.payedAmount ?? 0) : acc, 0); + const paymentParams:PaymentParams = { + Iznos:"123,66", // NOTE: use comma, not period! + ImePlatitelja:"Ivan Horvat", + AdresaPlatitelja:"Ilica 23", + SjedistePlatitelja:"10000 Zagreb", + Primatelj:"Nikola Derežić", + AdresaPrimatelja:"Divka Budaka 17", + SjedistePrimatelja:"Zagreb", + IBAN:"HR8924020061100679445", + ModelPlacanja: "HR00", // MUST contain "HR" prefix! + PozivNaBroj:"2025-05", + SifraNamjene:"", + OpisPlacanja:"Režije-Budakova-05", + }; + return(
@@ -35,7 +51,19 @@ export const ViewLocationCard:FC = ({location: { _id, nam

: null } - +

{t("payment-info-header")}

+
    +
  • {t("payment-amount-label")}
    {paymentParams.Iznos}
  • +
  • {t("payment-recipient-label")}
    {paymentParams.Primatelj}
  • +
  • {t("payment-recipient-address-label")}
    {paymentParams.AdresaPrimatelja}
  • +
  • {t("payment-recipient-city-label")}
    {paymentParams.SjedistePrimatelja}
  • +
  • {t("payment-iban-label")}
    {paymentParams.IBAN}
  • +
  • {t("payment-model-label")}
    {paymentParams.ModelPlacanja}
  • +
  • {t("payment-reference-label")}
    {paymentParams.PozivNaBroj}
  • +
  • {t("payment-purpose-code-label")}
    {paymentParams.SifraNamjene}
  • +
  • {t("payment-description-label")}
    {paymentParams.OpisPlacanja}
  • +
+
); }; \ No newline at end of file diff --git a/messages/en.json b/messages/en.json index 379ca49..ad8c3d9 100644 --- a/messages/en.json +++ b/messages/en.json @@ -57,7 +57,17 @@ "payed-total-label": "Payed total:", "link-copy-message": "Link copied to clipboard", "monthly-statement-legend": "Monthly statement", - "seen-by-tenant-label": "Seen by tenant" + "seen-by-tenant-label": "Seen by tenant", + "payment-info-header": "You can pay the utility bills for this month using the following information:", + "payment-amount-label": "Amount:", + "payment-recipient-label": "Recipient:", + "payment-recipient-address-label": "Recipient address:", + "payment-recipient-city-label": "Recipient city:", + "payment-iban-label": "IBAN:", + "payment-model-label": "Payment model:", + "payment-reference-label": "Reference number:", + "payment-purpose-code-label": "Purpose code:", + "payment-description-label": "Payment description:" }, "month-card": { "payed-total-label": "Total monthly expenditure:", diff --git a/messages/hr.json b/messages/hr.json index 0e15f87..fdfc9ae 100644 --- a/messages/hr.json +++ b/messages/hr.json @@ -57,7 +57,17 @@ "payed-total-label": "Ukupno plaćeno:", "link-copy-message": "Link kopiran na clipboard", "monthly-statement-legend": "Obračun", - "seen-by-tenant-label": "Viđeno od strane podstanara" + "seen-by-tenant-label": "Viđeno od strane podstanara", + "payment-info-header": "Režije za ovaj mjesec možete uplatiti koristeći slijedeće podatke:", + "payment-amount-label": "Iznos:", + "payment-recipient-label": "Primatelj:", + "payment-recipient-address-label": "Adresa primatelja:", + "payment-recipient-city-label": "Sjedište primatelja:", + "payment-iban-label": "IBAN:", + "payment-model-label": "Model plaćanja:", + "payment-reference-label": "Poziv na broj:", + "payment-purpose-code-label": "Šifra namjene:", + "payment-description-label": "Opis plaćanja:" }, "month-card": { "payed-total-label": "Ukupni mjesečni trošak:",