Skip to content

Commit

Permalink
chore: i18n Iucn titles
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi committed Nov 19, 2024
1 parent 3ef6b14 commit cbc4e52
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MessageDescriptor } from '@lingui/core';
import { msg, Trans } from '@lingui/macro';

import { Level } from 'web-components/src/components/icons/terrasos/EcologicalConnectivityLevelIcon/EcologicalConnectivityLevelIcon';
Expand All @@ -7,21 +8,21 @@ import { SocialCulturalValueType } from 'web-components/src/components/icons/ter
import { IucnStatus } from 'lib/db/types/json-ld';

const titles = {
IucnExtinct: 'Extinct',
IucnExtinctInWild: 'Extinct In Wild',
IucnCriticallyEndangered: 'Critically Endangered',
IucnEndangered: 'Endangered',
IucnVulnerable: 'Vulnerable',
IucnNearThreatened: 'Near Threatened',
IucnLeastConcern: 'Least Concern',
IucnDataDeficient: 'Data Deficient',
IucnNotEvaluated: 'Not Evaluated',
IucnExtinct: msg`Extinct`,
IucnExtinctInWild: msg`Extinct In Wild`,
IucnCriticallyEndangered: msg`Critically Endangered`,
IucnEndangered: msg`Endangered`,
IucnVulnerable: msg`Vulnerable`,
IucnNearThreatened: msg`Near Threatened`,
IucnLeastConcern: msg`Least Concern`,
IucnDataDeficient: msg`Data Deficient`,
IucnNotEvaluated: msg`Not Evaluated`,
};

export type IucnMapType = Record<
IucnStatus,
{
title: string;
title: MessageDescriptor;
type: IucnType;
factor: string | number;
description: JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function getThreatCard(
},
]}
>
<ThreatBody title={title} type={type} description={description} />
<ThreatBody title={_(title)} type={type} description={description} />
</TebuCard>
);
}
Expand Down
Loading

0 comments on commit cbc4e52

Please sign in to comment.