From 6a791cec4829c92b992344eff1ca15fd98bc7fd4 Mon Sep 17 00:00:00 2001 From: Pier-Jean Malandrino Date: Fri, 3 Apr 2026 13:05:44 +0200 Subject: [PATCH] Fix i18n placeholder replacement to handle repeated occurrences Use replaceAll instead of replace to substitute all instances of a placeholder in translation strings, not just the first one. --- frontend/src/shared/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/shared/i18n.ts b/frontend/src/shared/i18n.ts index 503967e..bdd9b09 100644 --- a/frontend/src/shared/i18n.ts +++ b/frontend/src/shared/i18n.ts @@ -233,7 +233,7 @@ export function useI18n() { function t(key: string, params: Record = {}): string { let str = messages[settings.locale]?.[key] || messages['fr'][key] || key for (const [k, v] of Object.entries(params)) { - str = str.replace(`{${k}}`, String(v)) + str = str.replaceAll(`{${k}}`, String(v)) } return str }