From 55e3a9fff4b86648f5bdb7dc26e8152474834de3 Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Sat, 18 Jan 2025 22:50:44 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20passage=20tous=20les=20textes=20c?= =?UTF-8?q?=C3=B4t=C3=A9=20front=20sur=20i18nifty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO: prévoir nettoyage des textes non-utilisés côté symfony --- assets/components/Input/MarkdownEditor.tsx | 3 +- assets/components/Layout/AppLayout.tsx | 5 +- .../CommunityList/CommunityList.locale.tsx | 33 +++++++ .../{ => CommunityList}/CommunityList.tsx | 46 +++++----- .../pages/dashboard/DashboardPro.locale.tsx | 8 +- .../entrepot/pages/dashboard/DashboardPro.tsx | 7 +- .../DatasheetUploadForm.locale.tsx | 2 +- .../DatasheetUploadForm.tsx | 28 +++--- .../DatasheetUploadIntegration.locale.tsx | 65 +++++++++++++ .../DatasheetUploadIntegrationDialog.tsx | 38 ++------ .../DatasheetUploadIntegrationPage.tsx | 7 +- .../DatasheetView/DatasheetView.locale.tsx | 3 + .../ServiceListTab/ServicesListTab.tsx | 6 +- .../entrepot/pages/datastore/Confirmation.tsx | 32 ------- .../DatastoreCreationForm.locale.tsx | 92 +++++++++++++++++++ .../DatastoreCreationForm.tsx | 53 +++++------ .../DatastoreCreationRequestConfirmation.tsx | 30 ++++++ .../common/TableSelection/TableSelection.tsx | 2 +- .../pages/service/metadata/Description.tsx | 1 + .../service/metadata/MetadataForm.locale.tsx | 3 + .../PyramidVectorGenerateForm.locale.tsx | 91 ++++++++++++++++++ .../PyramidVectorGenerateForm.tsx | 80 ++++++++-------- .../pages/service/tms/sample/RCSampleMap.tsx | 8 +- .../pages/service/tms/sample/Sample.tsx | 19 ++-- .../tms/tables/TableAttributeSelection.tsx | 9 +- .../service/tms/tables/TableZoomLevels.tsx | 10 +- .../service/tms/tippecanoes/Tippecanoe.tsx | 14 ++- .../pages/service/wfs/TablesInfoForm.tsx | 27 +++--- .../service/wfs/WfsServiceForm.locale.tsx | 36 ++++++++ .../pages/service/wfs/WfsServiceForm.tsx | 6 +- assets/i18n/Common.locale.tsx | 5 +- assets/i18n/languages/en.tsx | 10 +- assets/i18n/languages/fr.tsx | 10 +- assets/i18n/types.ts | 6 +- .../breadcrumbs/Breadcrumb.locale.tsx | 6 +- .../entrepot/breadcrumbs/Breadcrumb.ts | 2 +- .../assistance/contact/Contact.locale.tsx | 19 ++++ assets/pages/assistance/contact/Contact.tsx | 3 +- .../contact/ContactConfirmation.tsx | 27 ++++++ assets/pages/assistance/contact/Thanks.tsx | 31 ------- assets/router/RouterRenderer.tsx | 18 ++-- assets/router/router.ts | 7 +- 42 files changed, 636 insertions(+), 272 deletions(-) create mode 100644 assets/entrepot/pages/communities/CommunityList/CommunityList.locale.tsx rename assets/entrepot/pages/communities/{ => CommunityList}/CommunityList.tsx (82%) rename assets/entrepot/pages/datasheet/DatasheetNew/{ => DatasheetUploadForm}/DatasheetUploadForm.locale.tsx (98%) rename assets/entrepot/pages/datasheet/DatasheetNew/{ => DatasheetUploadForm}/DatasheetUploadForm.tsx (93%) create mode 100644 assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale.tsx delete mode 100644 assets/entrepot/pages/datastore/Confirmation.tsx create mode 100644 assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale.tsx rename assets/entrepot/pages/datastore/{ => DatastoreCreationForm}/DatastoreCreationForm.tsx (72%) create mode 100644 assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationRequestConfirmation.tsx create mode 100644 assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale.tsx rename assets/entrepot/pages/service/tms/{ => PyramidVectorGenerateForm}/PyramidVectorGenerateForm.tsx (74%) create mode 100644 assets/pages/assistance/contact/ContactConfirmation.tsx delete mode 100644 assets/pages/assistance/contact/Thanks.tsx diff --git a/assets/components/Input/MarkdownEditor.tsx b/assets/components/Input/MarkdownEditor.tsx index 971b54fc..f8964e3c 100644 --- a/assets/components/Input/MarkdownEditor.tsx +++ b/assets/components/Input/MarkdownEditor.tsx @@ -4,7 +4,6 @@ import MDEditor from "@uiw/react-md-editor"; import { CSSProperties, FC } from "react"; import getLocaleCommands from "../../modules/react-md/react-md-commands"; -import Translator from "../../modules/Translator"; type MarkdownEditorProps = { label?: string; @@ -42,7 +41,7 @@ const MarkdownEditor: FC = (props) => { commands={getLocaleCommands("fr")} extraCommands={[]} textareaProps={{ - placeholder: placeholder ?? Translator.trans("service.wfs.new.description_form.markdown_placeholder"), + placeholder: placeholder, }} onChange={(newValue = "") => onChange(newValue)} style={customStyle} diff --git a/assets/components/Layout/AppLayout.tsx b/assets/components/Layout/AppLayout.tsx index c55de02c..0b612f4a 100644 --- a/assets/components/Layout/AppLayout.tsx +++ b/assets/components/Layout/AppLayout.tsx @@ -11,7 +11,6 @@ import { defaultNavItems } from "../../config/navItems/navItems"; import api from "../../entrepot/api"; import useDocumentTitle from "../../hooks/useDocumentTitle"; import { useTranslation } from "../../i18n/i18n"; -import Translator from "../../modules/Translator"; import RQKeys from "../../modules/entrepot/RQKeys"; import getBreadcrumb from "../../modules/entrepot/breadcrumbs/Breadcrumb"; import { useRoute } from "../../router/router"; @@ -21,6 +20,8 @@ import AppFooter from "./AppFooter"; import AppHeader from "./AppHeader"; const HiddenElements: FC = () => { + const { t } = useTranslation("Common"); + return ( <> {/* doit être le premier élément du DOM (Accessibilité) : https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/gestionnaire-de-consentement */} @@ -30,7 +31,7 @@ const HiddenElements: FC = () => { links={[ { anchor: "#main", - label: Translator.trans("site.go_to_content"), + label: t("go_to_content"), }, ]} /> diff --git a/assets/entrepot/pages/communities/CommunityList/CommunityList.locale.tsx b/assets/entrepot/pages/communities/CommunityList/CommunityList.locale.tsx new file mode 100644 index 00000000..732ed582 --- /dev/null +++ b/assets/entrepot/pages/communities/CommunityList/CommunityList.locale.tsx @@ -0,0 +1,33 @@ +import { declareComponentKeys } from "i18nifty"; +import { Translations } from "../../../../i18n/types"; + +const { i18n } = declareComponentKeys< + | "title" + | { K: "community_technical_name"; P: { name?: string }; R: string } + | "join" + | { K: "modal.title"; P: { name?: string }; R: string } + | "modal.message" + | { K: "success_message.title"; P: { name?: string }; R: string } + | "success_message.description" +>()("CommunityList"); +export type I18n = typeof i18n; + +export const CommunityListFrTranslations: Translations<"fr">["CommunityList"] = { + title: "Rejoindre un espace de travail existant", + community_technical_name: ({ name }) => `Nom technique : ${name}`, + join: "Rejoindre", + "modal.title": ({ name }) => `Votre demande à rejoindre ${name} a été envoyée.`, + "modal.message": "Message (optionnel)", + "success_message.title": ({ name }) => `Votre demande à rejoindre ${name} a été envoyée.`, + "success_message.description": "Un accusé-réception vous a également été adressé.", +}; + +export const CommunityListEnTranslations: Translations<"en">["CommunityList"] = { + title: undefined, + community_technical_name: undefined, + join: undefined, + "modal.title": undefined, + "modal.message": undefined, + "success_message.title": undefined, + "success_message.description": undefined, +}; diff --git a/assets/entrepot/pages/communities/CommunityList.tsx b/assets/entrepot/pages/communities/CommunityList/CommunityList.tsx similarity index 82% rename from assets/entrepot/pages/communities/CommunityList.tsx rename to assets/entrepot/pages/communities/CommunityList/CommunityList.tsx index 61b26bf2..f5a5cbd0 100644 --- a/assets/entrepot/pages/communities/CommunityList.tsx +++ b/assets/entrepot/pages/communities/CommunityList/CommunityList.tsx @@ -8,19 +8,19 @@ import { useMutation, useQuery } from "@tanstack/react-query"; import { FC, useMemo, useRef, useState } from "react"; import { createPortal } from "react-dom"; -import api from "../../api"; -import AppLayout from "../../../components/Layout/AppLayout"; -import LoadingText from "../../../components/Utils/LoadingText"; -import Wait from "../../../components/Utils/Wait"; -import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems"; -import RQKeys from "../../../modules/entrepot/RQKeys"; -import Translator from "../../../modules/Translator"; -import { CartesApiException } from "../../../modules/jsonFetch"; -import { useAuthStore } from "../../../stores/AuthStore"; -import { CommunityListResponseDto } from "../../../@types/entrepot"; -import { regex, removeDiacritics } from "../../../utils"; - -import "../../../sass/pages/community_list.scss"; +import { CommunityListResponseDto } from "../../../../@types/entrepot"; +import AppLayout from "../../../../components/Layout/AppLayout"; +import LoadingText from "../../../../components/Utils/LoadingText"; +import Wait from "../../../../components/Utils/Wait"; +import { datastoreNavItems } from "../../../../config/navItems/datastoreNavItems"; +import { useTranslation } from "../../../../i18n"; +import RQKeys from "../../../../modules/entrepot/RQKeys"; +import { CartesApiException } from "../../../../modules/jsonFetch"; +import { useAuthStore } from "../../../../stores/AuthStore"; +import { regex, removeDiacritics } from "../../../../utils"; +import api from "../../../api"; + +import "../../../../sass/pages/community_list.scss"; const joinCommunityModal = createModal({ id: "join-community-modal", @@ -30,6 +30,8 @@ const joinCommunityModal = createModal({ const navItems = datastoreNavItems(); const CommunityList: FC = () => { + const { t } = useTranslation("CommunityList"); + const { t: tCommon } = useTranslation("Common"); const { user } = useAuthStore(); const [searchText, setSearchText] = useState(); @@ -86,8 +88,8 @@ const CommunityList: FC = () => { }; return ( - -

{Translator.trans("communities_list.title")}

+ +

{t("title")}

{communitiesQuery.isLoading ? ( @@ -102,8 +104,8 @@ const CommunityList: FC = () => { )} @@ -131,7 +133,7 @@ const CommunityList: FC = () => { data={filteredCommunities.map((community) => [ community.name, , ])} noCaption @@ -162,22 +164,22 @@ const CommunityList: FC = () => { <> {createPortal( - + , document.body )} diff --git a/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx b/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx index 87ead024..34b2bcab 100644 --- a/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx +++ b/assets/entrepot/pages/dashboard/DashboardPro.locale.tsx @@ -2,17 +2,23 @@ import { declareComponentKeys } from "i18nifty"; import { Translations } from "../../../i18n/types"; -const { i18n } = declareComponentKeys<"document_title" | "espaceco_frontoffice_list" | "datastore_for_tests">()("DashboardPro"); +const { i18n } = declareComponentKeys< + "document_title" | "espaceco_frontoffice_list" | "datastore_for_tests" | "datastore_creation_form" | "join_existing_community" +>()("DashboardPro"); export type I18n = typeof i18n; export const DashboardProFrTranslations: Translations<"fr">["DashboardPro"] = { document_title: "Tableau de bord professionnel", espaceco_frontoffice_list: "Liste des guichets de l’espace collaboratif", datastore_for_tests: "À des fins de test", + datastore_creation_form: "Demande de création d’un espace de travail", + join_existing_community: "Rejoindre un espace de travail existant", }; export const DashboardProEnTranslations: Translations<"en">["DashboardPro"] = { document_title: "Professional dashboard", espaceco_frontoffice_list: "List of collaborative space front offices", datastore_for_tests: "For testing purposes", + datastore_creation_form: undefined, + join_existing_community: undefined, }; diff --git a/assets/entrepot/pages/dashboard/DashboardPro.tsx b/assets/entrepot/pages/dashboard/DashboardPro.tsx index 88ae618f..9ae42f6b 100644 --- a/assets/entrepot/pages/dashboard/DashboardPro.tsx +++ b/assets/entrepot/pages/dashboard/DashboardPro.tsx @@ -10,7 +10,6 @@ import LoadingIcon from "../../../components/Utils/LoadingIcon"; import Skeleton from "../../../components/Utils/Skeleton"; import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems"; import { useTranslation } from "../../../i18n/i18n"; -import Translator from "../../../modules/Translator"; import RQKeys from "../../../modules/entrepot/RQKeys"; import { CartesApiException } from "../../../modules/jsonFetch"; import { routes } from "../../../router/router"; @@ -166,18 +165,20 @@ const DashboardPro = () => {
diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale.tsx similarity index 98% rename from assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx rename to assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale.tsx index e2ad9919..3fb05d02 100644 --- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale.tsx @@ -1,5 +1,5 @@ import { declareComponentKeys } from "i18nifty"; -import { Translations } from "../../../../i18n/types"; +import { Translations } from "../../../../../i18n/types"; const { i18n } = declareComponentKeys< | { K: "title"; P: { datasheetName: string | undefined }; R: string } diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.tsx similarity index 93% rename from assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx rename to assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.tsx index da73e950..f6da1926 100644 --- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.tsx @@ -13,20 +13,20 @@ import { symToStr } from "tsafe/symToStr"; import { v4 as uuidv4 } from "uuid"; import * as yup from "yup"; -import DatastoreLayout from "../../../../components/Layout/DatastoreLayout"; -import LoadingIcon from "../../../../components/Utils/LoadingIcon"; -import LoadingText from "../../../../components/Utils/LoadingText"; -import Progress from "../../../../components/Utils/Progress"; -import Wait from "../../../../components/Utils/Wait"; -import defaultProjections from "../../../../data/default_projections.json"; -import ignfProjections from "../../../../data/ignf_projections.json"; -import { useTranslation } from "../../../../i18n/i18n"; -import FileUploader from "../../../../modules/FileUploader"; -import RQKeys from "../../../../modules/entrepot/RQKeys"; -import { routes, useRoute } from "../../../../router/router"; -import { getFileExtension, regex } from "../../../../utils"; -import api from "../../../api"; -import DatasheetUploadIntegrationDialog from "./DatasheetUploadIntegration/DatasheetUploadIntegrationDialog"; +import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout"; +import LoadingIcon from "../../../../../components/Utils/LoadingIcon"; +import LoadingText from "../../../../../components/Utils/LoadingText"; +import Progress from "../../../../../components/Utils/Progress"; +import Wait from "../../../../../components/Utils/Wait"; +import defaultProjections from "../../../../../data/default_projections.json"; +import ignfProjections from "../../../../../data/ignf_projections.json"; +import { useTranslation } from "../../../../../i18n/i18n"; +import FileUploader from "../../../../../modules/FileUploader"; +import RQKeys from "../../../../../modules/entrepot/RQKeys"; +import { routes, useRoute } from "../../../../../router/router"; +import { getFileExtension, regex } from "../../../../../utils"; +import api from "../../../../api"; +import DatasheetUploadIntegrationDialog from "../DatasheetUploadIntegration/DatasheetUploadIntegrationDialog"; const maxFileSize = 2000000000; // 2 GB const fileExtensions = ["gpkg", "zip"]; diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale.tsx new file mode 100644 index 00000000..4dc4bf2f --- /dev/null +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale.tsx @@ -0,0 +1,65 @@ +import { declareComponentKeys } from "i18nifty"; +import { Translations } from "../../../../../i18n/types"; + +const { i18n } = declareComponentKeys< + | { K: "step_title"; P: { step_name: string }; R: string } + | { K: "step_status_text"; P: { step_status: string }; R: string } + | "data_integration_in_progress" + | "long_operation_information" + | "continue_browsing_data_not_ready" + | "view_datasheet" + | "check_error_report" + | "back_to_datasheet_list" + | "integration_page.title" +>()("DatasheetUploadIntegration"); +export type I18n = typeof i18n; + +export const DatasheetUploadIntegrationFrTranslations: Translations<"fr">["DatasheetUploadIntegration"] = { + step_title: ({ step_name }) => { + switch (step_name) { + case "send_files_api": + return "Chargement des fichiers"; + case "wait_checks": + return "Vérifications standard et vecteur"; + case "integration_processing": + return "Intégration en base de données"; + default: + return "Étape inconnue"; + } + }, + step_status_text: ({ step_status }) => { + switch (step_status) { + case "in_progress": + return "En cours"; + case "successful": + return "Succès"; + case "failed": + return "Echec"; + case "waiting": + return "En attente"; + default: + return "Statut inconnu"; + } + }, + data_integration_in_progress: "Vos données vecteur sont en cours de dépôt", + long_operation_information: "Les opérations suivantes peuvent prendre quelques minutes. Merci pour votre patience.", + continue_browsing_data_not_ready: "Vous pouvez maintenant poursuivre votre navigation même si vos données ne sont pas encore prêtes.", + view_datasheet: "Consulter la fiche de données", + check_error_report: "Voir le rapport d’erreur", + back_to_datasheet_list: "Revenir à mes données", + + "integration_page.title": "Intégration des données", +}; + +export const DatasheetUploadIntegrationEnTranslations: Translations<"en">["DatasheetUploadIntegration"] = { + step_title: undefined, + step_status_text: undefined, + data_integration_in_progress: undefined, + long_operation_information: undefined, + continue_browsing_data_not_ready: undefined, + view_datasheet: undefined, + check_error_report: undefined, + back_to_datasheet_list: undefined, + + "integration_page.title": undefined, +}; diff --git a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx index b22a07f1..83e62b23 100644 --- a/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationDialog.tsx @@ -4,8 +4,8 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { FC, useEffect, useMemo, useState } from "react"; import LoadingIcon from "../../../../../components/Utils/LoadingIcon"; +import { useTranslation } from "../../../../../i18n"; import RQKeys from "../../../../../modules/entrepot/RQKeys"; -import Translator from "../../../../../modules/Translator"; import { routes } from "../../../../../router/router"; import api from "../../../../api"; import { DatasheetViewActiveTabEnum } from "../../DatasheetView/DatasheetView/DatasheetView"; @@ -30,24 +30,6 @@ const getStepIcon = (status: string) => { return icon; }; -const getStepStatusText = (status: string) => { - let statusText = ""; - switch (status) { - case "in_progress": - statusText = "En cours"; - break; - case "successful": - statusText = "Succès"; - break; - case "failed": - statusText = "Echec"; - break; - case "waiting": - statusText = "En attente"; - } - return statusText; -}; - type IntegrationStatus = "at_least_one_failure" | "proc_int_launched" | "all_successful"; type DatasheetUploadIntegrationDialogProps = { @@ -57,6 +39,8 @@ type DatasheetUploadIntegrationDialogProps = { }; const DatasheetUploadIntegrationDialog: FC = ({ datastoreId, datasheetName, uploadId }) => { + const { t } = useTranslation("DatasheetUploadIntegration"); + const [shouldPingIntProg, setShouldPingIntProg] = useState(true); const queryClient = useQueryClient(); @@ -157,13 +141,13 @@ const DatasheetUploadIntegrationDialog: FC
- Vos données vecteur sont en cours de dépôt + {t("data_integration_in_progress")}
-

Les opérations suivantes peuvent prendre quelques minutes. Merci pour votre patience.

+

{t("long_operation_information")}

@@ -176,16 +160,14 @@ const DatasheetUploadIntegrationDialog: FC

{getStepIcon(status)} -  {Translator.trans(`datasheet.new_integration.steps.${step}`)} : {getStepStatusText(status)} +  {t("step_title", { step_name: step })} : {t("step_status_text", { step_status: status })}

))} - {integrationStatus === "proc_int_launched" && ( -

Vous pouvez maintenant poursuivre votre navigation même si vos données ne sont pas encore prêtes.

- )} + {integrationStatus === "proc_int_launched" &&

{t("continue_browsing_data_not_ready")}

} {(integrationStatus === "all_successful" || integrationStatus === "proc_int_launched") && uploadQuery.data?.tags.datasheet_name !== undefined && (
@@ -218,7 +200,7 @@ const DatasheetUploadIntegrationDialog: FC { uploadQuery.data?.tags.datasheet_name && (queryClient.refetchQueries({ @@ -244,7 +226,7 @@ const DatasheetUploadIntegrationDialog: FC = ({ datastoreId, uploadId, datasheetName }) => { + const { t } = useTranslation("DatasheetUploadIntegration"); + return ( - +
-

Intégration des données

+

{t("integration_page.title")}

diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx index d7261ca7..5a589935 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale.tsx @@ -25,6 +25,7 @@ const { i18n } = declareComponentKeys< | "datasheet_confirm_delete_modal.text" | "metadata_tab.metadata.absent" | "metadata_tab.metadata.is_loading" + | "services_tab.no_service" | "documents_tab.documents_list.is_loading" | "documents_tab.add_document" | "documents_tab.add_document.type.label" @@ -91,6 +92,7 @@ export const DatasheetViewFrTranslations: Translations<"fr">["DatasheetView"] = "metadata_tab.metadata.absent": "Les métadonnées de cette fiche ne sont pas encore disponibles. Créez un premier service à partir d’un de vos jeux de données pour les compléter.", "metadata_tab.metadata.is_loading": "Les métadonnées sont en cours de chargement", + "services_tab.no_service": "Aucun service publié. Créez un service à partir de l’onglet Jeux de données en choisissant une base de données d’origine.", "documents_tab.documents_list.is_loading": "Les documents sont en cours de chargement", "documents_tab.add_document": "Ajouter un document", "documents_tab.add_document.type.label": "Type de document", @@ -200,6 +202,7 @@ export const DatasheetViewEnTranslations: Translations<"en">["DatasheetView"] = "datasheet_confirm_delete_modal.text": "The following items will be deleted :", "metadata_tab.metadata.absent": undefined, "metadata_tab.metadata.is_loading": undefined, + "services_tab.no_service": undefined, "documents_tab.documents_list.is_loading": undefined, "documents_tab.add_document": undefined, "documents_tab.add_document.type.label": undefined, diff --git a/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServicesListTab.tsx b/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServicesListTab.tsx index 39375fa9..13c1fd64 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServicesListTab.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/ServiceListTab/ServicesListTab.tsx @@ -2,8 +2,8 @@ import { fr } from "@codegouvfr/react-dsfr"; import { FC } from "react"; import { symToStr } from "tsafe/symToStr"; -import Translator from "../../../../../modules/Translator"; import { DatasheetDetailed, Service } from "../../../../../@types/app"; +import { useTranslation } from "../../../../../i18n"; import ServicesListItem from "./ServicesListItem"; type ServicesListTabProps = { @@ -12,10 +12,12 @@ type ServicesListTabProps = { datasheet_services_list: Service[]; }; const ServicesListTab: FC = ({ datastoreId, datasheet, datasheet_services_list }) => { + const { t } = useTranslation("DatasheetView"); + if (!datasheet_services_list || datasheet_services_list.length === 0) { return (
-

{Translator.trans("datasheet.view.services.no_service")}

+

{t("services_tab.no_service")}

); } diff --git a/assets/entrepot/pages/datastore/Confirmation.tsx b/assets/entrepot/pages/datastore/Confirmation.tsx deleted file mode 100644 index 691d5721..00000000 --- a/assets/entrepot/pages/datastore/Confirmation.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { fr } from "@codegouvfr/react-dsfr"; -import Alert from "@codegouvfr/react-dsfr/Alert"; -import Button from "@codegouvfr/react-dsfr/Button"; -import AppLayout from "../../../components/Layout/AppLayout"; -import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems"; -import Translator from "../../../modules/Translator"; -import { routes } from "../../../router/router"; - -const Confirmation = () => { - const link = { __html: Translator.trans("mailer.signature", { href: routes.home().href }) }; - const navItems = datastoreNavItems(); - - return ( - - -

{Translator.trans("contact.thanks.description")}

-

- - } - severity="success" - /> -

- -
-
- ); -}; - -export default Confirmation; diff --git a/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale.tsx b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale.tsx new file mode 100644 index 00000000..f3dc55ee --- /dev/null +++ b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale.tsx @@ -0,0 +1,92 @@ +import { RegisteredLinkProps } from "@codegouvfr/react-dsfr/link"; +import { declareComponentKeys } from "i18nifty"; + +import { Translations } from "../../../../i18n/types"; + +const { i18n } = declareComponentKeys< + | "title" + | "form.error_title" + | "form.name" + | "form.name_hint" + | "form.name_error" + | "form.name_minlength_error" + | "form.information" + | "form.information_hint" + | "form.send" + | "is_sending" + | "email_support.heading" + | "email_support.details" + | "email_support.date" + | "email_support.datastore_name" + | "email_support.datastore_technical_name" + | "email_support.is_member" + | "email_support.is_supervisor" + | "email_acknowledgement.heading" + | "email_acknowledgement.message" + | "request_confirmation.title" + | "request_confirmation.success.title" + | { K: "request_confirmation.success.description"; P: { homeLink: RegisteredLinkProps }; R: JSX.Element } + | "request_confirmation.continue" +>()("DatastoreCreationForm"); +export type I18n = typeof i18n; + +export const DatastoreCreationFormFrTranslations: Translations<"fr">["DatastoreCreationForm"] = { + title: "Demande de création d’un espace de travail", + "form.error_title": "Votre message n’a pas pu être envoyé", + "form.name": "Nom de l’espace de travail", + "form.name_hint": + "Ce nom vous permettra d’identifier l’espace de travail susceptible d’être partagé avec d’autres utilisateurs, soyez aussi clair que possible", + "form.name_error": "Le nom de l’espace de travail est obligatoire", + "form.name_minlength_error": "Le nom de l’espace de travail doit faire au minimum 10 caractères", + "form.information": "Informations complémentaires (optionnel)", + "form.information_hint": + "Saisissez toute information que vous aimeriez porter à la connaissance des administrateurs et qui vous paraissent utiles dans le contexte de cette demande", + "form.send": "Envoyer la demande", + is_sending: "Votre demande est en cours d’envoi", + "email_support.heading": "Un utilisateur a fait une demande de création d’un espace de travail", + "email_support.details": "Détails de la demande", + "email_support.date": "Date d’envoi", + "email_support.datastore_name": "Nom de l’espace de travail", + "email_support.datastore_technical_name": "Nom technique de l’espace de travail", + "email_support.is_member": "L’utilisateur est un simple membre des communautés suivantes :", + "email_support.is_supervisor": "L’utilisateur est superviseur des communautés suivantes :", + "email_acknowledgement.heading": + "Votre demande de création d’un espace de travail a été envoyée à l’IGN et une réponse vous sera apportée dans les meilleurs délais.", + "email_acknowledgement.message": "Rappel de votre demande", + "request_confirmation.title": "Demande envoyée", + "request_confirmation.success.title": "Votre message a bien été envoyé", + "request_confirmation.success.description": ({ homeLink }) => ( + <> + Vous recevrez dans les prochaines minutes un accusé de réception récapitulant votre demande. +
+ Cordialement, l’équipe de cartes.gouv.fr. + + ), + "request_confirmation.continue": "Poursuivre", +}; + +export const DatastoreCreationFormEnTranslations: Translations<"en">["DatastoreCreationForm"] = { + title: undefined, + "form.error_title": undefined, + "form.name": undefined, + "form.name_hint": undefined, + "form.name_error": undefined, + "form.name_minlength_error": undefined, + "form.information": undefined, + "form.information_hint": undefined, + "form.send": undefined, + is_sending: undefined, + "email_support.heading": undefined, + "email_support.details": undefined, + "email_support.date": undefined, + "email_support.datastore_name": undefined, + "email_support.datastore_technical_name": undefined, + "email_support.is_member": undefined, + "email_support.is_supervisor": undefined, + "email_acknowledgement.heading": undefined, + "email_acknowledgement.message": undefined, + "request_confirmation.title": undefined, + "request_confirmation.success.title": undefined, + "request_confirmation.success.description": undefined, + "request_confirmation.continue": undefined, +}; diff --git a/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.tsx similarity index 72% rename from assets/entrepot/pages/datastore/DatastoreCreationForm.tsx rename to assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.tsx index a65315ae..380da7a0 100644 --- a/assets/entrepot/pages/datastore/DatastoreCreationForm.tsx +++ b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.tsx @@ -1,27 +1,28 @@ import { fr } from "@codegouvfr/react-dsfr"; -import { FC, useEffect, useState } from "react"; -import { useForm } from "react-hook-form"; -import { Input } from "@codegouvfr/react-dsfr/Input"; +import Alert from "@codegouvfr/react-dsfr/Alert"; import { Button } from "@codegouvfr/react-dsfr/Button"; -import AppLayout from "../../../components/Layout/AppLayout"; +import { Input } from "@codegouvfr/react-dsfr/Input"; import { yupResolver } from "@hookform/resolvers/yup"; +import { FC, useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; import * as yup from "yup"; -import SymfonyRouting from "../../../modules/Routing"; -import { routes } from "../../../router/router"; -import Translator from "../../../modules/Translator"; -import { jsonFetch } from "../../../modules/jsonFetch"; -import { removeDiacritics } from "../../../utils"; -import Wait from "../../../components/Utils/Wait"; -import Alert from "@codegouvfr/react-dsfr/Alert"; -import { datastoreNavItems } from "../../../config/navItems/datastoreNavItems"; + +import AppLayout from "../../../../components/Layout/AppLayout"; +import Wait from "../../../../components/Utils/Wait"; +import { datastoreNavItems } from "../../../../config/navItems/datastoreNavItems"; +import { useTranslation } from "../../../../i18n"; +import SymfonyRouting from "../../../../modules/Routing"; +import { jsonFetch } from "../../../../modules/jsonFetch"; +import { routes } from "../../../../router/router"; +import { removeDiacritics } from "../../../../utils"; const DatastoreCreationForm: FC = () => { + const { t } = useTranslation("DatastoreCreationForm"); + const { t: tCommon } = useTranslation("Common"); + const schema = yup .object({ - name: yup - .string() - .required(Translator.trans("datastore_creation_request.form.name_error")) - .min(10, Translator.trans("datastore_creation_request.form.name_minlength_error")), + name: yup.string().required(t("form.name_error")).min(10, t("form.name_minlength_error")), technical_name: yup.string().required(), information: yup.string(), }) @@ -68,10 +69,10 @@ const DatastoreCreationForm: FC = () => { const navItems = datastoreNavItems(); return ( - +
-

{Translator.trans("datastore_creation_request.title")}

+

{t("title")}

Un espace de travail permet de disposer :

  • @@ -86,12 +87,12 @@ const DatastoreCreationForm: FC = () => { .
-

{Translator.trans("mandatory_fields")}

- {error && } +

{tCommon("mandatory_fields")}

+ {error && }
{ }} /> { }} />
- +
@@ -121,7 +122,7 @@ const DatastoreCreationForm: FC = () => {
-
{Translator.trans("datastore_creation_request.is_sending")}
+
{t("is_sending")}
diff --git a/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationRequestConfirmation.tsx b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationRequestConfirmation.tsx new file mode 100644 index 00000000..f3062643 --- /dev/null +++ b/assets/entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationRequestConfirmation.tsx @@ -0,0 +1,30 @@ +import { fr } from "@codegouvfr/react-dsfr"; +import Alert from "@codegouvfr/react-dsfr/Alert"; +import Button from "@codegouvfr/react-dsfr/Button"; + +import AppLayout from "../../../../components/Layout/AppLayout"; +import { datastoreNavItems } from "../../../../config/navItems/datastoreNavItems"; +import { useTranslation } from "../../../../i18n"; +import { routes } from "../../../../router/router"; + +const navItems = datastoreNavItems(); + +const DatastoreCreationRequestConfirmation = () => { + const { t } = useTranslation("DatastoreCreationForm"); + + return ( + +

{t("request_confirmation.title")}

+ +
+ +
+
+ ); +}; + +export default DatastoreCreationRequestConfirmation; diff --git a/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx b/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx index b65601cc..d249676e 100644 --- a/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx +++ b/assets/entrepot/pages/service/common/TableSelection/TableSelection.tsx @@ -6,7 +6,7 @@ import { useWatch, type UseFormReturn } from "react-hook-form"; import { type VectorDb } from "../../../../../@types/app"; import { filterGeometricRelations } from "../../../../../helpers"; import { useTranslation } from "../../../../../i18n/i18n"; -import { type PyramidVectorGenerateFormValuesType } from "../../tms/PyramidVectorGenerateForm"; +import { type PyramidVectorGenerateFormValuesType } from "../../tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm"; import { type WmsVectorServiceFormValuesType } from "../../wms-vector/WmsVectorServiceForm"; type TablesSelectionProps = { diff --git a/assets/entrepot/pages/service/metadata/Description.tsx b/assets/entrepot/pages/service/metadata/Description.tsx index 6b5123e0..66c3d76c 100644 --- a/assets/entrepot/pages/service/metadata/Description.tsx +++ b/assets/entrepot/pages/service/metadata/Description.tsx @@ -87,6 +87,7 @@ const Description: FC = ({ visible, form, editMode }) => { ["MetadatasForm"] = "metadata.description_form.hint_public_name": "Nom caractéristique et souvent unique sous lequel la ressource est connue", "metadata.description_form.description": "Résumé", "metadata.description_form.hint_description": "Bref résumé narratif du contenu de la ressource", + "metadata.description_form.placeholder_description": "Veuillez saisir le texte Markdown", "metadata.description_form.identifier": "Identificateur de ressource unique", "metadata.description_form.hint_identifier": "Entrez une valeur identifiant la ressource de manière unique", "metadata.description_form.category": "Catégorie thématique", @@ -142,6 +144,7 @@ export const MetadatasFormEnTranslations: Translations<"en">["MetadatasForm"] = "metadata.description_form.hint_public_name": "Characteristic and often unique name by which the resource is known", "metadata.description_form.description": "Description", "metadata.description_form.hint_description": "Brief narrative summary of resource content", + "metadata.description_form.placeholder_description": undefined, "metadata.description_form.identifier": "Unique resource identifier", "metadata.description_form.hint_identifier": "Enter a value that uniquely identifies the resource", "metadata.description_form.category": "Thematic category", diff --git a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale.tsx b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale.tsx new file mode 100644 index 00000000..8096ec99 --- /dev/null +++ b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale.tsx @@ -0,0 +1,91 @@ +import { declareComponentKeys } from "i18nifty"; + +import { Translations } from "../../../../../i18n/types"; + +const { i18n } = declareComponentKeys< + | "title" + | "stored_data.loading" + | "stored_data.fetch_failed" + | { K: "step.title"; P: { stepNumber: number }; R: string } + | "step_tables.error.required" + | "step_attributes.label" + | "step_attributes.error.required" + | "step_zoom_levels.label" + | "step_zoom_levels.explanation" + | "step_generalisation.tippecanoe_option.label" + | "step_generalisation.tippecanoe_option.error.required" + | "step_sample.label" + | "step_sample.doubts_prompt" + | "step_sample.explanation" + | "step_sample.hint" + | "step_sample.define_sample" + | "generate_pyramid" + | "generate_sample" + | "pyramid_creation_launch_in_progress" + | "back_to_data_list" +>()("PyramidVectorGenerateForm"); +export type I18n = typeof i18n; + +export const PyramidVectorGenerateFormFrTranslations: Translations<"fr">["PyramidVectorGenerateForm"] = { + title: "Générer une pyramide de tuiles vectorielles", + "stored_data.loading": "Chargement de la donnée stockée...", + "stored_data.fetch_failed": "Récupération des informations sur la donnée stockée a échoué", + "step.title": ({ stepNumber }) => { + switch (stepNumber) { + case 1: + return "Tables"; + case 2: + return "Attributs"; + case 3: + return "Niveaux de zoom"; + case 4: + return "Option de généralisation"; + case 5: + return "Echantillon"; + default: + return "Etape inconnue"; + } + }, + "step_tables.error.required": "Veuillez choisir au moins une table", + "step_attributes.label": "Choisissez les attributs des tables sélectionnées", + "step_attributes.error.required": "Veuillez choisir au moins un attribut pour chaque table", + "step_zoom_levels.label": "Choisissez les niveaux de zoom minimum et maximum des tables sélectionnées", + "step_zoom_levels.explanation": + "Les niveaux de zoom de la pyramide de tuiles vectorielles sont prédéfinis. Choisissez les bornes minimum et maximum de votre pyramide de tuiles en vous aidant des deux cartes. Tous les niveaux intermédiaires seront générés.", + "step_generalisation.tippecanoe_option.label": "Choisissez une option de généralisation", + "step_generalisation.tippecanoe_option.error.required": "L'option de généralisation est obligatoire", + "step_sample.label": "Définition d’un échantillon (Optionnel)", + "step_sample.doubts_prompt": "Des doutes sur votre configuration ?", + "step_sample.explanation": + "En choisissant de générer un échantillon, vous pourrez visualiser votre pyramide de tuiles vectorielles sur une zone restreinte et ainsi confirmer votre paramétrage ou le modifier s’il ne vous convient pas. Vous obtiendrez ainsi un résultat plus rapide que si vous générez les tuiles vectorielles sur l’intégralité de vos données.", + "step_sample.hint": + "Déplacez la carte ou utilisez l’outil de recherche pour choisir l’emplacement de votre échantillon. Choisissez un endroit où vous êtes certain de trouver des données. La taille de l’échantillon est limité à 10x10 tuiles vectorielles au niveau de zoom maximum que vous avez défini.", + "step_sample.define_sample": "Définir un échantillon", + generate_pyramid: "Générer la pyramide complète", + generate_sample: "Générer l’échantillon", + pyramid_creation_launch_in_progress: "Demande de création de la pyramide de tuiles en cours ...", + back_to_data_list: "Retour à mes données", +}; + +export const PyramidVectorGenerateFormEnTranslations: Translations<"en">["PyramidVectorGenerateForm"] = { + title: undefined, + "stored_data.loading": undefined, + "stored_data.fetch_failed": undefined, + "step.title": undefined, + "step_tables.error.required": undefined, + "step_attributes.label": undefined, + "step_attributes.error.required": undefined, + "step_zoom_levels.label": undefined, + "step_zoom_levels.explanation": undefined, + "step_generalisation.tippecanoe_option.label": undefined, + "step_generalisation.tippecanoe_option.error.required": undefined, + "step_sample.label": undefined, + "step_sample.doubts_prompt": undefined, + "step_sample.explanation": undefined, + "step_sample.hint": undefined, + "step_sample.define_sample": undefined, + generate_pyramid: undefined, + generate_sample: undefined, + pyramid_creation_launch_in_progress: undefined, + back_to_data_list: undefined, +}; diff --git a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.tsx similarity index 74% rename from assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx rename to assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.tsx index b718e5a1..25937198 100644 --- a/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm.tsx +++ b/assets/entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.tsx @@ -9,23 +9,23 @@ import { FC, useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import * as yup from "yup"; -import { type StoredDataRelation, type VectorDb } from "../../../../@types/app"; -import DatastoreLayout from "../../../../components/Layout/DatastoreLayout"; -import LoadingText from "../../../../components/Utils/LoadingText"; -import Wait from "../../../../components/Utils/Wait"; -import olDefaults from "../../../../data/ol-defaults.json"; -import useScrollToTopEffect from "../../../../hooks/useScrollToTopEffect"; -import Translator from "../../../../modules/Translator"; -import RQKeys from "../../../../modules/entrepot/RQKeys"; -import { CartesApiException } from "../../../../modules/jsonFetch"; -import { routes } from "../../../../router/router"; -import api from "../../../api"; -import TableSelection from "../common/TableSelection/TableSelection"; -import formatForm from "./format-form"; -import Sample, { type SampleType } from "./sample/Sample"; -import TableAttributeSelection from "./tables/TableAttributeSelection"; -import TableZoomLevels from "./tables/TableZoomLevels"; -import TippeCanoe from "./tippecanoes/Tippecanoe"; +import { type StoredDataRelation, type VectorDb } from "../../../../../@types/app"; +import DatastoreLayout from "../../../../../components/Layout/DatastoreLayout"; +import LoadingText from "../../../../../components/Utils/LoadingText"; +import Wait from "../../../../../components/Utils/Wait"; +import olDefaults from "../../../../../data/ol-defaults.json"; +import useScrollToTopEffect from "../../../../../hooks/useScrollToTopEffect"; +import { useTranslation } from "../../../../../i18n"; +import RQKeys from "../../../../../modules/entrepot/RQKeys"; +import { CartesApiException } from "../../../../../modules/jsonFetch"; +import { routes } from "../../../../../router/router"; +import api from "../../../../api"; +import TableSelection from "../../common/TableSelection/TableSelection"; +import formatForm from "../format-form"; +import Sample, { type SampleType } from "../sample/Sample"; +import TableAttributeSelection from "../tables/TableAttributeSelection"; +import TableZoomLevels from "../tables/TableZoomLevels"; +import TippeCanoe from "../tippecanoes/Tippecanoe"; export type PyramidVectorGenerateFormValuesType = { selected_tables?: string[]; @@ -50,13 +50,13 @@ type PyramidVectorNewProps = { }; const PyramidVectorGenerateForm: FC = ({ datastoreId, vectorDbId, technicalName }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const { t: tCommon } = useTranslation("Common"); + // Definition du schema const schema = {}; schema[STEPS.TABLES_SELECTION] = yup.object({ - selected_tables: yup - .array(yup.string()) - .min(1, Translator.trans("pyramid_vector.new.step_tables.mandatory_error")) - .required(Translator.trans("pyramid_vector.new.step_tables.mandatory_error")), + selected_tables: yup.array(yup.string()).min(1, t("step_tables.error.required")).required(t("step_tables.error.required")), }); schema[STEPS.ATTRIBUTES_SELECTION] = yup.object({ table_attributes: yup.lazy(() => { @@ -69,15 +69,15 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec tableAttributes[table.name] = yup .array() .of(yup.string()) - .min(1, Translator.trans("pyramid_vector.new.step_attributes.mandatory_error")) - .required(Translator.trans("pyramid_vector.new.step_attributes.mandatory_error")); + .min(1, t("step_attributes.error.required")) + .required(t("step_attributes.error.required")); }); return yup.object().shape(tableAttributes); }), }); schema[STEPS.ZOOM_LEVELS] = yup.mixed().nullable().notRequired(); schema[STEPS.GENERALIZE_OPTIONS] = yup.object({ - tippecanoe: yup.string().required(Translator.trans("pyramid_vector.new.step_tippecanoe.mandatory_error")), + tippecanoe: yup.string().required(t("step_generalisation.tippecanoe_option.error.required")), }); schema[STEPS.SAMPLE] = yup.mixed().nullable().notRequired(); @@ -160,34 +160,28 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec }; return ( - -

{Translator.trans("pyramid_vector.new.title")}

+ +

{t("title")}

{vectorDbQuery.isLoading ? ( - + ) : vectorDbQuery.data === undefined ? ( Retour à mes données} + title={t("stored_data.fetch_failed")} + description={} /> ) : ( <> {validationError && ( - + )} @@ -204,7 +198,7 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec alignment="between" buttons={[ { - children: Translator.trans("previous_step"), + children: tCommon("previous_step"), iconId: "fr-icon-arrow-left-fill", priority: "tertiary", onClick: previousStep, @@ -213,10 +207,10 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec { children: currentStep < Object.values(STEPS).length - ? Translator.trans("continue") + ? tCommon("continue") : sample?.is_sample === "true" - ? Translator.trans("pyramid_vector.new.generate_sample") - : Translator.trans("pyramid_vector.new.generate_pyramid"), + ? t("generate_sample") + : t("generate_pyramid"), onClick: nextStep, }, ]} @@ -232,7 +226,7 @@ const PyramidVectorGenerateForm: FC = ({ datastoreId, vec
-
{"Demande de création de la pyramide de tuiles en cours ..."}
+
{t("pyramid_creation_launch_in_progress")}
diff --git a/assets/entrepot/pages/service/tms/sample/RCSampleMap.tsx b/assets/entrepot/pages/service/tms/sample/RCSampleMap.tsx index 15307e9c..fd1b16e2 100644 --- a/assets/entrepot/pages/service/tms/sample/RCSampleMap.tsx +++ b/assets/entrepot/pages/service/tms/sample/RCSampleMap.tsx @@ -10,7 +10,7 @@ import { FC, useEffect, useRef } from "react"; import { UseFormReturn } from "react-hook-form"; import useCapabilities from "../../../../../hooks/useCapabilities"; -import Translator from "../../../../../modules/Translator"; +import { useTranslation } from "../../../../../i18n"; import SampleMap from "./SampleMap"; import "ol/ol.css"; @@ -28,6 +28,8 @@ type RCSampleMapProps = { }; const RCSampleMap: FC = ({ form, center, bottomZoomLevel, onChange }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const mapTargetRef = useRef(null); const mapRef = useRef(); @@ -59,8 +61,6 @@ const RCSampleMap: FC = ({ form, center, bottomZoomLevel, onCh controls: controls, }); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore mapRef.current.on("extentchanged", (e) => { onChange?.(e.center, e.area); }); @@ -79,7 +79,7 @@ const RCSampleMap: FC = ({ form, center, bottomZoomLevel, onCh return (
-

{Translator.trans("pyramid_vector.new.step_sample.sample_explain")}

+

{t("step_sample.hint")}

diff --git a/assets/entrepot/pages/service/tms/sample/Sample.tsx b/assets/entrepot/pages/service/tms/sample/Sample.tsx index 92f33cc9..5452242b 100644 --- a/assets/entrepot/pages/service/tms/sample/Sample.tsx +++ b/assets/entrepot/pages/service/tms/sample/Sample.tsx @@ -1,10 +1,11 @@ +import { fr } from "@codegouvfr/react-dsfr"; +import Checkbox from "@codegouvfr/react-dsfr/Checkbox"; import { FC, useEffect, useState } from "react"; import { UseFormReturn } from "react-hook-form"; -import Checkbox from "@codegouvfr/react-dsfr/Checkbox"; -import Translator from "../../../../../modules/Translator"; -import { fr } from "@codegouvfr/react-dsfr"; -import RCSampleMap from "./RCSampleMap"; + import olDefaults from "../../../../../data/ol-defaults.json"; +import { useTranslation } from "../../../../../i18n"; +import RCSampleMap from "./RCSampleMap"; type booleanValue = "true" | "false"; export type SampleType = { @@ -20,6 +21,8 @@ type SampleProps = { }; const Sample: FC = ({ visible, bottomZoomLevel, form }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const { setValue: setFormValue, getValues: getFormValues } = form; const [sample, setSample] = useState({ @@ -49,15 +52,15 @@ const Sample: FC = ({ visible, bottomZoomLevel, form }) => { return (
-

{Translator.trans("pyramid_vector.new.step_sample.title")}

+

{t("step_sample.label")}

- {Translator.trans("pyramid_vector.new.step_sample.doubts")} + {t("step_sample.doubts_prompt")}

-

{Translator.trans("pyramid_vector.new.step_sample.explain")}

+

{t("step_sample.explanation")}

toggleSample(), }, diff --git a/assets/entrepot/pages/service/tms/tables/TableAttributeSelection.tsx b/assets/entrepot/pages/service/tms/tables/TableAttributeSelection.tsx index 4b95f77f..fa4b2ffc 100644 --- a/assets/entrepot/pages/service/tms/tables/TableAttributeSelection.tsx +++ b/assets/entrepot/pages/service/tms/tables/TableAttributeSelection.tsx @@ -4,8 +4,8 @@ import Checkbox from "@codegouvfr/react-dsfr/Checkbox"; import { FC, useEffect } from "react"; import { type UseFormReturn } from "react-hook-form"; -import Translator from "../../../../../modules/Translator"; import { type StoredDataRelation } from "../../../../../@types/app"; +import { useTranslation } from "../../../../../i18n"; type TableAttributeSelectionProps = { visible: boolean; @@ -14,6 +14,9 @@ type TableAttributeSelectionProps = { }; const TableAttributeSelection: FC = ({ visible, form, selectedTables }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const { t: tCommon } = useTranslation("Common"); + const { setValue: setFormValue, getValues: getFormValues, @@ -47,8 +50,8 @@ const TableAttributeSelection: FC = ({ visible, fo return (
-

{Translator.trans("choose_attributes")}

-

{Translator.trans("mandatory_fields")}

+

{t("step_attributes.label")}

+

{tCommon("mandatory_fields")}

{selectedTables.map((table) => ( diff --git a/assets/entrepot/pages/service/tms/tables/TableZoomLevels.tsx b/assets/entrepot/pages/service/tms/tables/TableZoomLevels.tsx index 7b0219f7..1f7983c7 100644 --- a/assets/entrepot/pages/service/tms/tables/TableZoomLevels.tsx +++ b/assets/entrepot/pages/service/tms/tables/TableZoomLevels.tsx @@ -6,8 +6,8 @@ import { UseFormReturn } from "react-hook-form"; import { StoredDataRelation } from "../../../../../@types/app"; import ZoomRange from "../../../../../components/Utils/ZoomRange"; import olDefaults from "../../../../../data/ol-defaults.json"; -import Translator from "../../../../../modules/Translator"; -import { PyramidVectorGenerateFormValuesType } from "../PyramidVectorGenerateForm"; +import { useTranslation } from "../../../../../i18n"; +import { PyramidVectorGenerateFormValuesType } from "../PyramidVectorGenerateForm/PyramidVectorGenerateForm"; type TableZoomLevelsProps = { visible: boolean; @@ -16,6 +16,8 @@ type TableZoomLevelsProps = { }; const TableZoomLevels: FC = ({ visible, form, selectedTables }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const [tableZoomLevels, setTableZoomLevels] = useState>({}); const { setValue: setFormValue, getValues: getFormValues } = form; @@ -51,8 +53,8 @@ const TableZoomLevels: FC = ({ visible, form, selectedTabl return (
-

{Translator.trans("pyramid_vector.new.step_zoom_levels.title")}

-

{Translator.trans("pyramid_vector.new.step_zoom_levels.explain")}

+

{t("step_zoom_levels.label")}

+

{t("step_zoom_levels.explanation")}

{visible && selectedTables.map((table) => ( diff --git a/assets/entrepot/pages/service/tms/tippecanoes/Tippecanoe.tsx b/assets/entrepot/pages/service/tms/tippecanoes/Tippecanoe.tsx index ad74a9c5..2ab0372a 100644 --- a/assets/entrepot/pages/service/tms/tippecanoes/Tippecanoe.tsx +++ b/assets/entrepot/pages/service/tms/tippecanoes/Tippecanoe.tsx @@ -1,11 +1,13 @@ -import { FC } from "react"; -import tippecanoes from "../../../../../data/tippecanoe.json"; -import RichLabel from "./RichLabel"; import { fr } from "@codegouvfr/react-dsfr"; import RadioButtons from "@codegouvfr/react-dsfr/RadioButtons"; +import { FC } from "react"; import { UseFormReturn } from "react-hook-form"; + +import tippecanoes from "../../../../../data/tippecanoe.json"; +import { useTranslation } from "../../../../../i18n"; import { appRoot } from "../../../../../router/router"; -import Translator from "../../../../../modules/Translator"; +import RichLabel from "./RichLabel"; + import "../../../../../sass/components/tippecanoe.scss"; type TippeCanoeProps = { @@ -16,13 +18,15 @@ type TippeCanoeProps = { }; const TippeCanoe: FC = ({ visible, form, state, stateRelatedMessage }) => { + const { t } = useTranslation("PyramidVectorGenerateForm"); + const { register } = form; return (
({ label: , hintText: tpc.explain, diff --git a/assets/entrepot/pages/service/wfs/TablesInfoForm.tsx b/assets/entrepot/pages/service/wfs/TablesInfoForm.tsx index e586df7c..4c80c20c 100644 --- a/assets/entrepot/pages/service/wfs/TablesInfoForm.tsx +++ b/assets/entrepot/pages/service/wfs/TablesInfoForm.tsx @@ -4,12 +4,12 @@ import Input from "@codegouvfr/react-dsfr/Input"; import { FC, useEffect } from "react"; import { Controller, UseFormReturn } from "react-hook-form"; -import AutocompleteSelect from "../../../../components/Input/AutocompleteSelect"; -import Translator from "../../../../modules/Translator"; import { StoredDataDetailsRelationDto } from "../../../../@types/entrepot"; +import AutocompleteSelect from "../../../../components/Input/AutocompleteSelect"; import { WfsServiceFormValuesType } from "./WfsServiceForm"; // Themes et mot cles INSPIRE +import { useTranslation } from "../../../../i18n"; import { getInspireKeywords } from "../../../../utils"; type TablesInfoFormProps = { @@ -23,6 +23,9 @@ type TablesInfoFormProps = { const keywords = getInspireKeywords(); const TableInfosForm: FC = ({ visible, tables, state, stateRelatedMessage, form }) => { + const { t } = useTranslation("WfsServiceForm"); + const { t: tCommon } = useTranslation("Common"); + const { register, setValue: setFormValue, @@ -55,8 +58,8 @@ const TableInfosForm: FC = ({ visible, tables, state, state return (
-

{Translator.trans("service.wfs.new.tables_form.title")}

-

{Translator.trans("mandatory_fields")}

+

{t("tables_info_form.label")}

+

{tCommon("mandatory_fields")}

{tables.map((table) => { return (
@@ -76,8 +79,8 @@ const TableInfosForm: FC = ({ visible, tables, state, state {selectedTables.includes(table.name) && (
= ({ visible, tables, state, state stateRelatedMessage={errors?.table_infos?.[table.name]?.public_name?.message} /> = ({ visible, tables, state, state stateRelatedMessage={errors?.table_infos?.[table.name]?.title?.message} /> = ({ visible, tables, state, state render={({ field }) => { return ( option} diff --git a/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx b/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx index 6dccf1ba..9990430e 100644 --- a/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx +++ b/assets/entrepot/pages/service/wfs/WfsServiceForm.locale.tsx @@ -16,6 +16,18 @@ const { i18n } = declareComponentKeys< | "back_to_data_list" | "trimmed_error" | "public_name_regex" + | "tables_info_form.label" + | "tables_info_form.error.required" + | "tables_info_form.public_name.label" + | "tables_info_form.public_name.hint" + | "tables_info_form.title.label" + | "tables_info_form.title.hint" + | { K: "tables_info_form.title.error.required"; P: { table: string }; R: string } + | "tables_info_form.description.label" + | "tables_info_form.description.hint" + | { K: "tables_info_form.description.error.required"; P: { table: string }; R: string } + | "tables_info_form.keywords.label" + | "tables_info_form.keywords.hint" >()("WfsServiceForm"); export type I18n = typeof i18n; @@ -50,6 +62,18 @@ export const WfsServiceFormFrTranslations: Translations<"fr">["WfsServiceForm"] trimmed_error: "La chaîne de caractères ne doit contenir aucun espace en début et fin", public_name_regex: "Le nom public de la table ne doit contenir que des lettres, chiffres, tirets (-), underscores (_), ou points (.) et ne peut commencer que par une lettre ou un underscore", + "tables_info_form.label": "Sélectionnez les tables nécessaires au service", + "tables_info_form.error.required": "Veuillez choisir au moins une table", + "tables_info_form.public_name.label": "Nom public de la table (optionnel)", + "tables_info_form.public_name.hint": "Ce nom permettra d’identifier la table dans les services que vous configurerez, veuillez choisir un nom explicite.", + "tables_info_form.title.label": "Titre de la table", + "tables_info_form.title.hint": "Ce titre permet de faciliter l’identification de la table par les utilisateurs.", + "tables_info_form.title.error.required": ({ table }) => `Le titre de la table ${table} est obligatoire`, + "tables_info_form.description.label": "Résumé du contenu de la table", + "tables_info_form.description.hint": "Bref résumé narratif du contenu de la table", + "tables_info_form.description.error.required": ({ table }) => `Le résumé du contenu de la table ${table} est obligatoire`, + "tables_info_form.keywords.label": "Mot clés (optionnel)", + "tables_info_form.keywords.hint": "Utilisez l’auto-complétion ou saisissez librement des mots clés en appuyant sur Entrée après chaque mot", }; export const WfsServiceFormEnTranslations: Translations<"en">["WfsServiceForm"] = { @@ -67,4 +91,16 @@ export const WfsServiceFormEnTranslations: Translations<"en">["WfsServiceForm"] back_to_data_list: undefined, trimmed_error: undefined, public_name_regex: undefined, + "tables_info_form.label": undefined, + "tables_info_form.error.required": undefined, + "tables_info_form.public_name.label": undefined, + "tables_info_form.public_name.hint": undefined, + "tables_info_form.title.label": undefined, + "tables_info_form.title.hint": undefined, + "tables_info_form.title.error.required": undefined, + "tables_info_form.description.label": undefined, + "tables_info_form.description.hint": undefined, + "tables_info_form.description.error.required": undefined, + "tables_info_form.keywords.label": undefined, + "tables_info_form.keywords.hint": undefined, }; diff --git a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx index 6d12848c..074b008d 100644 --- a/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx +++ b/assets/entrepot/pages/service/wfs/WfsServiceForm.tsx @@ -195,7 +195,7 @@ const WfsServiceForm: FC = ({ datastoreId, vectorDbId, offe // Definition du schema const schemas = {}; schemas[STEPS.TABLES_INFOS] = yup.object().shape({ - selected_tables: yup.array(yup.string()).min(1, "Veuillez choisir au moins une table").required("Veuillez choisir au moins une table"), + selected_tables: yup.array(yup.string()).min(1, t("tables_info_form.error.required")).required(t("tables_info_form.error.required")), table_infos: yup.lazy(() => { if (!selectedTableNamesList || selectedTableNamesList.length === 0) { return yup.mixed().nullable().notRequired(); @@ -212,8 +212,8 @@ const WfsServiceForm: FC = ({ datastoreId, vectorDbId, offe } return regex.public_name.test(value); }), - title: yup.string().trim(t("trimmed_error")).strict(true).required(`Le titre de la table ${table} est obligatoire`), - description: yup.string().trim(t("trimmed_error")).strict(true).required(`Le résumé du contenu de la table ${table} est obligatoire`), + title: yup.string().trim(t("trimmed_error")).strict(true).required(t("tables_info_form.title.error.required", { table })), + description: yup.string().trim(t("trimmed_error")).strict(true).required(t("tables_info_form.description.error.required", { table })), keywords: yup.array().of(yup.string()), }); }); diff --git a/assets/i18n/Common.locale.tsx b/assets/i18n/Common.locale.tsx index a38357fd..ef18bfb9 100644 --- a/assets/i18n/Common.locale.tsx +++ b/assets/i18n/Common.locale.tsx @@ -32,6 +32,7 @@ const { i18n } = declareComponentKeys< | "next_step" | "url_copied" | "copy_to_clipboard" + | "go_to_content" >()("Common"); export type I18n = typeof i18n; @@ -66,6 +67,7 @@ export const commonFrTranslations: Translations<"fr">["Common"] = { next_step: "Étape suivante", url_copied: "URL copiée", copy_to_clipboard: "Copier dans le presse-papier", + go_to_content: "Aller au contenu", }; export const commonEnTranslations: Translations<"en">["Common"] = { @@ -98,5 +100,6 @@ export const commonEnTranslations: Translations<"en">["Common"] = { previous_step: "Previous step", next_step: "Next step", url_copied: "URL copied", - copy_to_clipboard: "Copier dans le presse-papier", + copy_to_clipboard: "Copy to clipboard", + go_to_content: "Go to content", }; diff --git a/assets/i18n/languages/en.tsx b/assets/i18n/languages/en.tsx index a6ecfd49..c622a8b9 100644 --- a/assets/i18n/languages/en.tsx +++ b/assets/i18n/languages/en.tsx @@ -2,21 +2,25 @@ import { datastoreNavItemsEnTranslations } from "../../config/navItems/datastore import { navItemsEnTranslations } from "../../config/navItems/navItems.locale"; import { AccessesRequestEnTranslations } from "../../entrepot/pages/accesses-request/AccessesRequest.locale"; import { AddMemberEnTranslations } from "../../entrepot/pages/communities/AddMember/AddMember.locale"; +import { CommunityListEnTranslations } from "../../entrepot/pages/communities/CommunityList/CommunityList.locale"; import { CommunityMembersEnTranslations } from "../../entrepot/pages/communities/CommunityMembers/CommunityMembers.locale"; import { RightsEnTranslations } from "../../entrepot/pages/communities/Rights.locale"; import { DashboardProEnTranslations } from "../../entrepot/pages/dashboard/DashboardPro.locale"; import { DatasheetListEnTranslations } from "../../entrepot/pages/datasheet/DatasheetList/DatasheetList.locale"; -import { DatasheetUploadFormEnTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale"; +import { DatasheetUploadFormEnTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale"; +import { DatasheetUploadIntegrationEnTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale"; import { PyramidRasterListEnTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterList.locale"; import { PyramidVectorListEnTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale"; import { VectorDbListEnTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale"; import { DatasheetViewEnTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale"; +import { DatastoreCreationFormEnTranslations } from "../../entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale"; import { DatastorePermissionsEnTranslations } from "../../entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale"; import { DatastoreManageStorageEnTranslations } from "../../entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale"; import { AccessRestrictionsEnTranslations } from "../../entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.locale"; import { TableSelectionEnTranslations } from "../../entrepot/pages/service/common/TableSelection/TableSelection.locale"; import { MetadatasFormEnTranslations } from "../../entrepot/pages/service/metadata/MetadataForm.locale"; import { ValidationMetadatasEnTranslations } from "../../entrepot/pages/service/metadata/MetadataValidation.locale"; +import { PyramidVectorGenerateFormEnTranslations } from "../../entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale"; import { PyramidVectorTmsServiceFormEnTranslations } from "../../entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale"; import { StyleEnTranslations } from "../../entrepot/pages/service/view/Style/Style.locale"; import { WfsServiceFormEnTranslations } from "../../entrepot/pages/service/wfs/WfsServiceForm.locale"; @@ -48,6 +52,9 @@ export const translations: Translations<"en"> = { Me: MeEnTranslations, AddMember: AddMemberEnTranslations, CommunityMembers: CommunityMembersEnTranslations, + CommunityList: CommunityListEnTranslations, + DatastoreCreationForm: DatastoreCreationFormEnTranslations, + DatasheetUploadIntegration: DatasheetUploadIntegrationEnTranslations, DashboardPro: DashboardProEnTranslations, MyAccessKeys: MyAccessKeysEnTranslations, UserKeysListTab: UserKeysListTabEnTranslations, @@ -72,6 +79,7 @@ export const translations: Translations<"en"> = { WfsServiceForm: WfsServiceFormEnTranslations, TableSelection: TableSelectionEnTranslations, UploadStyleFile: UploadStyleFileEnTranslations, + PyramidVectorGenerateForm: PyramidVectorGenerateFormEnTranslations, PyramidVectorTmsServiceForm: PyramidVectorTmsServiceFormEnTranslations, PyramidRasterGenerateForm: PyramidRasterGenerateFormEnTranslations, PyramidRasterWmsRasterServiceForm: PyramidRasterWmsRasterServiceFormEnTranslations, diff --git a/assets/i18n/languages/fr.tsx b/assets/i18n/languages/fr.tsx index 837870f7..72db6045 100644 --- a/assets/i18n/languages/fr.tsx +++ b/assets/i18n/languages/fr.tsx @@ -2,21 +2,25 @@ import { datastoreNavItemsFrTranslations } from "../../config/navItems/datastore import { navItemsFrTranslations } from "../../config/navItems/navItems.locale"; import { AccessesRequestFrTranslations } from "../../entrepot/pages/accesses-request/AccessesRequest.locale"; import { AddMemberFrTranslations } from "../../entrepot/pages/communities/AddMember/AddMember.locale"; +import { CommunityListFrTranslations } from "../../entrepot/pages/communities/CommunityList/CommunityList.locale"; import { CommunityMembersFrTranslations } from "../../entrepot/pages/communities/CommunityMembers/CommunityMembers.locale"; import { RightsFrTranslations } from "../../entrepot/pages/communities/Rights.locale"; import { DashboardProFrTranslations } from "../../entrepot/pages/dashboard/DashboardPro.locale"; import { DatasheetListFrTranslations } from "../../entrepot/pages/datasheet/DatasheetList/DatasheetList.locale"; -import { DatasheetUploadFormFrTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale"; +import { DatasheetUploadFormFrTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale"; +import { DatasheetUploadIntegrationFrTranslations } from "../../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale"; import { PyramidRasterListFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidRasterList/PyramidRasterList.locale"; import { PyramidVectorListFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale"; import { VectorDbListFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale"; import { DatasheetViewFrTranslations } from "../../entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView.locale"; +import { DatastoreCreationFormFrTranslations } from "../../entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale"; import { DatastorePermissionsFrTranslations } from "../../entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale"; import { DatastoreManageStorageFrTranslations } from "../../entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale"; import { AccessRestrictionsFrTranslations } from "../../entrepot/pages/service/common/AccessRestrictions/AccessRestrictions.locale"; import { TableSelectionFrTranslations } from "../../entrepot/pages/service/common/TableSelection/TableSelection.locale"; import { MetadatasFormFrTranslations } from "../../entrepot/pages/service/metadata/MetadataForm.locale"; import { ValidationMetadatasFrTranslations } from "../../entrepot/pages/service/metadata/MetadataValidation.locale"; +import { PyramidVectorGenerateFormFrTranslations } from "../../entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale"; import { PyramidVectorTmsServiceFormFrTranslations } from "../../entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale"; import { StyleFrTranslations } from "../../entrepot/pages/service/view/Style/Style.locale"; import { WfsServiceFormFrTranslations } from "../../entrepot/pages/service/wfs/WfsServiceForm.locale"; @@ -48,6 +52,9 @@ export const translations: Translations<"fr"> = { Me: MeFrTranslations, AddMember: AddMemberFrTranslations, CommunityMembers: CommunityMembersFrTranslations, + CommunityList: CommunityListFrTranslations, + DatastoreCreationForm: DatastoreCreationFormFrTranslations, + DatasheetUploadIntegration: DatasheetUploadIntegrationFrTranslations, DashboardPro: DashboardProFrTranslations, MyAccessKeys: MyAccessKeysFrTranslations, UserKeysListTab: UserKeysListTabFrTranslations, @@ -72,6 +79,7 @@ export const translations: Translations<"fr"> = { WfsServiceForm: WfsServiceFormFrTranslations, TableSelection: TableSelectionFrTranslations, UploadStyleFile: UploadStyleFileFrTranslations, + PyramidVectorGenerateForm: PyramidVectorGenerateFormFrTranslations, PyramidVectorTmsServiceForm: PyramidVectorTmsServiceFormFrTranslations, PyramidRasterGenerateForm: PyramidRasterGenerateFormFrTranslations, PyramidRasterWmsRasterServiceForm: PyramidRasterWmsRasterServiceFormFrTranslations, diff --git a/assets/i18n/types.ts b/assets/i18n/types.ts index f13dbae6..43c50b73 100644 --- a/assets/i18n/types.ts +++ b/assets/i18n/types.ts @@ -23,6 +23,8 @@ export type ComponentKey = | import("../entrepot/pages/users/me/Me.locale").I18n | import("../entrepot/pages/communities/AddMember/AddMember.locale").I18n | import("../entrepot/pages/communities/CommunityMembers/CommunityMembers.locale").I18n + | import("../entrepot/pages/communities/CommunityList/CommunityList.locale").I18n + | import("../entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm.locale").I18n | import("../entrepot/pages/dashboard/DashboardPro.locale").I18n | import("../entrepot/pages/users/access-keys/MyAccessKeys.locale").I18n | import("../entrepot/pages/users/keys/UserKeysListTab/UserKeysListTab.locale").I18n @@ -34,7 +36,8 @@ export type ComponentKey = | import("../pages/assistance/contact/Contact.locale").I18n | import("../entrepot/pages/datastore/ManageStorage/DatastoreManageStorage.locale").I18n | import("../entrepot/pages/datastore/ManagePermissions/DatastorePermissions.locale").I18n - | import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm.locale").I18n + | import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm.locale").I18n + | import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegration.locale").I18n | import("../entrepot/pages/datasheet/DatasheetList/DatasheetList.locale").I18n | import("../entrepot/pages/datasheet/DatasheetView/DatasetListTab/VectorDbList/VectorDbList.locale").I18n | import("../entrepot/pages/datasheet/DatasheetView/DatasetListTab/PyramidVectorList/PyramidVectorList.locale").I18n @@ -48,6 +51,7 @@ export type ComponentKey = | import("../entrepot/pages/service/wms-vector/WmsVectorServiceForm.locale").I18n | import("../entrepot/pages/service/wfs/WfsServiceForm.locale").I18n | import("../entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm.locale").I18n + | import("../entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm.locale").I18n | import("../entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm.locale").I18n | import("../entrepot/pages/service/wms-raster-wmts/PyramidRasterWmsRasterServiceForm/PyramidRasterWmsRasterServiceForm.locale").I18n | import("../entrepot/pages/service/wms-raster-wmts/PyramidRasterWmtsServiceForm/PyramidRasterWmtsServiceForm.locale").I18n diff --git a/assets/modules/entrepot/breadcrumbs/Breadcrumb.locale.tsx b/assets/modules/entrepot/breadcrumbs/Breadcrumb.locale.tsx index 9f62d151..8b209041 100644 --- a/assets/modules/entrepot/breadcrumbs/Breadcrumb.locale.tsx +++ b/assets/modules/entrepot/breadcrumbs/Breadcrumb.locale.tsx @@ -5,7 +5,7 @@ const { i18n } = declareComponentKeys< | "dashboard_pro" | "about" | "contact" - | "contact_thanks" + | "contact_confirmation" | "news" | "faq" | "sitemap" @@ -54,7 +54,7 @@ export const BreadcrumbFrTranslations: Translations<"fr">["Breadcrumb"] = { dashboard_pro: "Tableau de bord", about: "A propos", contact: "Nous écrire", - contact_thanks: "Demande envoyée", + contact_confirmation: "Demande envoyée", news: "Actualités", faq: "Questions fréquentes", sitemap: "Plan du site", @@ -102,7 +102,7 @@ export const BreadcrumbEnTranslations: Translations<"en">["Breadcrumb"] = { dashboard_pro: "Dashboard", about: "About", contact: "Contact us", - contact_thanks: "Request sent", + contact_confirmation: "Request sent", news: "News", faq: "frequently asked questions", sitemap: "Sitemap", diff --git a/assets/modules/entrepot/breadcrumbs/Breadcrumb.ts b/assets/modules/entrepot/breadcrumbs/Breadcrumb.ts index fe469728..52692c9f 100644 --- a/assets/modules/entrepot/breadcrumbs/Breadcrumb.ts +++ b/assets/modules/entrepot/breadcrumbs/Breadcrumb.ts @@ -29,7 +29,7 @@ const getBreadcrumb = (route: Route, datastore?: Datastore): Brea case "service_status": return { ...defaultProps, currentPageLabel: t(route.name) }; - case "contact_thanks": + case "contact_confirmation": defaultProps.segments.push({ label: t("contact"), linkProps: routes.contact().link }); return { ...defaultProps, currentPageLabel: t(route.name) }; case "news_list": diff --git a/assets/pages/assistance/contact/Contact.locale.tsx b/assets/pages/assistance/contact/Contact.locale.tsx index 50731518..daa56e7d 100644 --- a/assets/pages/assistance/contact/Contact.locale.tsx +++ b/assets/pages/assistance/contact/Contact.locale.tsx @@ -23,6 +23,10 @@ const { i18n } = declareComponentKeys< | "message_sent" | "send" | { K: "form.infos"; P: { personalDataLinkProps: RegisteredLinkProps }; R: JSX.Element } + | "contact_confirmation.title" + | "contact_confirmation.success.title" + | { K: "contact_confirmation.success.description"; P: { homeLink: RegisteredLinkProps }; R: JSX.Element } + | "contact_confirmation.continue" >()("Contact"); export type I18n = typeof i18n; @@ -57,6 +61,17 @@ export const ContactFrTranslations: Translations<"fr">["Contact"] = { {"En savoir plus sur la gestion des données à caractère personnel"}. ), + + "contact_confirmation.title": "Demande envoyée", + "contact_confirmation.success.title": "Votre message a bien été envoyé", + "contact_confirmation.success.description": ({ homeLink }) => ( + <> + Vous recevrez dans les prochaines minutes un accusé de réception récapitulant votre demande. +
+ Cordialement, l’équipe de cartes.gouv.fr. + + ), + "contact_confirmation.continue": "Poursuivre", }; export const ContactEnTranslations: Translations<"en">["Contact"] = { @@ -90,4 +105,8 @@ export const ContactEnTranslations: Translations<"en">["Contact"] = { {"Learn more about how personal data is stored and used"}. ), + "contact_confirmation.title": undefined, + "contact_confirmation.success.title": undefined, + "contact_confirmation.success.description": undefined, + "contact_confirmation.continue": undefined, }; diff --git a/assets/pages/assistance/contact/Contact.tsx b/assets/pages/assistance/contact/Contact.tsx index d36d74b5..3743ef56 100644 --- a/assets/pages/assistance/contact/Contact.tsx +++ b/assets/pages/assistance/contact/Contact.tsx @@ -64,9 +64,8 @@ const Contact = () => { jsonFetch<{ success: boolean }>(url, { method: "POST" }, getFormValues()) .then((response) => { - console.log(response); if (response?.success === true) { - routes.contact_thanks().push(); + routes.contact_confirmation().push(); } }) .catch((error) => { diff --git a/assets/pages/assistance/contact/ContactConfirmation.tsx b/assets/pages/assistance/contact/ContactConfirmation.tsx new file mode 100644 index 00000000..885c8ad0 --- /dev/null +++ b/assets/pages/assistance/contact/ContactConfirmation.tsx @@ -0,0 +1,27 @@ +import { fr } from "@codegouvfr/react-dsfr"; +import Alert from "@codegouvfr/react-dsfr/Alert"; +import Button from "@codegouvfr/react-dsfr/Button"; + +import AppLayout from "../../../components/Layout/AppLayout"; +import { useTranslation } from "../../../i18n"; +import { routes } from "../../../router/router"; + +const ContactConfirmation = () => { + const { t } = useTranslation("Contact"); + + return ( + +

{t("contact_confirmation.title")}

+ +
+ +
+
+ ); +}; + +export default ContactConfirmation; diff --git a/assets/pages/assistance/contact/Thanks.tsx b/assets/pages/assistance/contact/Thanks.tsx deleted file mode 100644 index 8cf7fbfa..00000000 --- a/assets/pages/assistance/contact/Thanks.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { fr } from "@codegouvfr/react-dsfr"; -import Alert from "@codegouvfr/react-dsfr/Alert"; -import Button from "@codegouvfr/react-dsfr/Button"; - -import AppLayout from "../../../components/Layout/AppLayout"; -import Translator from "../../../modules/Translator"; -import { routes } from "../../../router/router"; - -const Thanks = () => { - const link = { __html: Translator.trans("mailer.signature", { href: routes.home().href }) }; - - return ( - - -

{Translator.trans("contact.thanks.description")}

-

- - } - severity="success" - /> -

- -
-
- ); -}; - -export default Thanks; diff --git a/assets/router/RouterRenderer.tsx b/assets/router/RouterRenderer.tsx index c219b310..9a39db20 100644 --- a/assets/router/RouterRenderer.tsx +++ b/assets/router/RouterRenderer.tsx @@ -15,7 +15,7 @@ const Offer = lazy(() => import("../pages/Offer")); const Join = lazy(() => import("../pages/Join")); const Faq = lazy(() => import("../pages/assistance/Faq")); const Contact = lazy(() => import("../pages/assistance/contact/Contact")); -const Thanks = lazy(() => import("../pages/assistance/contact/Thanks")); +const ContactConfirmation = lazy(() => import("../pages/assistance/contact/ContactConfirmation")); const ServiceStatus = lazy(() => import("../pages/assistance/ServiceStatus")); const NewsList = lazy(() => import("../pages/news/NewsList")); const NewsArticle = lazy(() => import("../pages/news/NewsArticle")); @@ -38,22 +38,22 @@ const EditPermissionForm = lazy(() => import("../entrepot/pages/datastore/Manage const DashboardPro = lazy(() => import("../entrepot/pages/dashboard/DashboardPro")); const DatasheetList = lazy(() => import("../entrepot/pages/datasheet/DatasheetList/DatasheetList")); -const DatasheetUploadForm = lazy(() => import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm")); +const DatasheetUploadForm = lazy(() => import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadForm/DatasheetUploadForm")); const DatasheetUploadIntegrationPage = lazy(() => import("../entrepot/pages/datasheet/DatasheetNew/DatasheetUploadIntegration/DatasheetUploadIntegrationPage")); const DatasheetView = lazy(() => import("../entrepot/pages/datasheet/DatasheetView/DatasheetView/DatasheetView")); const StoredDataDetails = lazy(() => import("../entrepot/pages/data_details/StoredDataDetails")); const UploadDetails = lazy(() => import("../entrepot/pages/data_details/UploadDetails")); -const DatastoreCreationForm = lazy(() => import("../entrepot/pages/datastore/DatastoreCreationForm")); -const Confirm = lazy(() => import("../entrepot/pages/datastore/Confirmation")); +const DatastoreCreationForm = lazy(() => import("../entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationForm")); +const DatastoreCreationRequestConfirmation = lazy(() => import("../entrepot/pages/datastore/DatastoreCreationForm/DatastoreCreationRequestConfirmation")); const CommunityMembers = lazy(() => import("../entrepot/pages/communities/CommunityMembers/CommunityMembers")); -const CommunityList = lazy(() => import("../entrepot/pages/communities/CommunityList")); +const CommunityList = lazy(() => import("../entrepot/pages/communities/CommunityList/CommunityList")); const WfsServiceForm = lazy(() => import("../entrepot/pages/service/wfs/WfsServiceForm")); const WmsVectorServiceForm = lazy(() => import("../entrepot/pages/service/wms-vector/WmsVectorServiceForm")); -const PyramidVectorGenerateForm = lazy(() => import("../entrepot/pages/service/tms/PyramidVectorGenerateForm")); +const PyramidVectorGenerateForm = lazy(() => import("../entrepot/pages/service/tms/PyramidVectorGenerateForm/PyramidVectorGenerateForm")); const PyramidVectorTmsServiceForm = lazy(() => import("../entrepot/pages/service/tms/PyramidVectorTmsServiceForm/PyramidVectorTmsServiceForm")); const PyramidRasterGenerateForm = lazy(() => import("../entrepot/pages/service/wms-raster-wmts/PyramidRasterGenerateForm/PyramidRasterGenerateForm")); const PyramidRasterWmsRasterServiceForm = lazy( @@ -99,8 +99,8 @@ const RouterRenderer: FC = () => { return ; case "contact": return ; - case "contact_thanks": - return ; + case "contact_confirmation": + return ; case "news_list": return ; case "news_article": @@ -146,7 +146,7 @@ const RouterRenderer: FC = () => { case "datastore_create_request": return ; case "datastore_create_request_confirm": - return ; + return ; case "members_list": return ; case "join_community": diff --git a/assets/router/router.ts b/assets/router/router.ts index 3dd6b46c..43687bce 100644 --- a/assets/router/router.ts +++ b/assets/router/router.ts @@ -18,7 +18,7 @@ const routeDefs = { about: defineRoute(`${appRoot}/a-propos`), documentation: defineRoute(`${appRoot}/documentation`), contact: defineRoute(`${appRoot}/nous-ecrire`), - contact_thanks: defineRoute(`${appRoot}/nous-ecrire/demande-envoyee`), + contact_confirmation: defineRoute(`${appRoot}/nous-ecrire/demande-envoyee`), news_list: defineRoute(`${appRoot}/actualites`), news_article: defineRoute( { @@ -53,6 +53,7 @@ const routeDefs = { // Demande de creation d'un datastore datastore_create_request: defineRoute(`${appRoot}/entrepot/demande-de-creation`), + datastore_create_request_confirm: defineRoute(`${appRoot}/entrepot/demande-de-creation/demande-envoyee`), // Demande pour rejoindre une communaute join_community: defineRoute(`${appRoot}/rejoindre-des-communautes`), @@ -73,8 +74,6 @@ const routeDefs = { (p) => `${appRoot}/demande-acces/${p.fileIdentifier}` ), - datastore_create_request_confirm: defineRoute(`${appRoot}/demande-acces/demande-envoyee`), - datastore_manage_storage: defineRoute( { datastoreId: param.path.string, @@ -293,7 +292,7 @@ export const publicRoutes: typeof knownRoutes = [ "about", "documentation", "contact", - "contact_thanks", + "contact_confirmation", "news_list", "news_article", "faq",