From 556f474fa6f1af3acf9b34196a8d6d9ec368873d Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 7 Oct 2020 18:01:16 +0200 Subject: [PATCH] i18n keys for success and error message (#154) fixes: #151 --- src/clients/add/NewClientForm.tsx | 4 ++-- src/clients/messages.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/clients/add/NewClientForm.tsx b/src/clients/add/NewClientForm.tsx index efc0de7a21..ac3c46f8d8 100644 --- a/src/clients/add/NewClientForm.tsx +++ b/src/clients/add/NewClientForm.tsx @@ -43,9 +43,9 @@ export const NewClientForm = () => { const save = async () => { try { await httpClient.doPost(`/admin/realms/${realm}/clients`, client); - addAlert("Client created", AlertVariant.success); + addAlert(t("createSuccess"), AlertVariant.success); } catch (error) { - addAlert(`Could not create client: '${error}'`, AlertVariant.danger); + addAlert(t("createError", { error }), AlertVariant.danger); } }; diff --git a/src/clients/messages.json b/src/clients/messages.json index 71f750000a..d568215f45 100644 --- a/src/clients/messages.json +++ b/src/clients/messages.json @@ -17,6 +17,8 @@ "generalSettings": "General Settings", "capabilityConfig": "Capability config", "clientsExplain": "Clients are applications and services that can request authentication of a user", + "createSuccess": "Client created successfully", + "createError": "Could not create client: '{{error}}'", "clientImportError": "Could not import client", "clientSaveSuccess": "Client successfully updated", "clientSaveError": "Client could not be updated:",