Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const ResourceModal = ({ isOpen, onClose, resource }) => {
}

if (error) {
return <div>Noe skjedde</div>;
return <div>{t('something went wrong')}</div>;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ const ResourcePage = ({ filters, showDeleteButton = false }) => {
<Content>
<div style={{ marginTop: 20 }}>
{loading && <CircularProgress />}
{error && <div>{t('Noe skjedde')}</div>}
{error && <div>{t('something went wrong')}</div>}
{!loading && !error && resources && !isGridView && (
<ResourceTable
totalCount={pagination.totalCount}
Expand Down
4 changes: 3 additions & 1 deletion sourcecode/www/src/containers/DefaultFetcher.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from 'react';
import { CircularProgress, Alert } from '@mui/material';
import useTranslation from '../hooks/useTranslation';

const DefaultFetcher = ({ useFetchData, children }) => {
const { error, loading, response } = useFetchData;
const { t } = useTranslation();

return (
<>
{loading && !error && <CircularProgress />}
{error && <Alert>Noe skjedde</Alert>}
{error && <Alert>{t('something went wrong')}</Alert>}
{response && children({ response })}
</>
);
Expand Down
1 change: 1 addition & 0 deletions sourcecode/www/src/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"explanation": "Here you see content that you can use in your course. Drag and drop resources into your modules."
},
"Noe skjedde": "Something happened",
"something went wrong": "A server error occurred. Please try again later. If the problem persists, please contact the site administrator.",
"Fant ingen ressurser": "Didn't find any resources",
"source": {
"h5p": "H5P",
Expand Down