Skip to content

Commit 64f5af2

Browse files
committed
Fix welcome page translations
1 parent eb15b5f commit 64f5af2

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

src/i18n/locales/en/welcome.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"welcome": {
33
"title": "Welcome to {{sourceAcademyDeploymentName}}",
4-
"loggedInMessage": "You have logged in as <strong>{{name}}</strong>. {{sourceAcademyDeploymentName}}",
5-
"resourcesForLearners": "Click <a href='{{resourcesForLearners}}'>here</a> to find a course that suits your needs.",
6-
"resourcesForEducators": "Click <a href='{{resourcesForEducators}}'>here</a> for a list of resources to get started.",
7-
"missingTranslation": "Sorry, translation is not available for this content."
4+
"loggedInMessage": "You have logged in as <0>{{name}}</0>. {{sourceAcademyDeploymentName}} does not have any course information for this account",
5+
"enrollmentMessage": "If you are enrolled in a course, check with the course staff to make sure your account is added to the course.",
6+
"resourcesForLearners": "Click <0>here</0> to find a course that suits your needs.",
7+
"resourcesForEducators": "Click <0>here</0> for a list of resources to get started."
88
}
99
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"welcome": {
33
"title": "欢迎来到 {{sourceAcademyDeploymentName}}",
4-
"loggedInMessage": "您已登录为 <strong>{{name}}</strong>。{{sourceAcademyDeploymentName}}",
5-
"resourcesForLearners": "点击 <a href='{{resourcesForLearners}}'>此处</a> 查找适合您的课程。",
6-
"resourcesForEducators": "点击 <a href='{{resourcesForEducators}}'>此处</a> 获取资源列表以开始。"
4+
"loggedInMessage": "您已登录为 <0>{{name}}</0>。{{sourceAcademyDeploymentName}} 没有此账户的课程信息",
5+
"enrollmentMessage": "如果您已注册课程,请联系课程团队,确保您的账户已加入课程。",
6+
"resourcesForLearners": "点击<0>这里</0>寻找适合您的课程。",
7+
"resourcesForEducators": "点击<0>这里</0>查看入门资源列表。"
78
}
89
}

src/pages/welcome/Welcome.tsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Card, H2, UL } from '@blueprintjs/core';
2-
import { useTranslation } from 'react-i18next';
2+
import { Trans, useTranslation } from 'react-i18next';
3+
import { ItalicLink } from 'src/commons/sideContent/content/SideContentCseMachine';
34
import Constants, { Links } from 'src/commons/utils/Constants';
45
import { useSession } from 'src/commons/utils/Hooks';
56

@@ -9,33 +10,34 @@ const Welcome: React.FC = () => {
910
const { t } = useTranslation();
1011
const { name } = useSession();
1112

13+
const { sourceAcademyDeploymentName } = Constants;
1214
return (
1315
<div className="fullpage">
1416
<Card className="fullpage-content">
1517
<div className={styles.fullpage}>
1618
<div>
17-
<H2>
18-
{t('welcome.title', {
19-
sourceAcademyDeploymentName: Constants.sourceAcademyDeploymentName
20-
})}
21-
</H2>
19+
<H2>{t('welcome.title', { sourceAcademyDeploymentName })}</H2>
2220
<div>
23-
{t('welcome.loggedInMessage', {
24-
name,
25-
sourceAcademyDeploymentName: Constants.sourceAcademyDeploymentName
26-
})}
21+
<Trans
22+
i18nKey="welcome.loggedInMessage"
23+
components={[<strong />]}
24+
tOptions={{ name, sourceAcademyDeploymentName }}
25+
/>
2726
</div>
2827
<div className={styles['fullpage-content']}>
2928
<UL className={styles['text-left']}>
29+
<li>{t('welcome.enrollmentMessage')}</li>
3030
<li>
31-
{t('welcome.resourcesForLearners', {
32-
resourcesForLearners: Links.resourcesForLearners
33-
})}
31+
<Trans
32+
i18nKey="welcome.resourcesForLearners"
33+
components={[<ItalicLink href={Links.resourcesForLearners} />]}
34+
/>
3435
</li>
3536
<li>
36-
{t('welcome.resourcesForEducators', {
37-
resourcesForEducators: Links.resourcesForEducators
38-
})}
37+
<Trans
38+
i18nKey="welcome.resourcesForEducators"
39+
components={[<ItalicLink href={Links.resourcesForEducators} />]}
40+
/>
3941
</li>
4042
</UL>
4143
</div>

0 commit comments

Comments
 (0)