9
9
// one gets a gutter mark, with pref to errors. The main error log shows everything, so this should be OK.
10
10
11
11
import { Popover } from "antd" ;
12
+ import { IntlProvider } from "react-intl" ;
12
13
13
14
import { Icon } from "@cocalc/frontend/components" ;
14
15
//import { Actions } from "@cocalc/frontend/frame-editors/code-editor/actions";
@@ -17,6 +18,7 @@ import { capitalize } from "@cocalc/util/misc";
17
18
import { Actions } from "./actions" ;
18
19
import { SPEC , SpecItem } from "./errors-and-warnings" ;
19
20
import { Error , IProcessedLatexLog } from "./latex-log-parser" ;
21
+ import { DEFAULT_LOCALE } from "@cocalc/frontend/i18n" ;
20
22
21
23
export function update_gutters ( opts : {
22
24
log : IProcessedLatexLog ;
@@ -63,42 +65,49 @@ function component(
63
65
}
64
66
// NOTE/BUG: despite allow_touch true below, this still does NOT work on my iPad -- we see the icon, but nothing
65
67
// happens when clicking on it; this may be a codemirror issue.
68
+ // NOTE: the IntlProvider is necessary, because this is mounted outside the application's overall context.
69
+ // It's just a default IntlProvider to avoid a crash → TODO: make this part of the application react root.
66
70
return (
67
- < Popover
68
- title = { message }
69
- content = {
70
- < div >
71
- { content }
72
- { group == "errors" && (
73
- < >
74
- < br />
75
- < HelpMeFix
76
- size = "small"
77
- style = { { marginTop : "5px" } }
78
- task = { "ran latex" }
79
- error = { content }
80
- input = { ( ) => {
81
- const s = actions . _syncstring . to_str ( ) ;
82
- const v = s
83
- . split ( "\n" )
84
- . slice ( 0 , line + 1 )
85
- . join ( "\n" ) ;
86
- //line+1 since lines are 1-based
87
- return v + `% this is line number ${ line + 1 } ` ;
88
- } }
89
- language = { "latex" }
90
- extraFileInfo = { actions . languageModelExtraFileInfo ( ) }
91
- tag = { "latex-error-popover" }
92
- prioritize = "end"
93
- />
94
- </ >
95
- ) }
96
- </ div >
97
- }
98
- placement = { "right" }
99
- mouseEnterDelay = { 0 }
100
- >
101
- < Icon name = { spec . icon } style = { { color : spec . color , cursor : "pointer" } } />
102
- </ Popover >
71
+ < IntlProvider locale = "en" defaultLocale = { DEFAULT_LOCALE } >
72
+ < Popover
73
+ title = { message }
74
+ content = {
75
+ < div >
76
+ { content }
77
+ { group == "errors" && (
78
+ < >
79
+ < br />
80
+ < HelpMeFix
81
+ size = "small"
82
+ style = { { marginTop : "5px" } }
83
+ task = { "ran latex" }
84
+ error = { content }
85
+ input = { ( ) => {
86
+ const s = actions . _syncstring . to_str ( ) ;
87
+ const v = s
88
+ . split ( "\n" )
89
+ . slice ( 0 , line + 1 )
90
+ . join ( "\n" ) ;
91
+ //line+1 since lines are 1-based
92
+ return v + `% this is line number ${ line + 1 } ` ;
93
+ } }
94
+ language = { "latex" }
95
+ extraFileInfo = { actions . languageModelExtraFileInfo ( ) }
96
+ tag = { "latex-error-popover" }
97
+ prioritize = "end"
98
+ />
99
+ </ >
100
+ ) }
101
+ </ div >
102
+ }
103
+ placement = { "right" }
104
+ mouseEnterDelay = { 0 }
105
+ >
106
+ < Icon
107
+ name = { spec . icon }
108
+ style = { { color : spec . color , cursor : "pointer" } }
109
+ />
110
+ </ Popover >
111
+ </ IntlProvider >
103
112
) ;
104
113
}
0 commit comments