From a4aba929eee1f7cad95d1c58eb322175b5e6cfbc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 12 Dec 2024 22:39:47 -0800 Subject: pass locale around --- src/routes/(app)/invoice/[id]/tip/+page.svelte | 22 ++++++++++++++++------ .../(app)/pay/[username]/[...amount]/+page.svelte | 7 +++---- src/routes/(app)/send/invoice/[id]/+page.svelte | 7 ++++--- src/routes/(app)/sent/[id]/+page.svelte | 7 ++++--- 4 files changed, 27 insertions(+), 16 deletions(-) (limited to 'src/routes') diff --git a/src/routes/(app)/invoice/[id]/tip/+page.svelte b/src/routes/(app)/invoice/[id]/tip/+page.svelte index 7999030e..5cab71d8 100644 --- a/src/routes/(app)/invoice/[id]/tip/+page.svelte +++ b/src/routes/(app)/invoice/[id]/tip/+page.svelte @@ -3,7 +3,7 @@ import { browser } from "$app/environment"; import { invoice as inv, request } from "$lib/store"; - import { copy, focus, f, sat, get, s, sats } from "$lib/utils"; + import { loc, copy, focus, f, sat, get, s, sats } from "$lib/utils"; import Icon from "$comp/Icon.svelte"; import Slider from "$comp/Slider.svelte"; import { goto } from "$app/navigation"; @@ -76,6 +76,7 @@ tip, user: { username }, } = $state(invoice); + let locale = $derived(loc(user)); let qr; let tipPercent = $state((tip / amount) * 100); @@ -119,14 +120,23 @@
- {f(amountFiat, currency)} - +{f(tipAmount, currency)} + {f(amountFiat, currency, locale)} + +{f(tipAmount, currency, locale)}
-
- {sat(amount)} - +{sat(tip)} +
+
+ +
{s(amount, locale)}
+
+ +
+
+ +{s(tip, locale)} +
+
diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index ab96e7c2..b22e3c1f 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -1,17 +1,16 @@ - +
-- cgit v1.2.3