Skip to content

Commit

Permalink
960 traduction footer (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
RochDLY authored Nov 8, 2023
1 parent 0da5c4b commit d22a780
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions front/src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useCallback } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { Switch, Route, Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next'

import styles from './header.module.scss'
import { HelpCircle } from "react-feather";
Expand All @@ -9,6 +10,7 @@ function Footer () {
const dispatch = useDispatch()
const userHasConsent = useSelector(state => state.userPreferences.trackingConsent)
const toggleConsent = useCallback(() => dispatch({ type: 'USER_PREFERENCES_TOGGLE', key: 'trackingConsent' }), [])
const { t } = useTranslation()

return (<Switch>
<Route path="*/preview" />
Expand All @@ -22,18 +24,18 @@ function Footer () {
rel="noopener noreferrer"
>
<HelpCircle className={styles.linkIcon} size={14} />
Documentation
{t('footer.documentation.link')}
</a></li>
<li>
<a href="https://github.com/EcrituresNumeriques/stylo/releases" rel="noopener noreferrer" target="_blank">
Changelog
{t('footer.changelog.link')}
</a>
</li>
<li><Link to="/privacy">Privacy</Link></li>
<li><Link to="/privacy">{t('footer.privacy.link')}</Link></li>
{ import.meta.env.SNOWPACK_MATOMO_URL && (<li>
<label className={styles.consentLabel}>
<input type="checkbox" checked={userHasConsent} onChange={toggleConsent} disabled={true} />
I accept to share my navigation stats
{t('footer.navStats.checkbox')}
</label>
</li>) }
</ul>
Expand Down
6 changes: 5 additions & 1 deletion front/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,9 @@
"export.sectionChapters.unnumbered": "Section and Chapters: unnumbered",
"export.bookDivision.part": "Book division: Part & chapters",
"export.bookDivision.chapter": "Book division: Chapter only",
"export.submitForm.button": "Export with these settings"
"export.submitForm.button": "Export with these settings",
"footer.documentation.link": "Documentation",
"footer.changelog.link": "Changelog",
"footer.navStats.checkbox": "I accept to share my navigation stats",
"footer.privacy.link": "Privacy"
}
6 changes: 5 additions & 1 deletion front/src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,9 @@
"export.sectionChapters.unnumbered": "Section et chapitres: non numérotés",
"export.bookDivision.part": "Division du corpus : parties et chapitres",
"export.bookDivision.chapter": "Division du corpus : chapitres seulement",
"export.submitForm.button": "Exporter avec ces paramètres"
"export.submitForm.button": "Exporter avec ces paramètres",
"footer.documentation.link": "Documentation",
"footer.changelog.link": "Journal des modifications",
"footer.navStats.checkbox": "J'accepte de partager mes statistiques de navigation",
"footer.privacy.link": "Confidentialité"
}

0 comments on commit d22a780

Please sign in to comment.