diff --git a/ui/src/data-services/models/occurrence-details.ts b/ui/src/data-services/models/occurrence-details.ts index 90654984f..39bcbfb39 100644 --- a/ui/src/data-services/models/occurrence-details.ts +++ b/ui/src/data-services/models/occurrence-details.ts @@ -1,4 +1,5 @@ import { getFormatedTimeString } from 'utils/date/getFormatedTimeString/getFormatedTimeString' +import { STRING, translate } from 'utils/language' import { UserPermission } from 'utils/user/types' import { Algorithm } from './algorithm' import { Occurrence, ServerOccurrence } from './occurrence' @@ -66,10 +67,12 @@ export class OccurrenceDetails extends Occurrence { user: i.user ? { id: `${i.user.id}`, - name: i.user.name?.length ? i.user.name : 'Anonymous user', + name: i.user.name?.length + ? i.user.name + : translate(STRING.ANONYMOUS_USER), image: i.user.image, } - : { name: 'Unknown user' }, + : { name: translate(STRING.ANONYMOUS_USER) }, comment: i.comment, userPermissions: i.user_permissions, createdAt: i.created_at, diff --git a/ui/src/data-services/models/occurrence.ts b/ui/src/data-services/models/occurrence.ts index 7e6f03219..468f670f1 100644 --- a/ui/src/data-services/models/occurrence.ts +++ b/ui/src/data-services/models/occurrence.ts @@ -1,5 +1,6 @@ import { getFormatedDateString } from 'utils/date/getFormatedDateString/getFormatedDateString' import { getFormatedTimeString } from 'utils/date/getFormatedTimeString/getFormatedTimeString' +import { STRING, translate } from 'utils/language' import { UserPermission } from 'utils/user/types' import { Taxon } from './taxa' @@ -103,9 +104,11 @@ export class Occurrence { return verifiedBy ? { id: `${verifiedBy.id}`, - name: verifiedBy.name?.length ? verifiedBy.name : 'Anonymous user', + name: verifiedBy.name?.length + ? verifiedBy.name + : translate(STRING.ANONYMOUS_USER), } - : { name: 'Unknown user' } + : { name: translate(STRING.ANONYMOUS_USER) } } get durationLabel(): string | undefined { diff --git a/ui/src/pages/project/summary/list-item.tsx b/ui/src/pages/project/summary/list-item.tsx index eea329b9d..134e48841 100644 --- a/ui/src/pages/project/summary/list-item.tsx +++ b/ui/src/pages/project/summary/list-item.tsx @@ -18,13 +18,15 @@ export const ListItem = ({ )}
- {item.title ? ( - {item.title} + {item.title ? {item.title} : null} + {item.text ? ( + + {item.text} + ) : null} - {item.text ? {item.text} : null}
{count !== undefined ? ( - + {count.toLocaleString()} ) : null} diff --git a/ui/src/pages/project/summary/summary.tsx b/ui/src/pages/project/summary/summary.tsx index 1446691b3..bacfb846e 100644 --- a/ui/src/pages/project/summary/summary.tsx +++ b/ui/src/pages/project/summary/summary.tsx @@ -105,7 +105,7 @@ const SummaryColumn = ({ if (isEmpty) { return ( -

+

{translate(STRING.MESSAGE_NO_RESULTS_TO_SHOW)}

) @@ -149,10 +149,10 @@ const LatestOccurrences = ({ projectId }: { projectId: string }) => { })} > @@ -176,7 +176,9 @@ const MostIdentifications = ({ projectId }: { projectId: string }) => { @@ -210,7 +212,7 @@ const MostObservedTaxa = ({ projectId }: { projectId: string }) => { @@ -233,7 +235,7 @@ const Charts = ({ projectId }: { projectId: string }) => { if (!projectCharts?.length) { return ( -

+

{translate(STRING.MESSAGE_NO_RESULTS_TO_SHOW)}

) diff --git a/ui/src/utils/language.ts b/ui/src/utils/language.ts index 997ec5942..cb54f81c7 100644 --- a/ui/src/utils/language.ts +++ b/ui/src/utils/language.ts @@ -274,6 +274,7 @@ export enum STRING { ABOUT_ROLE, ABOUT_ROLES, ALGORITHMS, + ANONYMOUS_USER, APPLY_ID_SHORT, APPLY_ID, BACK_TO_LOGIN, @@ -650,6 +651,7 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = { [STRING.ABOUT_ROLE]: 'About role', [STRING.ABOUT_ROLES]: 'About roles', [STRING.ALGORITHMS]: 'Algorithms', + [STRING.ANONYMOUS_USER]: 'Anonymous user', [STRING.APPLY_ID_SHORT]: 'Apply', [STRING.APPLY_ID]: 'Apply ID', [STRING.BACK_TO_LOGIN]: 'Back to login',