mirror of https://gitee.com/answerdev/answer.git
fix(i18n): Set the site_name in i18n to the configured value
This commit is contained in:
parent
33637c0173
commit
bf3efbb45e
|
@ -638,7 +638,7 @@ ui:
|
||||||
msg:
|
msg:
|
||||||
empty: Email cannot be empty.
|
empty: Email cannot be empty.
|
||||||
change_email:
|
change_email:
|
||||||
page_title: Welcome to Answer
|
page_title: Welcome to {{site_name}}
|
||||||
btn_cancel: Cancel
|
btn_cancel: Cancel
|
||||||
btn_update: Update email address
|
btn_update: Update email address
|
||||||
send_success: >-
|
send_success: >-
|
||||||
|
@ -838,7 +838,7 @@ ui:
|
||||||
modal_confirm:
|
modal_confirm:
|
||||||
title: Error...
|
title: Error...
|
||||||
account_result:
|
account_result:
|
||||||
page_title: Welcome to Answer
|
page_title: Welcome to {{site_name}}
|
||||||
success: Your new account is confirmed; you will be redirected to the home page.
|
success: Your new account is confirmed; you will be redirected to the home page.
|
||||||
link: Continue to homepage
|
link: Continue to homepage
|
||||||
invalid: >-
|
invalid: >-
|
||||||
|
|
|
@ -3,10 +3,12 @@ import { Container, Row, Col } from 'react-bootstrap';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { siteInfoStore } from '@/stores';
|
||||||
import { usePageTags } from '@/hooks';
|
import { usePageTags } from '@/hooks';
|
||||||
|
|
||||||
const Index: FC = () => {
|
const Index: FC = () => {
|
||||||
const { t } = useTranslation('translation', { keyPrefix: 'account_result' });
|
const { t } = useTranslation('translation', { keyPrefix: 'account_result' });
|
||||||
|
const siteName = siteInfoStore((state) => state.siteInfo.name);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
usePageTags({
|
usePageTags({
|
||||||
title: t('account_activation', { keyPrefix: 'page_title' }),
|
title: t('account_activation', { keyPrefix: 'page_title' }),
|
||||||
|
@ -15,7 +17,9 @@ const Index: FC = () => {
|
||||||
<Container className="pt-4 mt-2 mb-5">
|
<Container className="pt-4 mt-2 mb-5">
|
||||||
<Row className="justify-content-center">
|
<Row className="justify-content-center">
|
||||||
<Col lg={6}>
|
<Col lg={6}>
|
||||||
<h3 className="text-center mt-3 mb-5">{t('page_title')}</h3>
|
<h3 className="text-center mt-3 mb-5">
|
||||||
|
{t('page_title', { site_name: siteName })}
|
||||||
|
</h3>
|
||||||
{location.pathname?.includes('success') && (
|
{location.pathname?.includes('success') && (
|
||||||
<>
|
<>
|
||||||
<p className="text-center">{t('success')}</p>
|
<p className="text-center">{t('success')}</p>
|
||||||
|
|
|
@ -2,18 +2,22 @@ import { FC, memo } from 'react';
|
||||||
import { Container, Col } from 'react-bootstrap';
|
import { Container, Col } from 'react-bootstrap';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { siteInfoStore } from '@/stores';
|
||||||
import { usePageTags } from '@/hooks';
|
import { usePageTags } from '@/hooks';
|
||||||
|
|
||||||
import SendEmail from './components/sendEmail';
|
import SendEmail from './components/sendEmail';
|
||||||
|
|
||||||
const Index: FC = () => {
|
const Index: FC = () => {
|
||||||
const { t } = useTranslation('translation', { keyPrefix: 'change_email' });
|
const { t } = useTranslation('translation', { keyPrefix: 'change_email' });
|
||||||
|
const siteName = siteInfoStore((state) => state.siteInfo.name);
|
||||||
usePageTags({
|
usePageTags({
|
||||||
title: t('change_email', { keyPrefix: 'page_title' }),
|
title: t('change_email', { keyPrefix: 'page_title' }),
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<Container style={{ paddingTop: '4rem', paddingBottom: '6rem' }}>
|
<Container style={{ paddingTop: '4rem', paddingBottom: '6rem' }}>
|
||||||
<h3 className="text-center mb-5">{t('page_title')}</h3>
|
<h3 className="text-center mb-5">
|
||||||
|
{t('page_title', { site_name: siteName })}
|
||||||
|
</h3>
|
||||||
<Col className="mx-auto" md={3}>
|
<Col className="mx-auto" md={3}>
|
||||||
<SendEmail />
|
<SendEmail />
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Link, useSearchParams } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { usePageTags } from '@/hooks';
|
import { usePageTags } from '@/hooks';
|
||||||
import { loggedUserInfoStore } from '@/stores';
|
import { loggedUserInfoStore, siteInfoStore } from '@/stores';
|
||||||
import { changeEmailVerify, getLoggedUserInfo } from '@/services';
|
import { changeEmailVerify, getLoggedUserInfo } from '@/services';
|
||||||
|
|
||||||
const Index: FC = () => {
|
const Index: FC = () => {
|
||||||
|
@ -13,6 +13,7 @@ const Index: FC = () => {
|
||||||
const [step, setStep] = useState('loading');
|
const [step, setStep] = useState('loading');
|
||||||
|
|
||||||
const updateUser = loggedUserInfoStore((state) => state.update);
|
const updateUser = loggedUserInfoStore((state) => state.update);
|
||||||
|
const siteName = siteInfoStore((state) => state.siteInfo.name);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const code = searchParams.get('code');
|
const code = searchParams.get('code');
|
||||||
|
@ -38,7 +39,9 @@ const Index: FC = () => {
|
||||||
<Container className="pt-4 mt-2 mb-5">
|
<Container className="pt-4 mt-2 mb-5">
|
||||||
<Row className="justify-content-center">
|
<Row className="justify-content-center">
|
||||||
<Col lg={6}>
|
<Col lg={6}>
|
||||||
<h3 className="text-center mt-3 mb-5">{t('page_title')}</h3>
|
<h3 className="text-center mt-3 mb-5">
|
||||||
|
{t('page_title', { site_name: siteName })}
|
||||||
|
</h3>
|
||||||
{step === 'success' && (
|
{step === 'success' && (
|
||||||
<>
|
<>
|
||||||
<p className="text-center">{t('confirm_new_email')}</p>
|
<p className="text-center">{t('confirm_new_email')}</p>
|
||||||
|
|
Loading…
Reference in New Issue