Skip to content

Commit 371ee90

Browse files
committed
fix: provider translation missing
1 parent 032f570 commit 371ee90

File tree

4 files changed

+39
-28
lines changed

4 files changed

+39
-28
lines changed

api/src/rpc/translations/en_default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"referent_other": "referents",
88
"provider_one": "provider",
99
"providers_other": "providers",
10-
"appAccronym": "SILL"
10+
"appAccronym": "SILL",
11+
"officialWebsite": "Official website"
1112
},
1213
"app": {
1314
"title": "The Interministerial Free Software Base is a set of free software recommended by the French State since 2013.",

api/src/rpc/translations/fr_default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"providers_other": "fournisseurs",
1010
"free software_one": "logiciel libre",
1111
"free software_other": "logiciels libres",
12-
"appAccronym": "SILL"
12+
"appAccronym": "SILL",
13+
"officialWebsite": "Site officiel"
1314
},
1415
"app": {
1516
"title": "Le socle interministériel de logiciels libres est un ensemble de logiciels libres préconisés par l'État français depuis 2013.",

api/src/rpc/translations/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
"appAccronym": {
3838
"type": "string",
3939
"description": "Common reusable translation"
40+
},
41+
"officialWebsite": {
42+
"type": "string",
43+
"description": "Common reusable translation"
4044
}
4145
},
4246
"description": "Common reusable translation",

web/src/ui/pages/softwareDetails/SoftwareDetails.tsx

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-FileCopyrightText: 2024-2025 Université Grenoble Alpes
33
// SPDX-License-Identifier: MIT
44

5-
import { useEffect } from "react";
5+
import { Fragment, useEffect } from "react";
66
import { useCoreState, useCore } from "core";
77
import { Breadcrumb } from "@codegouvfr/react-dsfr/Breadcrumb";
88
import { tss } from "tss-react";
@@ -405,33 +405,38 @@ const ServiceProviderRow = ({
405405
serviceProvider: { url, name, identifiers }
406406
}: {
407407
serviceProvider: ApiTypes.Organization;
408-
}) => (
409-
<li>
410-
<span className={fr.cx("fr-text--bold")}>{name}</span>
411-
{" - "}
412-
{url && (
413-
<a href={url} target="_blank" rel="noreferrer">
414-
Site officiel TODO Translate
415-
</a>
416-
)}{" "}
417-
{identifiers &&
418-
identifiers.map(identifier => (
408+
}) => {
409+
const { t } = useTranslation();
410+
411+
return (
412+
<li>
413+
<span className={fr.cx("fr-text--bold")}>{name}</span>
414+
{url && (
419415
<>
420-
-{" "}
421-
{identifier?.url && (
422-
<a
423-
href={identifier.url.toString()}
424-
target="_blank"
425-
rel="noreferrer"
426-
>
427-
{identifier.subjectOf?.name ?? identifier.name}
428-
</a>
429-
)}
416+
{" - "}
417+
<a href={url} target="_blank" rel="noreferrer">
418+
{t("common.officialWebsite")}
419+
</a>
430420
</>
431-
))}
432-
</li>
433-
);
434-
421+
)}
422+
{identifiers &&
423+
identifiers
424+
.filter(identifier => !!identifier.url)
425+
.map(identifier => (
426+
<Fragment key={identifier.url! as string}>
427+
{" - "}
428+
<a
429+
href={identifier.url!.toString()}
430+
target="_blank"
431+
rel="noreferrer"
432+
>
433+
{identifier.subjectOf?.name ?? identifier.name}
434+
</a>
435+
</Fragment>
436+
))}
437+
</li>
438+
);
439+
};
435440
const useStyles = tss.withName({ SoftwareDetails }).create({
436441
breadcrumb: {
437442
marginBottom: fr.spacing("4v")

0 commit comments

Comments
 (0)