diff --git a/frontend/dashboard/app/App.test.tsx b/frontend/dashboard/app/App.test.tsx index 1108e42279c..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: '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'), }), ); }); diff --git a/frontend/dashboard/app/App.tsx b/frontend/dashboard/app/App.tsx index 1211f22104b..ff66897e917 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'), }; }; diff --git a/frontend/language/src/en.json b/frontend/language/src/en.json index 8ce1382af4b..230912c366b 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..902b9eef684 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 oppstod. 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",