fix: optimize third-party login display name

This commit is contained in:
shuai 2023-02-03 17:49:48 +08:00
parent e8246433a2
commit dfcd64e2a4
3 changed files with 18 additions and 2 deletions

View File

@ -1052,6 +1052,11 @@ ui:
plugins: Plugins
installed_plugins: Installed Plugins
website_welcome: Welcome to {{site_name}}
plugins:
oauth:
connect: Connect with {{ auth_name }}
remove: Remove {{ auth_name }}
admin:
admin_header:
title: Admin

View File

@ -14,6 +14,10 @@ const Index = () => {
keyPrefix: 'settings.my_logins',
});
const { t: t2 } = useTranslation('translation', {
keyPrefix: 'plugins.oauth',
});
const deleteLogins = (e, item) => {
if (!item.binding) {
return;
@ -57,7 +61,12 @@ const Index = () => {
height={16}
className="btnSvg me-2"
/>
<span> {item.name}</span>
<span>
{' '}
{t2(item.binding ? 'remove' : 'connect', {
auth_name: item.name,
})}
</span>
</Button>
</div>
);

View File

@ -1,5 +1,6 @@
import { memo, FC } from 'react';
import { Button } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import classnames from 'classnames';
@ -9,6 +10,7 @@ interface Props {
className?: string;
}
const Index: FC<Props> = ({ className }) => {
const { t } = useTranslation('translation', { keyPrefix: 'plugins.oauth' });
const { data } = useGetStartUseOauthConnector();
if (!data?.length) return null;
@ -24,7 +26,7 @@ const Index: FC<Props> = ({ className }) => {
height={16}
className="btnSvg me-2"
/>
<span>{item.name}</span>
<span>{t('connect', { auth_name: item.name })}</span>
</Button>
);
})}