-
À propos des cookies sur scanr.enseignementsup-recherche.gouv.fr
+
+ {intl.formatMessage({ id: "layout.consent.title" })}
+
-
Bienvenue ! Nous utilisons des cookies pour améliorer votre expérience et les services disponibles sur ce site. Pour en savoir plus, visitez la page Données personnelles et cookies . Vous pouvez, à tout moment, avoir le contrôle sur les cookies que vous souhaitez activer.
+
+ {intl.formatMessage({ id: "layout.consent.content" })}
+
@@ -17,7 +34,7 @@ export default function Consent() {
title="Autoriser tous les cookies"
onClick={() => setConsent({ twitter: 1, matomo: 1, youtube: 1, facebook: 1, linkedin: 1 })}
>
- Tout accepter
+ {intl.formatMessage({ id: "layout.consent.accept-all" })}
@@ -26,7 +43,7 @@ export default function Consent() {
title="Refuser tous les cookies"
onClick={() => setConsent({ twitter: 0, matomo: 0, youtube: 0, facebook: 0, linkedin: 0 })}
>
- Tout refuser
+ {intl.formatMessage({ id: "layout.consent.refuse-all" })}
@@ -36,7 +53,7 @@ export default function Consent() {
aria-controls={dialogId}
title="Personnaliser les cookies"
>
- Personnaliser
+ {intl.formatMessage({ id: "layout.consent.customize" })}
@@ -49,17 +66,18 @@ export default function Consent() {
- Fermer
+ {intl.formatMessage({ id: "layout.consent.cookies.close" })}
- Panneau de gestion des cookies
+ {intl.formatMessage({ id: "layout.consent.cookies" })}
- Préférences pour tous les services. Données personnelles et cookies
+
+ {intl.formatMessage({ id: "layout.consent.cookies.preferences" })}
@@ -77,7 +95,7 @@ export default function Consent() {
}}
/>
- Tout accepter
+ {intl.formatMessage({ id: "layout.consent.accept-all" })}
@@ -95,7 +113,7 @@ export default function Consent() {
}}
/>
- Tout refuser
+ {intl.formatMessage({ id: "layout.consent.refuse-all" })}
@@ -103,7 +121,9 @@ export default function Consent() {
- Statistique
+
+ {intl.formatMessage({ id: "layout.consent.cookies.finality.stats" })}
+
- Les cookies statistiques aident, par la collecte d'informations anonymisées, à comprendre comment les visiteurs interagissent avec scanR.
+ {intl.formatMessage({ id: "layout.consent.cookies.finality.stats.desc" })}
- Partage
+
+ {intl.formatMessage({ id: "layout.consent.cookies.finality.share" })}
+
- Afin de pouvoir partager les pages de scanR, il est nécessaire d'accepter les cookies de partage des réseaux sociaux.
+ {intl.formatMessage({ id: "layout.consent.cookies.finality.share.desc" })}
- Voir plus de détails
+
+ {intl.formatMessage({ id: "layout.consent.cookies.finality.toggle" })}
+
- Facebook
+
+ Youtube
+
+
+
+
+
+
+
+ Facebook
+
@@ -226,7 +285,7 @@ export default function Consent() {
onChange={() => { consent.twitter = 1 }}
/>
- Accepter
+ {intl.formatMessage({ id: "layout.consent.cookies.accept" })}
@@ -238,7 +297,7 @@ export default function Consent() {
onChange={() => { consent.twitter = 0 }}
/>
- Refuser
+ {intl.formatMessage({ id: "layout.consent.cookies.refuse" })}
@@ -258,7 +317,7 @@ export default function Consent() {
onChange={() => { consent.linkedin = 1 }}
/>
- Accepter
+ {intl.formatMessage({ id: "layout.consent.cookies.accept" })}
@@ -270,7 +329,7 @@ export default function Consent() {
onChange={() => { consent.linkedin = 0 }}
/>
- Refuser
+ {intl.formatMessage({ id: "layout.consent.cookies.refuse" })}
@@ -301,6 +360,6 @@ export default function Consent() {
- >
+
)
}
\ No newline at end of file
diff --git a/client/src/layout/components/consent/locales/en.json b/client/src/layout/components/consent/locales/en.json
new file mode 100644
index 00000000..9f8ed995
--- /dev/null
+++ b/client/src/layout/components/consent/locales/en.json
@@ -0,0 +1,19 @@
+{
+ "layout.consent.title": "About cookies on scanr.enseignementsup-recherche.gouv.fr",
+ "layout.consent.content": "Welcome! We use cookies to enhance your experience and the services available on this site. You can have control over the cookies you wish to enable at any time.",
+ "layout.consent.accept-all": "Accept All",
+ "layout.consent.refuse-all": "Refuse All",
+ "layout.consent.customize": "Customize",
+ "layout.consent.confirm": "Confirm My Choices",
+ "layout.consent.cookies.close": "Close",
+ "layout.consent.cookies": "Cookie Management Panel",
+ "layout.consent.cookies.preferences": "Preferences for all services.",
+ "layout.consent.cookies.all.desc": "To learn more, visit the Personal Data and Cookies page.",
+ "layout.consent.cookies.finality.stats": "Statistics",
+ "layout.consent.cookies.finality.stats.desc": "Statistical cookies help understand how visitors interact with scanR by collecting anonymized information.",
+ "layout.consent.cookies.finality.share": "Sharing",
+ "layout.consent.cookies.finality.share.desc": "To be able to share scanR pages, it is necessary to accept social media sharing cookies.",
+ "layout.consent.cookies.accept": "Accept",
+ "layout.consent.cookies.refuse": "Refuse",
+ "layout.consent.cookies.finality.toggle": "See more details"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/consent/locales/fr.json b/client/src/layout/components/consent/locales/fr.json
new file mode 100644
index 00000000..c28ec566
--- /dev/null
+++ b/client/src/layout/components/consent/locales/fr.json
@@ -0,0 +1,19 @@
+{
+ "layout.consent.title": "À propos des cookies sur scanr.enseignementsup-recherche.gouv.fr",
+ "layout.consent.content": "Bienvenue ! Nous utilisons des cookies pour améliorer votre expérience et les services disponibles sur ce site. Vous pouvez, à tout moment, avoir le contrôle sur les cookies que vous souhaitez activer.",
+ "layout.consent.accept-all": "Tout accepter",
+ "layout.consent.refuse-all": "Tout refuser",
+ "layout.consent.customize": "Personnaliser",
+ "layout.consent.confirm": "Confirmer mes choix",
+ "layout.consent.cookies.close": "Fermer",
+ "layout.consent.cookies": "Panneau de gestion des cookies",
+ "layout.consent.cookies.preferences": "Préférences pour tous les services.",
+ "layout.consent.cookies.all.desc": "Pour en savoir plus, visitez la page Données personnelles et cookies.",
+ "layout.consent.cookies.finality.stats": "Statistique",
+ "layout.consent.cookies.finality.stats.desc": "Les cookies statistiques aident, par la collecte d'informations anonymisées, à comprendre comment les visiteurs interagissent avec scanR.",
+ "layout.consent.cookies.finality.share": "Partage",
+ "layout.consent.cookies.finality.share.desc": "Afin de pouvoir partager les pages de scanR, il est nécessaire d'accepter les cookies de partage des réseaux sociaux.",
+ "layout.consent.cookies.accept": "Accepter",
+ "layout.consent.cookies.refuse": "Refuser",
+ "layout.consent.cookies.finality.toggle": "Voir plus de détails"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/footer/index.tsx b/client/src/layout/components/footer/index.tsx
new file mode 100644
index 00000000..4a46835f
--- /dev/null
+++ b/client/src/layout/components/footer/index.tsx
@@ -0,0 +1,302 @@
+import cn from "classnames";
+import { Col, Container, Link, Logo, Row, Title, useDSFRConfig } from "@dataesr/dsfr-plus";
+import { Footer, FooterBody, FooterBottom, FooterTop } from "../../../components/footer";
+import { RawIntlProvider, createIntl } from "react-intl";
+import SwitchTheme from "../switch-theme";
+import useConsent from "../../../hooks/useConsent";
+import { version } from "react";
+import styles from "./styles.module.scss";
+
+const modules = import.meta.glob('./locales/*.json', { eager: true, import: 'default' })
+const messages = Object.keys(modules).reduce((acc, key) => {
+ const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
+ if (locale) {
+ return { ...acc, [locale]: modules[key] }
+ }
+ return acc;
+}, {});
+
+export default function MainFooter() {
+ const { locale } = useDSFRConfig();
+ const intl = createIntl({ locale, messages: messages[locale] });
+ const { dialogId } = useConsent();
+ return (
+
+
+
+
+
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.help",
+ })}
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.faq",
+ })}
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.team",
+ })}
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.resources",
+ })}
+
+
+ {/*
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.tutorial",
+ })}
+
+ */}
+ {/*
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.glossary",
+ })}
+
+ */}
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.contact",
+ })}
+
+
+
+
+
+
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.follow",
+ })}
+
+
+
+
+ X
+
+
+
+
+ Linkedin
+
+
+
+
+ Facebook
+
+
+
+
+
+
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.top.about.also",
+ })}
+
+
+
+
+ GitHub
+ {version && ` – v${version}`}
+
+
+
+
+ CurieXplore
+
+
+
+
+ Baromètre de la Science Ouverte
+
+
+
+
+ #dataESR
+
+
+
+
+ Plateforme Open Data
+
+
+
+
+
+
+
+
+
+
+
+
+ legifrance.gouv.fr
+
+
+ gouvernement.fr
+
+
+ service-public.fr
+
+
+ data.gouv.fr
+
+
+
+
+ {intl.formatMessage({
+ id: "layout.footer.legal-notice",
+ })}
+
+
+ {intl.formatMessage({
+ id: "layout.footer.personal-data",
+ })}
+
+
+ {intl.formatMessage({
+ id: "layout.footer.accessibility",
+ })}
+
+
+ {intl.formatMessage({
+ id: "layout.footer.cookies",
+ })}
+
+
+ {intl.formatMessage({
+ id: "layout.footer.switch-theme",
+ })}
+
+
+
+
+
+ );
+}
diff --git a/client/src/layout/components/footer/locales/en.json b/client/src/layout/components/footer/locales/en.json
new file mode 100644
index 00000000..3ed1c1fd
--- /dev/null
+++ b/client/src/layout/components/footer/locales/en.json
@@ -0,0 +1,18 @@
+{
+ "layout.footer.top.about": "About",
+ "layout.footer.top.about.faq": "FAQ",
+ "layout.footer.top.about.team": "Team",
+ "layout.footer.top.about.help": "Help",
+ "layout.footer.top.about.also": "See also",
+ "layout.footer.top.about.follow": "Follow us",
+ "layout.footer.top.about.resources": "Data sources",
+ "layout.footer.top.about.tutorial": "Tutorial",
+ "layout.footer.top.about.glossary": "Glossary",
+ "layout.footer.top.about.contact": "Contact",
+ "layout.footer.tagline": "Explore the world of French Research and Innovation with scanR",
+ "layout.footer.legal-notice": "Legal Notice",
+ "layout.footer.personal-data": "Personal Data",
+ "layout.footer.cookies": "Cookies",
+ "layout.footer.accessibility": "Accessibility",
+ "layout.footer.switch-theme": "Theme"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/footer/locales/fr.json b/client/src/layout/components/footer/locales/fr.json
new file mode 100644
index 00000000..b05681e8
--- /dev/null
+++ b/client/src/layout/components/footer/locales/fr.json
@@ -0,0 +1,18 @@
+{
+ "layout.footer.top.about": "A propos",
+ "layout.footer.top.about.faq": "FAQ",
+ "layout.footer.top.about.team": "L'équipe",
+ "layout.footer.top.about.help": "Aide",
+ "layout.footer.top.about.also": "Voir aussi",
+ "layout.footer.top.about.follow": "Nous suivre",
+ "layout.footer.top.about.resources": "Sources de données",
+ "layout.footer.top.about.tutorial": "Tutoriel",
+ "layout.footer.top.about.glossary": "Glossaire",
+ "layout.footer.top.about.contact": "Contact",
+ "layout.footer.tagline": "Explorez le monde de la Recherche et de l'Innovation française avec scanR",
+ "layout.footer.legal-notice": "Mentions légales",
+ "layout.footer.personal-data": "Données personnelles",
+ "layout.footer.cookies": "Cookies",
+ "layout.footer.accessibility": "Accessibilité",
+ "layout.footer.switch-theme": "Thème"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/footer/styles.module.scss b/client/src/layout/components/footer/styles.module.scss
new file mode 100644
index 00000000..0f01013c
--- /dev/null
+++ b/client/src/layout/components/footer/styles.module.scss
@@ -0,0 +1,11 @@
+.text-right {
+ text-align: right;
+}
+
+.text-left {
+ text-align: left;
+}
+
+.text-center {
+ text-align: center;
+}
\ No newline at end of file
diff --git a/client/src/layout/Header.tsx b/client/src/layout/components/header/index.tsx
similarity index 75%
rename from client/src/layout/Header.tsx
rename to client/src/layout/components/header/index.tsx
index 44f29e57..d0aaca02 100644
--- a/client/src/layout/Header.tsx
+++ b/client/src/layout/components/header/index.tsx
@@ -9,17 +9,28 @@ import {
Nav,
FastAccess,
Button,
+ useDSFRConfig,
// Autocomplete,
// AutocompleteItem,
// useAutocompleteList,
// useDSFRConfig,
} from '@dataesr/dsfr-plus';
-import { FormattedMessage, useIntl } from 'react-intl';
-import SwitchLanguage from '../components/switch-language';
+import { createIntl } from 'react-intl';
+import SwitchLanguage from '../../../components/switch-language';
// import { autocompleteOrganizations } from '../api/organizations/autocomplete';
// import { LightOrganization } from '../types/organization';
// import getLangFieldValue from '../utils/lang';
+const modules = import.meta.glob('./locales/*.json', { eager: true, import: 'default' })
+const messages = Object.keys(modules).reduce((acc, key) => {
+ const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
+ if (locale) {
+ return { ...acc, [locale]: modules[key] }
+ }
+ return acc;
+}, {});
+
+
const languages = [
{ shortName: 'FR', fullName: 'Français', key: 'fr' },
{ shortName: 'EN', fullName: 'English', key: 'en' },
@@ -29,9 +40,9 @@ const languages = [
];
export default function Header() {
- // const { locale } = useDSFRConfig();
+ const { locale } = useDSFRConfig();
+ const intl = createIntl({ locale, messages: messages[locale] });
const { pathname } = useLocation();
- const intl = useIntl();
// const authorsAutocompletedList = useAutocompleteList
({
// async load({ filterText }) {
@@ -49,7 +60,7 @@ export default function Header() {
- {intl.formatMessage({ id: "layout.switch-theme" })}
+ {intl.formatMessage({ id: "layout.header.switch-theme" })}
@@ -77,25 +88,27 @@ export default function Header() {
)}
*/}
-
+
+ {intl.formatMessage({ id: "layout.header.nav.home" })}
+
-
+ {intl.formatMessage({ id: "layout.header.nav.search.organizations" })}
-
+ {intl.formatMessage({ id: "layout.header.nav.search.authors" })}
-
+ {intl.formatMessage({ id: "layout.header.nav.search.projects" })}
-
+ {intl.formatMessage({ id: "layout.header.nav.search.publications" })}
-
+ {intl.formatMessage({ id: "layout.header.nav.search.patents" })}
diff --git a/client/src/layout/components/header/locales/en.json b/client/src/layout/components/header/locales/en.json
new file mode 100644
index 00000000..5b64584c
--- /dev/null
+++ b/client/src/layout/components/header/locales/en.json
@@ -0,0 +1,12 @@
+{
+ "layout.header.nav.home": "Home",
+ "layout.header.tagline": "Explore the world of French Research and Innovation",
+ "layout.header.switch-theme": "Display Settings",
+ "layout.header.nav.search": "Search",
+ "layout.header.nav.search.organizations": "Organizations",
+ "layout.header.nav.search.publications": "Publications",
+ "layout.header.nav.search.projects": "Fundings",
+ "layout.header.nav.search.authors": "Authors",
+ "layout.header.nav.search.patents": "Patents",
+ "layout.header.nav.networks": "Explore Networks"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/header/locales/fr.json b/client/src/layout/components/header/locales/fr.json
new file mode 100644
index 00000000..983d23d9
--- /dev/null
+++ b/client/src/layout/components/header/locales/fr.json
@@ -0,0 +1,12 @@
+{
+ "layout.header.nav.home": "Accueil",
+ "layout.header.tagline": "Explorer le monde de la Recherche et de l'Innovation française",
+ "layout.header.switch-theme": "Paramètres d'affichage",
+ "layout.header.nav.search": "Rechercher",
+ "layout.header.nav.search.organizations": "Structures",
+ "layout.header.nav.search.publications": "Publications",
+ "layout.header.nav.search.projects": "Financements",
+ "layout.header.nav.search.authors": "Auteurs",
+ "layout.header.nav.search.patents": "Brevets",
+ "layout.header.nav.networks": "Explorer les réseaux"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/switch-theme/index.tsx b/client/src/layout/components/switch-theme/index.tsx
new file mode 100644
index 00000000..45828d7d
--- /dev/null
+++ b/client/src/layout/components/switch-theme/index.tsx
@@ -0,0 +1,97 @@
+import { useDSFRConfig } from "@dataesr/dsfr-plus";
+import { RawIntlProvider, createIntl } from "react-intl";
+
+
+const modules = import.meta.glob('./locales/*.json', { eager: true, import: 'default' })
+const messages = Object.keys(modules).reduce((acc, key) => {
+ const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
+ if (locale) {
+ return { ...acc, [locale]: modules[key] }
+ }
+ return acc;
+}, {});
+
+export default function SwitchTheme() {
+ const { locale } = useDSFRConfig();
+ const intl = createIntl({ locale, messages: messages[locale] });
+
+ return (
+
+
+
+
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.close" })}
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.title" })}
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.legend" })}
+
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.light" })}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.dark" })}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {intl.formatMessage({ id: "layout.switch-theme.system" })}
+
+ {intl.formatMessage({ id: "layout.switch-theme.system-hint" })}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/client/src/layout/components/switch-theme/locales/en.json b/client/src/layout/components/switch-theme/locales/en.json
new file mode 100644
index 00000000..09dd4650
--- /dev/null
+++ b/client/src/layout/components/switch-theme/locales/en.json
@@ -0,0 +1,9 @@
+{
+ "layout.switch-theme.light": "Light theme",
+ "layout.switch-theme.dark": "Dark theme",
+ "layout.switch-theme.system": "System",
+ "layout.switch-theme.system-hint": "Use system settings",
+ "layout.switch-theme.title": "Display Settings",
+ "layout.switch-theme.legend": "Choose a theme to customize the appearance of the site.",
+ "layout.switch-theme.close": "Close"
+}
\ No newline at end of file
diff --git a/client/src/layout/components/switch-theme/locales/fr.json b/client/src/layout/components/switch-theme/locales/fr.json
new file mode 100644
index 00000000..385fe373
--- /dev/null
+++ b/client/src/layout/components/switch-theme/locales/fr.json
@@ -0,0 +1,9 @@
+{
+ "layout.switch-theme.light": "Thème clair",
+ "layout.switch-theme.dark": "Thème sombre",
+ "layout.switch-theme.system": "Système",
+ "layout.switch-theme.system-hint": "Utilise les paramètres système",
+ "layout.switch-theme.title": "Paramètres d'affichage",
+ "layout.switch-theme.legend": "Choisissez un thème pour personnaliser l’apparence du site.",
+ "layout.switch-theme.close": "Fermer"
+}
\ No newline at end of file
diff --git a/client/src/layout/index.tsx b/client/src/layout/index.tsx
index 21794e4b..8d7fc411 100644
--- a/client/src/layout/index.tsx
+++ b/client/src/layout/index.tsx
@@ -1,25 +1,14 @@
import { Outlet } from 'react-router-dom';
-import { Container, useDSFRConfig } from '@dataesr/dsfr-plus';
-import Header from './Header';
-import MainFooter from './Footer';
-import { IntlProvider } from 'react-intl';
-import Consent from './consent';
+import { Container } from '@dataesr/dsfr-plus';
+import Header from './components/header';
+import MainFooter from './components/footer';
+import Consent from './components/consent';
import ErrorBoundary from '../components/errors/error-boundary';
import APIDeprecationBanner from '../components/api-deprecation-banner';
-const modules = import.meta.glob('./locales/*.json', { eager: true, import: 'default' })
-const messages = Object.keys(modules).reduce((acc, key) => {
- const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
- if (locale) {
- return { ...acc, [locale]: modules[key] }
- }
- return acc;
-}, {});
-
export default function Layout() {
- const { locale } = useDSFRConfig();
return (
-
+ <>
@@ -29,6 +18,6 @@ export default function Layout() {
-
+ >
);
}
diff --git a/client/src/layout/locales/fr.json b/client/src/layout/locales/fr.json
deleted file mode 100644
index 987262cf..00000000
--- a/client/src/layout/locales/fr.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "layout.header.nav.home": "Accueil",
- "layout.header.tagline": "Explorer le monde de la Recherche et de l'Innovation française",
- "layout.header.nav.search": "Rechercher",
- "layout.header.nav.search.organizations": "Structures",
- "layout.header.nav.search.publications": "Publications",
- "layout.header.nav.search.projects": "Financements",
- "layout.header.nav.search.authors": "Auteurs",
- "layout.header.nav.search.patents": "Brevets",
- "layout.footer.top.about": "A propos",
- "layout.footer.top.about.faq": "FAQ",
- "layout.footer.top.about.team": "L'équipe",
- "layout.switch-theme": "Paramètres d'affichage",
- "layout.header.nav.networks": "Explorer les réseaux",
- "layout.footer.tagline": "Explorez le monde de la Recherche et de l'Innovation française avec scanR",
- "layout.footer.legal-notice": "Mentions légales",
- "layout.footer.personal-data": "Données personnelles",
- "layout.footer.cookies": "Cookies",
- "layout.footer.accessibility": "Accessibilité",
- "layout.footer.switch-theme": "Thème"
-}
\ No newline at end of file
diff --git a/client/tsconfig.node.json b/client/tsconfig.node.json
index 42872c59..73dbb0b0 100644
--- a/client/tsconfig.node.json
+++ b/client/tsconfig.node.json
@@ -6,5 +6,7 @@
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
- "include": ["vite.config.ts"]
-}
+ "include": [
+ "vite.config.ts"
+ ]
+}
\ No newline at end of file