i18n keys for success and error message (#154)

fixes: #151
This commit is contained in:
Erik Jan de Wit 2020-10-07 18:01:16 +02:00 committed by GitHub
parent 8e2000283c
commit 556f474fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -43,9 +43,9 @@ export const NewClientForm = () => {
const save = async () => { const save = async () => {
try { try {
await httpClient.doPost(`/admin/realms/${realm}/clients`, client); await httpClient.doPost(`/admin/realms/${realm}/clients`, client);
addAlert("Client created", AlertVariant.success); addAlert(t("createSuccess"), AlertVariant.success);
} catch (error) { } catch (error) {
addAlert(`Could not create client: '${error}'`, AlertVariant.danger); addAlert(t("createError", { error }), AlertVariant.danger);
} }
}; };

View file

@ -17,6 +17,8 @@
"generalSettings": "General Settings", "generalSettings": "General Settings",
"capabilityConfig": "Capability config", "capabilityConfig": "Capability config",
"clientsExplain": "Clients are applications and services that can request authentication of a user", "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", "clientImportError": "Could not import client",
"clientSaveSuccess": "Client successfully updated", "clientSaveSuccess": "Client successfully updated",
"clientSaveError": "Client could not be updated:", "clientSaveError": "Client could not be updated:",