|
19 | 19 |
|
20 | 20 | import React from 'react';
|
21 | 21 | import { Container } from 'react-bootstrap';
|
22 |
| -import { Trans } from 'react-i18next'; |
| 22 | +import { Trans, useTranslation } from 'react-i18next'; |
23 | 23 |
|
24 | 24 | import dayjs from 'dayjs';
|
25 | 25 |
|
26 | 26 | import { siteInfoStore } from '@/stores';
|
27 | 27 |
|
28 |
| -const Index = () => { |
| 28 | +const Footer = () => { |
| 29 | + const { t } = useTranslation('translation', { keyPrefix: 'footer' }); // Scoped translations for footer |
29 | 30 | const fullYear = dayjs().format('YYYY');
|
30 | 31 | const siteName = siteInfoStore((state) => state.siteInfo.name);
|
31 | 32 | const cc = `${fullYear} ${siteName}`;
|
| 33 | + |
32 | 34 | return (
|
33 | 35 | <footer className="bg-light">
|
34 | 36 | <Container className="py-3">
|
35 | 37 | <p className="text-center mb-0 small text-secondary">
|
36 |
| - <Trans i18nKey="footer.build_on" values={{ cc }}> |
37 |
| - Powered by |
38 |
| - {/* eslint-disable-next-line react/jsx-no-target-blank */} |
39 |
| - <a href="https://answer.apache.org" target="_blank"> |
| 38 | + <a |
| 39 | + className="me-2" |
| 40 | + href="/privacy" |
| 41 | + target="_blank" |
| 42 | + rel="noopener noreferrer"> |
| 43 | + {t('privacy')} {/* Fetch translated Privacy Policy text */} |
| 44 | + </a> |
| 45 | + <a href="/tos" target="_blank" rel="noopener noreferrer"> |
| 46 | + {t('terms_of_service')}{' '} |
| 47 | + {/* Fetch translated Terms of Service text */} |
| 48 | + </a> |
| 49 | + </p> |
| 50 | + <p className="text-center mb-0 small text-secondary"> |
| 51 | + <Trans i18nKey="build_on" values={{ cc }}> |
| 52 | + Powered by{' '} |
| 53 | + <a |
| 54 | + href="https://answer.apache.org" |
| 55 | + target="_blank" |
| 56 | + rel="noopener noreferrer"> |
40 | 57 | Apache Answer
|
41 | 58 | </a>
|
42 | 59 | - the open-source software that powers Q&A communities.
|
43 | 60 | <br />
|
44 |
| - Made with love. © 2022 Answer. |
| 61 | + Made with love © 2022 Answer. |
45 | 62 | </Trans>
|
46 | 63 | </p>
|
47 | 64 | </Container>
|
48 | 65 | </footer>
|
49 | 66 | );
|
50 | 67 | };
|
51 | 68 |
|
52 |
| -export default React.memo(Index); |
| 69 | +export default React.memo(Footer); |
0 commit comments