feat: i18n support

This commit is contained in:
JustSong
2025-02-02 00:12:22 +08:00
parent e7ea7c866f
commit d0965050a9
8 changed files with 447 additions and 170 deletions

View File

@@ -1,9 +1,10 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Container, Segment } from 'semantic-ui-react';
import { getFooterHTML, getSystemName } from '../helpers';
const Footer = () => {
const { t } = useTranslation();
const systemName = getSystemName();
const [footer, setFooter] = useState(getFooterHTML());
let remainCheckTimes = 5;
@@ -40,13 +41,13 @@ const Footer = () => {
<a href='https://github.com/songquanpeng/one-api' target='_blank'>
{systemName} {process.env.REACT_APP_VERSION}{' '}
</a>
{' '}
{t('footer.built_by')}{' '}
<a href='https://github.com/songquanpeng' target='_blank'>
JustSong
{t('footer.built_by_name')}
</a>{' '}
构建源代码遵循{' '}
{t('footer.license')}{' '}
<a href='https://opensource.org/licenses/mit-license.php'>
MIT 协议
{t('footer.mit')}
</a>
</div>
)}