Skip to content

Commit ba58d13

Browse files
committed
Merge branch 'master' of github.com:sagemathinc/cocalc
2 parents 65202d5 + 6e10c79 commit ba58d13

40 files changed

+2253
-221
lines changed

src/packages/frontend/collaborators/current-collabs.tsx

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { Button, Card, Popconfirm } from "antd";
77
import React from "react";
8+
import { FormattedMessage, useIntl } from "react-intl";
89

910
import { CSS, redux, useRedux } from "@cocalc/frontend/app-framework";
1011
import {
@@ -15,6 +16,7 @@ import {
1516
Title,
1617
} from "@cocalc/frontend/components";
1718
import { useStudentProjectFunctionality } from "@cocalc/frontend/course";
19+
import { labels } from "@cocalc/frontend/i18n";
1820
import { CancelText } from "@cocalc/frontend/i18n/components";
1921
import { Project } from "@cocalc/frontend/project/settings/types";
2022
import { COLORS } from "@cocalc/util/theme";
@@ -30,6 +32,7 @@ interface Props {
3032
export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
3133
const { project, user_map, mode = "project" } = props;
3234
const isFlyout = mode === "flyout";
35+
const intl = useIntl();
3336
const get_account_id = useRedux("account", "get_account_id");
3437
const sort_by_activity = useRedux("projects", "sort_by_activity");
3538
const student = useStudentProjectFunctionality(project.get("project_id"));
@@ -47,17 +50,24 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
4750
if (account_id === get_account_id()) {
4851
return (
4952
<div style={style}>
50-
Are you sure you want to remove <b>yourself</b> from this project? You
51-
will no longer have access to this project and cannot add yourself
52-
back.
53+
<FormattedMessage
54+
id="collaborators.current-collabs.remove_self"
55+
defaultMessage={`Are you sure you want to remove <b>yourself</b> from this project?
56+
You will no longer have access to this project and cannot add yourself back.`}
57+
/>
5358
</div>
5459
);
5560
} else {
5661
return (
5762
<div style={style}>
58-
Are you sure you want to remove{" "}
59-
<User account_id={account_id} user_map={user_map} /> from this
60-
project? They will no longer have access to this project.
63+
<FormattedMessage
64+
id="collaborators.current-collabs.remove_other"
65+
defaultMessage={`Are you sure you want to remove {user} from this project?
66+
They will no longer have access to this project.`}
67+
values={{
68+
user: <User account_id={account_id} user_map={user_map} />,
69+
}}
70+
/>
6171
</div>
6272
);
6373
}
@@ -84,7 +94,7 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
8494
...(isFlyout ? { color: COLORS.ANTD_RED_WARN } : {}),
8595
}}
8696
>
87-
<Icon name="user-times" /> Remove ...
97+
<Icon name="user-times" /> {intl.formatMessage(labels.remove)} ...
8898
</Button>
8999
</Popconfirm>
90100
);
@@ -150,8 +160,11 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
150160
}
151161
}
152162

153-
const introText =
154-
"Everybody listed below can collaboratively work with you on any notebooks, terminals or files in this project, and add or remove other collaborators.";
163+
const introText = intl.formatMessage({
164+
id: "collaborators.current-collabs.intro",
165+
defaultMessage:
166+
"Everybody listed below can collaboratively work with you on any Jupyter Notebook, Linux Terminal or file in this project, and add or remove other collaborators.",
167+
});
155168

156169
switch (mode) {
157170
case "project":
@@ -166,7 +179,14 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
166179
return (
167180
<div style={{ paddingLeft: "5px" }}>
168181
<Title level={3}>
169-
<Icon name="user" /> Current Collaborators
182+
<Icon name="user" />{" "}
183+
<FormattedMessage
184+
id="collaborators.current-collabs.title"
185+
defaultMessage={"Current Collaborators"}
186+
description={
187+
"Title of a table listing users collaborating on that project"
188+
}
189+
/>
170190
</Title>
171191
<Paragraph
172192
type="secondary"

src/packages/frontend/components/loading.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
*/
55

66
import { CSSProperties } from "react";
7+
import { useIntl } from "react-intl";
78

89
import { TypedMap, useDelayedRender } from "@cocalc/frontend/app-framework";
10+
import { labels } from "@cocalc/frontend/i18n";
911
import { Icon } from "./icon";
1012

1113
export type Estimate = TypedMap<{
@@ -31,7 +33,7 @@ const LOADING_THEMES: { [keys: string]: CSSProperties } = {
3133
color: "#888",
3234
background: "white",
3335
},
34-
};
36+
} as const;
3537

3638
export function Loading({
3739
style,
@@ -41,6 +43,8 @@ export function Loading({
4143
delay,
4244
transparent = false,
4345
}: Props) {
46+
const intl = useIntl();
47+
4448
const render = useDelayedRender(delay ?? 0);
4549
if (!render) {
4650
return <></>;
@@ -55,7 +59,8 @@ export function Loading({
5559
}}
5660
>
5761
<span>
58-
<Icon name="cocalc-ring" spin /> {text ?? "Loading..."}
62+
<Icon name="cocalc-ring" spin />{" "}
63+
{text ?? intl.formatMessage(labels.loading)}
5964
</span>
6065
{estimate != undefined && (
6166
<div>

src/packages/frontend/course/configuration/upgrades.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Upgrading quotas for all student projects
77

88
import { Alert, Card, Divider, Form, Radio, Switch, Typography } from "antd";
9+
import { delay } from "awaiting";
910

1011
import { alert_message } from "@cocalc/frontend/alerts";
1112
import {
@@ -37,8 +38,8 @@ import {
3738
Tip,
3839
UPGRADE_ERROR_STYLE,
3940
} from "@cocalc/frontend/components";
40-
import { SiteLicenseInput } from "@cocalc/frontend/site-licenses/input";
4141
import Next from "@cocalc/frontend/components/next";
42+
import { SiteLicenseInput } from "@cocalc/frontend/site-licenses/input";
4243
import { SiteLicensePublicInfoTable } from "@cocalc/frontend/site-licenses/site-license-public-info";
4344
import { SiteLicenses } from "@cocalc/frontend/site-licenses/types";
4445
import { ShowSupportLink } from "@cocalc/frontend/support";
@@ -61,7 +62,6 @@ import {
6162
} from "../store";
6263
import { SiteLicenseStrategy, UpgradeGoal } from "../types";
6364
import { ConfigurationActions } from "./actions";
64-
import { delay } from "awaiting";
6565

6666
const radioStyle: CSS = {
6767
display: "block",

0 commit comments

Comments
 (0)