Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move texts in getErrorMessage into language files #12930

Closed
ErlingHauan opened this issue Jun 6, 2024 · 1 comment · Fixed by #13181
Closed

Move texts in getErrorMessage into language files #12930

ErlingHauan opened this issue Jun 6, 2024 · 1 comment · Fixed by #13181
Labels
added-to-sprint good first issue Issues that are easy to fix for new team members or external contributors kind/chore

Comments

@ErlingHauan
Copy link
Contributor

ErlingHauan commented Jun 6, 2024

Description

Currently, the texts in the function getErrorMessage at dashboard/app/App.tsx are hardcoded. They should be moved into language/src/en.json and language/src/nb.json.

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.`,
      };
    }
    if (isOrganizationsError) {
      return {
        title: `${defaultTitle} organisasjoner`,
        message: `${defaultMessage} organisasjoner som kreves for å kjøre applikasjonen.`,
      };
    }
    return {
      title: 'Ukjent feil oppstod',
      message: 'Vi beklager men en ukjent feil, vennligst prøv igjen senere.',
    };
  };
@ErlingHauan ErlingHauan added good first issue Issues that are easy to fix for new team members or external contributors kind/chore labels Jun 6, 2024
@mlqn mlqn moved this to 🔎 Review in Team Studio Jul 17, 2024
ErlingHauan added a commit that referenced this issue Jul 18, 2024
* Added text to language files

* Updated App.tsx to reference language files

* Updated App.test.tsx to mock the text

* Ran prettier

* Update nb.json

* Update nb.json

Added commas before "men"

* Update en.json

Comma before "but"

---------

Co-authored-by: Jonas Dyrlie <jonas.dyrlie@gmail.com>
Co-authored-by: Erling Hauan <148075168+ErlingHauan@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from 🔎 Review to 🧪 Test in Team Studio Jul 18, 2024
@TomasEng TomasEng self-assigned this Jul 25, 2024
@TomasEng
Copy link
Contributor

Testet OK ved å se om feilmeldingstekstene fortsatt kommer opp når kallene blir blokkert.

@TomasEng TomasEng removed their assignment Jul 25, 2024
@TomasEng TomasEng moved this from 🧪 Test to ✅ Done in Team Studio Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added-to-sprint good first issue Issues that are easy to fix for new team members or external contributors kind/chore
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants