Skip to content

Commit e120e29

Browse files
committed
ui: Added privacy policy and terms of service link in the footer( solved #1187)
1 parent f7731bc commit e120e29

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

i18n/en_US.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ ui:
11711171
build_on: >-
11721172
Powered by <1> Apache Answer </1>- the open-source software that powers Q&A
11731173
communities.<br />Made with love © {{cc}}.
1174+
privacy: Privacy Policy
1175+
terms_of_service: Terms of Service
11741176
upload_img:
11751177
name: Change
11761178
loading: loading...

ui/src/components/Footer/index.tsx

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,51 @@
1919

2020
import React from 'react';
2121
import { Container } from 'react-bootstrap';
22-
import { Trans } from 'react-i18next';
22+
import { Trans, useTranslation } from 'react-i18next';
2323

2424
import dayjs from 'dayjs';
2525

2626
import { siteInfoStore } from '@/stores';
2727

28-
const Index = () => {
28+
const Footer = () => {
29+
const { t } = useTranslation('translation', { keyPrefix: 'footer' }); // Scoped translations for footer
2930
const fullYear = dayjs().format('YYYY');
3031
const siteName = siteInfoStore((state) => state.siteInfo.name);
3132
const cc = `${fullYear} ${siteName}`;
33+
3234
return (
3335
<footer className="bg-light">
3436
<Container className="py-3">
3537
<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">
4057
Apache Answer
4158
</a>
4259
- the open-source software that powers Q&A communities.
4360
<br />
44-
Made with love. © 2022 Answer.
61+
Made with love © 2022 Answer.
4562
</Trans>
4663
</p>
4764
</Container>
4865
</footer>
4966
);
5067
};
5168

52-
export default React.memo(Index);
69+
export default React.memo(Footer);

0 commit comments

Comments
 (0)