5
5
6
6
import { Button , Card , Popconfirm } from "antd" ;
7
7
import React from "react" ;
8
+ import { FormattedMessage , useIntl } from "react-intl" ;
8
9
9
10
import { CSS , redux , useRedux } from "@cocalc/frontend/app-framework" ;
10
11
import {
@@ -15,6 +16,7 @@ import {
15
16
Title ,
16
17
} from "@cocalc/frontend/components" ;
17
18
import { useStudentProjectFunctionality } from "@cocalc/frontend/course" ;
19
+ import { labels } from "@cocalc/frontend/i18n" ;
18
20
import { CancelText } from "@cocalc/frontend/i18n/components" ;
19
21
import { Project } from "@cocalc/frontend/project/settings/types" ;
20
22
import { COLORS } from "@cocalc/util/theme" ;
@@ -30,6 +32,7 @@ interface Props {
30
32
export const CurrentCollaboratorsPanel : React . FC < Props > = ( props : Props ) => {
31
33
const { project, user_map, mode = "project" } = props ;
32
34
const isFlyout = mode === "flyout" ;
35
+ const intl = useIntl ( ) ;
33
36
const get_account_id = useRedux ( "account" , "get_account_id" ) ;
34
37
const sort_by_activity = useRedux ( "projects" , "sort_by_activity" ) ;
35
38
const student = useStudentProjectFunctionality ( project . get ( "project_id" ) ) ;
@@ -47,17 +50,24 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
47
50
if ( account_id === get_account_id ( ) ) {
48
51
return (
49
52
< 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
+ />
53
58
</ div >
54
59
) ;
55
60
} else {
56
61
return (
57
62
< 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
+ />
61
71
</ div >
62
72
) ;
63
73
}
@@ -84,7 +94,7 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
84
94
...( isFlyout ? { color : COLORS . ANTD_RED_WARN } : { } ) ,
85
95
} }
86
96
>
87
- < Icon name = "user-times" /> Remove ...
97
+ < Icon name = "user-times" /> { intl . formatMessage ( labels . remove ) } ...
88
98
</ Button >
89
99
</ Popconfirm >
90
100
) ;
@@ -150,8 +160,11 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
150
160
}
151
161
}
152
162
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
+ } ) ;
155
168
156
169
switch ( mode ) {
157
170
case "project" :
@@ -166,7 +179,14 @@ export const CurrentCollaboratorsPanel: React.FC<Props> = (props: Props) => {
166
179
return (
167
180
< div style = { { paddingLeft : "5px" } } >
168
181
< 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
+ />
170
190
</ Title >
171
191
< Paragraph
172
192
type = "secondary"
0 commit comments