From 79fdd0ee151b63ac93ce09a1aac11624dab40f39 Mon Sep 17 00:00:00 2001 From: Will-Marriott Date: Wed, 17 Jul 2024 16:49:36 +0100 Subject: [PATCH 1/7] Added text to language files --- frontend/language/src/en.json | 6 ++++++ frontend/language/src/nb.json | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/language/src/en.json b/frontend/language/src/en.json index 8ce1382af4b..9f33f679c00 100644 --- a/frontend/language/src/en.json +++ b/frontend/language/src/en.json @@ -74,6 +74,12 @@ "dashboard.data_models": "Data models", "dashboard.description": "Description", "dashboard.edit_app": "Edit {{appName}} in Studio", + "dashboard.error_getting_organization_data.message": "We apologize, but an error occurred while retrieving organizations required to run the application.", + "dashboard.error_getting_organization_data.title": "An error occurred while loading organizations", + "dashboard.error_getting_user_data.message": "We apologize, but an error occurred when retrieving your user data.", + "dashboard.error_getting_user_data.title": "An error occurred when loading user data", + "dashboard.error_unknown.message": "We are sorry but an unknown error occurred, please try again later.", + "dashboard.error_unknown.title": "An unknown error occurred", "dashboard.favorite_status": "Favorite status", "dashboard.favourites": "Favourites", "dashboard.field_cannot_be_empty": "Field cannot be empty", diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index 6c0ed2ee8c2..b8eb8380438 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -110,6 +110,12 @@ "dashboard.data_models": "Datamodeller", "dashboard.description": "Beskrivelse", "dashboard.edit_app": "Endre {{appName}} i Studio", + "dashboard.error_getting_organization_data.message": "Vi beklager men en feil oppstod ved henting av organisasjoner som kreves for å kjøre applikasjonen.", + "dashboard.error_getting_organization_data.title": "Feil oppstod ved innlasting av organisasjoner", + "dashboard.error_getting_user_data.message": "Vi beklager men en feil oppstod ved henting av dine brukerdata.", + "dashboard.error_getting_user_data.title": "Feil oppstod ved innlasting av brukerdata", + "dashboard.error_unknown.message": "Vi beklager men en ukjent feil, vennligst prøv igjen senere.", + "dashboard.error_unknown.title": "Ukjent feil oppstod", "dashboard.favorite_status": "Favorittstatus", "dashboard.favourites": "Favoritter", "dashboard.field_cannot_be_empty": "Dette feltet kan ikke være tomt", From 439c93d739a0354821103041ed49f43b743a2a37 Mon Sep 17 00:00:00 2001 From: Will-Marriott Date: Wed, 17 Jul 2024 16:50:11 +0100 Subject: [PATCH 2/7] Updated App.tsx to reference language files --- frontend/dashboard/app/App.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/dashboard/app/App.tsx b/frontend/dashboard/app/App.tsx index 1211f22104b..7058fc306df 100644 --- a/frontend/dashboard/app/App.tsx +++ b/frontend/dashboard/app/App.tsx @@ -23,23 +23,21 @@ export const App = (): JSX.Element => { const componentHasError = isUserError || isOrganizationsError; const getErrorMessage = (): { title: string; message: string } => { - const defaultTitle = 'Feil oppstod ved innlasting av'; - const defaultMessage = 'Vi beklager men en feil oppstod ved henting av'; if (isUserError) { return { - title: `${defaultTitle} brukerdata`, - message: `${defaultMessage} dine brukerdata.`, + title: t('dashboard.error_getting_user_data.title'), + message: t('dashboard.error_getting_user_data.message'), }; } if (isOrganizationsError) { return { - title: `${defaultTitle} organisasjoner`, - message: `${defaultMessage} organisasjoner som kreves for å kjøre applikasjonen.`, + title: t('dashboard.error_getting_organization_data.title'), + message: t('dashboard.error_getting_organization_data.message'), }; } return { - title: 'Ukjent feil oppstod', - message: 'Vi beklager men en ukjent feil, vennligst prøv igjen senere.', + title: t('dashboard.error_unknown.title'), + message: t('dashboard.error_unknown.message'), }; }; From 0c673c3d3496bce2f798374d47177e976c13c476 Mon Sep 17 00:00:00 2001 From: Will-Marriott Date: Wed, 17 Jul 2024 16:50:37 +0100 Subject: [PATCH 3/7] Updated App.test.tsx to mock the text --- frontend/dashboard/app/App.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/dashboard/app/App.test.tsx b/frontend/dashboard/app/App.test.tsx index 1108e42279c..15e0fef411c 100644 --- a/frontend/dashboard/app/App.test.tsx +++ b/frontend/dashboard/app/App.test.tsx @@ -25,7 +25,7 @@ describe('App', () => { expect( await screen.findByRole('heading', { level: 1, - name: 'Feil oppstod ved innlasting av brukerdata', + name: textMock("dashboard.error_getting_user_data.title"), }), ).toBeInTheDocument(); }); @@ -36,7 +36,7 @@ describe('App', () => { expect( await screen.findByRole('heading', { level: 1, - name: 'Feil oppstod ved innlasting av organisasjoner', + name: textMock("dashboard.error_getting_organization_data.title"), }), ); }); From af8cf7f6ec8800cf87f87a0607ca48ba929efd08 Mon Sep 17 00:00:00 2001 From: Will-Marriott Date: Thu, 18 Jul 2024 10:03:41 +0100 Subject: [PATCH 4/7] Ran prettier --- frontend/dashboard/app/App.test.tsx | 4 ++-- frontend/dashboard/app/App.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/dashboard/app/App.test.tsx b/frontend/dashboard/app/App.test.tsx index 15e0fef411c..2ce3dc35105 100644 --- a/frontend/dashboard/app/App.test.tsx +++ b/frontend/dashboard/app/App.test.tsx @@ -25,7 +25,7 @@ describe('App', () => { expect( await screen.findByRole('heading', { level: 1, - name: textMock("dashboard.error_getting_user_data.title"), + name: textMock('dashboard.error_getting_user_data.title'), }), ).toBeInTheDocument(); }); @@ -36,7 +36,7 @@ describe('App', () => { expect( await screen.findByRole('heading', { level: 1, - name: textMock("dashboard.error_getting_organization_data.title"), + name: textMock('dashboard.error_getting_organization_data.title'), }), ); }); diff --git a/frontend/dashboard/app/App.tsx b/frontend/dashboard/app/App.tsx index 7058fc306df..ff66897e917 100644 --- a/frontend/dashboard/app/App.tsx +++ b/frontend/dashboard/app/App.tsx @@ -25,13 +25,13 @@ export const App = (): JSX.Element => { const getErrorMessage = (): { title: string; message: string } => { if (isUserError) { return { - title: t('dashboard.error_getting_user_data.title'), + title: t('dashboard.error_getting_user_data.title'), message: t('dashboard.error_getting_user_data.message'), }; } if (isOrganizationsError) { return { - title: t('dashboard.error_getting_organization_data.title'), + title: t('dashboard.error_getting_organization_data.title'), message: t('dashboard.error_getting_organization_data.message'), }; } From 378c56b1d68da35734c0a17ca83acc3d080618b7 Mon Sep 17 00:00:00 2001 From: Jonas Dyrlie Date: Thu, 18 Jul 2024 12:31:04 +0200 Subject: [PATCH 5/7] Update nb.json --- frontend/language/src/nb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index b8eb8380438..31416e1b6e4 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -114,7 +114,7 @@ "dashboard.error_getting_organization_data.title": "Feil oppstod ved innlasting av organisasjoner", "dashboard.error_getting_user_data.message": "Vi beklager men en feil oppstod ved henting av dine brukerdata.", "dashboard.error_getting_user_data.title": "Feil oppstod ved innlasting av brukerdata", - "dashboard.error_unknown.message": "Vi beklager men en ukjent feil, vennligst prøv igjen senere.", + "dashboard.error_unknown.message": "Vi beklager men en ukjent feil oppstod, vennligst prøv igjen senere.", "dashboard.error_unknown.title": "Ukjent feil oppstod", "dashboard.favorite_status": "Favorittstatus", "dashboard.favourites": "Favoritter", From 2635584b14c1e1fe15d328564c3b71803a5b139f Mon Sep 17 00:00:00 2001 From: Erling Hauan <148075168+ErlingHauan@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:55:06 +0200 Subject: [PATCH 6/7] Update nb.json Added commas before "men" --- frontend/language/src/nb.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index 31416e1b6e4..902b9eef684 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -110,11 +110,11 @@ "dashboard.data_models": "Datamodeller", "dashboard.description": "Beskrivelse", "dashboard.edit_app": "Endre {{appName}} i Studio", - "dashboard.error_getting_organization_data.message": "Vi beklager men en feil oppstod ved henting av organisasjoner som kreves for å kjøre applikasjonen.", + "dashboard.error_getting_organization_data.message": "Vi beklager, men en feil oppstod ved henting av organisasjoner som kreves for å kjøre applikasjonen.", "dashboard.error_getting_organization_data.title": "Feil oppstod ved innlasting av organisasjoner", - "dashboard.error_getting_user_data.message": "Vi beklager men en feil oppstod ved henting av dine brukerdata.", + "dashboard.error_getting_user_data.message": "Vi beklager, men en feil oppstod ved henting av dine brukerdata.", "dashboard.error_getting_user_data.title": "Feil oppstod ved innlasting av brukerdata", - "dashboard.error_unknown.message": "Vi beklager men en ukjent feil oppstod, vennligst prøv igjen senere.", + "dashboard.error_unknown.message": "Vi beklager, men en ukjent feil oppstod. Vennligst prøv igjen senere.", "dashboard.error_unknown.title": "Ukjent feil oppstod", "dashboard.favorite_status": "Favorittstatus", "dashboard.favourites": "Favoritter", From 338b80f6730574a5c0a370b8c1b79389bba8fdc3 Mon Sep 17 00:00:00 2001 From: Erling Hauan <148075168+ErlingHauan@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:58:36 +0200 Subject: [PATCH 7/7] Update en.json Comma before "but" --- frontend/language/src/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/language/src/en.json b/frontend/language/src/en.json index 9f33f679c00..230912c366b 100644 --- a/frontend/language/src/en.json +++ b/frontend/language/src/en.json @@ -78,7 +78,7 @@ "dashboard.error_getting_organization_data.title": "An error occurred while loading organizations", "dashboard.error_getting_user_data.message": "We apologize, but an error occurred when retrieving your user data.", "dashboard.error_getting_user_data.title": "An error occurred when loading user data", - "dashboard.error_unknown.message": "We are sorry but an unknown error occurred, please try again later.", + "dashboard.error_unknown.message": "We are sorry, but an unknown error occurred. Please try again later.", "dashboard.error_unknown.title": "An unknown error occurred", "dashboard.favorite_status": "Favorite status", "dashboard.favourites": "Favourites",