From 7d07f752eb4e6606c83cba6d2bf84369b6fab32f Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 9 Dec 2022 11:03:30 -0300
Subject: new string added to i18n

---
 packages/demobank-ui/src/pages/home/RegistrationPage.tsx | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'packages/demobank-ui/src/pages/home/RegistrationPage.tsx')

diff --git a/packages/demobank-ui/src/pages/home/RegistrationPage.tsx b/packages/demobank-ui/src/pages/home/RegistrationPage.tsx
index ecec5793c..fb7e975fb 100644
--- a/packages/demobank-ui/src/pages/home/RegistrationPage.tsx
+++ b/packages/demobank-ui/src/pages/home/RegistrationPage.tsx
@@ -19,7 +19,10 @@ import { route } from "preact-router";
 import { StateUpdater, useState } from "preact/hooks";
 import { useBackendContext } from "../../context/backend.js";
 import { PageStateType, usePageContext } from "../../context/pageState.js";
-import { useTranslationContext } from "../../context/translation.js";
+import {
+  InternationalizationAPI,
+  useTranslationContext,
+} from "../../context/translation.js";
 import { BackendStateHandler } from "../../hooks/backend.js";
 import { bankUiSettings } from "../../settings.js";
 import { getBankBackendBaseUrl, undefinedIfEmpty } from "../../utils.js";
@@ -148,6 +151,7 @@ function RegistrationForm(): VNode {
                     { username, password },
                     backend, // will store BE URL, if OK.
                     pageStateSetter,
+                    i18n,
                   );
 
                   setUsername(undefined);
@@ -193,6 +197,7 @@ async function registrationCall(
    */
   backend: BackendStateHandler,
   pageStateSetter: StateUpdater<PageStateType>,
+  i18n: InternationalizationAPI,
 ): Promise<void> {
   const url = getBankBackendBaseUrl();
 
@@ -218,7 +223,7 @@ async function registrationCall(
       ...prevState,
 
       error: {
-        title: `Registration failed, please report`,
+        title: i18n.str`Registration failed, please report`,
         debug: JSON.stringify(error),
       },
     }));
@@ -231,7 +236,7 @@ async function registrationCall(
         ...prevState,
 
         error: {
-          title: `That username is already taken`,
+          title: i18n.str`That username is already taken`,
           debug: JSON.stringify(response),
         },
       }));
@@ -240,7 +245,7 @@ async function registrationCall(
         ...prevState,
 
         error: {
-          title: `New registration gave response error`,
+          title: i18n.str`New registration gave response error`,
           debug: JSON.stringify(response),
         },
       }));
-- 
cgit v1.2.3

