From 834444d5c716a5a570e593371b27c2aeed2289f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Sun, 14 Sep 2025 22:16:00 +0200 Subject: [PATCH] fix: resolve next-intl translation parameter error in print footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix IntlError: FORMATTING_ERROR for print footer translation: - Pass date parameter correctly to t("print-footer") in server component - Remove manual string replacement in client component - Use proper next-intl parameter syntax: t("key", { param: value }) Error was caused by next-intl expecting translation parameters to be passed at the translation function call level, not through manual string replacement afterward. Print preview now loads without FORMATTING_ERROR and displays localized footer text correctly in both English and Croatian. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/[locale]/print/[year]/[month]/page.tsx | 2 +- app/ui/PrintPreview.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/[locale]/print/[year]/[month]/page.tsx b/app/[locale]/print/[year]/[month]/page.tsx index ef8fe7c..028117b 100644 --- a/app/[locale]/print/[year]/[month]/page.tsx +++ b/app/[locale]/print/[year]/[month]/page.tsx @@ -36,7 +36,7 @@ export default async function PrintPage({ params }: PrintPageProps) { barcodesFound: t("barcodes-found"), barcodeSingular: t("barcode-singular"), printButton: t("print-button"), - printFooter: t("print-footer"), + printFooter: t("print-footer", { date: new Date().toLocaleDateString() }), tableHeaderIndex: t("table-header-index"), tableHeaderBillInfo: t("table-header-bill-info"), tableHeaderBarcode: t("table-header-barcode") diff --git a/app/ui/PrintPreview.tsx b/app/ui/PrintPreview.tsx index 8739ebd..c237a6d 100644 --- a/app/ui/PrintPreview.tsx +++ b/app/ui/PrintPreview.tsx @@ -145,7 +145,7 @@ export const PrintPreview: React.FC = ({ data, year, month, t {/* Print footer - only visible when printing */}
-

{translations.printFooter.replace('{date}', new Date().toLocaleDateString())}

+

{translations.printFooter}