Skip to content

Commit

Permalink
Add messages
Browse files Browse the repository at this point in the history
  • Loading branch information
guergana committed Nov 28, 2024
1 parent 4a0d3ff commit 25c764c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/components/Application/Browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function DefaultBrowser() {
<ErrorBoundary
fallback={
<Box sx={{ color: '#555' }}>
<strong>Failed to open the project</strong>. Please{' '}
<Trans i18nKey="failed-open-project" components={{ 1: <strong /> }} />{' '}
<a href="https://github.com/okfn/opendataeditor/issues" target="_blank">
{t('create-an-issue')}
</a>{' '}
Expand Down
2 changes: 1 addition & 1 deletion client/components/Application/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function FileContent() {
<ErrorBoundary
fallback={
<Box sx={{ padding: 2.5, color: '#555' }}>
<strong>Failed to open the file</strong>. Please{' '}
<Trans i18nKey="failed-open-project" components={{ 1: <strong /> }} />{' '}
<a href="https://github.com/okfn/opendataeditor/issues" target="_blank">
{t('create-an-issue')}
</a>{' '}
Expand Down
4 changes: 3 additions & 1 deletion client/components/Views/Missing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import Box from '@mui/material/Box'
import { useTranslation } from 'react-i18next'

export interface MissingProps {
format?: string
}

export default function Missing(props: MissingProps) {
if (!props.format) return null
const { t } = useTranslation()
return (
<Box
sx={{
Expand All @@ -16,7 +18,7 @@ export default function Missing(props: MissingProps) {
color: '#777',
}}
>
Preview is not available for this file format ({props.format})
{t('preview-not-available')} ({props.format})
</Box>
)
}
4 changes: 3 additions & 1 deletion client/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@
"repo": "Repo",
"email": "Email",
"description": "Description",
"author": "Author"
"author": "Author",
"failed-open-project": "<strong>Failed to open the project</strong>. Please",
"preview-not-available": "Preview is not available for this file format"
}

0 comments on commit 25c764c

Please sign in to comment.