Skip to content

Commit d0b4fe3

Browse files
committed
frontend/i18n/jupyter: more strings, just to keep the momentum going...
1 parent b02179d commit d0b4fe3

File tree

19 files changed

+2555
-63
lines changed

19 files changed

+2555
-63
lines changed

src/packages/frontend/frame-editors/jupyter-editor/editor.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ export const EDITOR_SPEC = {
7373
]),
7474
customizeCommands: {
7575
guide: {
76-
label: "Snippets",
76+
label: editor.snippets_label,
7777
icon: SNIPPET_ICON_NAME,
78-
title: "Open a panel containing code snippets.",
78+
title: editor.snippets_tooltip,
7979
},
8080
shell: {
8181
label: jupyter.editor.console_label,
@@ -92,7 +92,7 @@ export const EDITOR_SPEC = {
9292
commands: set(["decrease_font_size", "increase_font_size"]),
9393
} as EditorDescription,
9494
jupyter_slideshow_revealjs: {
95-
short: "Slideshow",
95+
short: labels.slideshow,
9696
name: "Slideshow (Reveal.js)",
9797
icon: "slides",
9898
component: Slideshow,
@@ -106,24 +106,24 @@ export const EDITOR_SPEC = {
106106
commands: set(["decrease_font_size", "increase_font_size"]),
107107
} as EditorDescription,
108108
introspect: {
109-
short: "Introspect",
110-
name: "Introspection",
109+
short: jupyter.editor.introspect_short,
110+
name: jupyter.editor.introspect_title ,
111111
icon: "info",
112112
component: Introspect,
113113
commands: set(["decrease_font_size", "increase_font_size"]),
114114
} as EditorDescription,
115115
terminal,
116116
time_travel,
117117
jupyter_json: {
118-
short: "JSON view",
119-
name: "Raw JSON viewer",
118+
short: jupyter.editor.raw_json_view_short,
119+
name: jupyter.editor.raw_json_view_title,
120120
icon: "js-square",
121121
component: JSONIPynb,
122122
commands: set(["decrease_font_size", "increase_font_size"]),
123123
} as EditorDescription,
124124
jupyter_raw: {
125-
short: "JSON edit",
126-
name: "Raw JSON editor",
125+
short: jupyter.editor.raw_json_editor_short,
126+
name: jupyter.editor.raw_json_editor_title,
127127
icon: "markdown",
128128
component: RawIPynb,
129129
commands: set(["decrease_font_size", "increase_font_size"]),
@@ -138,7 +138,7 @@ const JUPYTER_MENUS = {
138138
download: [
139139
{
140140
icon: "file-export",
141-
label: "Save and Export As PDF",
141+
label: jupyter.commands.download_as_pdf,
142142
name: "save-and-download-as-pdf",
143143
children: [
144144
"nbconvert cocalc pdf",
@@ -149,7 +149,7 @@ const JUPYTER_MENUS = {
149149
},
150150
{
151151
icon: "file-export",
152-
label: "Save and Export As HTML",
152+
label: jupyter.commands.download_as_html,
153153
name: "save-and-download-as-html",
154154
children: [
155155
"nbconvert cocalc html",
@@ -159,7 +159,7 @@ const JUPYTER_MENUS = {
159159
},
160160
{
161161
icon: "file-export",
162-
label: "Save and Export...",
162+
label: jupyter.commands.export_menu,
163163
name: "save-and-download-as-other",
164164
children: [
165165
"nbconvert script",
@@ -200,7 +200,7 @@ const JUPYTER_MENUS = {
200200
{
201201
icon: "paste",
202202
name: "paste-cells",
203-
label: "Paste Cells",
203+
label: jupyter.commands.paste_cells_menu,
204204
children: [
205205
"paste cell and replace",
206206
"paste cell above",
@@ -210,28 +210,28 @@ const JUPYTER_MENUS = {
210210
],
211211
"insert-delete": [
212212
{
213-
label: "Insert Cell",
214-
button: "Insert",
213+
label: jupyter.commands.insert_cells_menu,
214+
button: labels.insert,
215215
name: "insert-cell",
216216
icon: "plus",
217217
children: ["insert cell above", "insert cell below"],
218218
},
219219
{
220-
label: "Delete Cells",
220+
label: jupyter.commands.delete_cells_menu,
221221
icon: "trash",
222222
name: "delete-cell",
223223
children: ["delete cell", "delete all blank code cells"],
224224
},
225225
{
226226
name: "move-cell",
227-
label: "Move Cells",
227+
label: jupyter.commands.move_cells_menu,
228228
icon: "arrow-up",
229229
children: ["move cell up", "move cell down"],
230230
},
231231
{
232232
icon: "horizontal-split",
233233
name: "split-merge-cells",
234-
label: "Split and Merge",
234+
label: jupyter.commands.split_and_merge_menu,
235235
children: [
236236
"split cell at cursor",
237237
"merge cell with previous cell",
@@ -243,15 +243,15 @@ const JUPYTER_MENUS = {
243243
"cell-selection": [
244244
{
245245
icon: "menu-outlined",
246-
label: "Select Cells",
246+
label: jupyter.commands.select_cells_menu,
247247
name: "select",
248248
children: ["select all cells", "deselect all cells"],
249249
},
250250
],
251251
"cell-type": [
252252
{
253253
name: "cell-type",
254-
label: "Cell Type",
254+
label: jupyter.commands.cell_type_menu,
255255
icon: "code-outlined",
256256
children: [
257257
"change cell to code",
@@ -265,7 +265,7 @@ const JUPYTER_MENUS = {
265265
{
266266
icon: "battery-empty",
267267
name: "clear",
268-
label: "Clear Output",
268+
label: jupyter.commands.clear_output_menu,
269269
children: [
270270
"clear cell output",
271271
"clear all cells output",
@@ -277,7 +277,7 @@ const JUPYTER_MENUS = {
277277
"collapse-expand-protect": [
278278
{
279279
icon: "compress",
280-
label: "Collapse",
280+
label: jupyter.commands.cells_collapse_menu,
281281
name: "cell-collapse",
282282
children: [
283283
"hide input",
@@ -290,7 +290,7 @@ const JUPYTER_MENUS = {
290290
},
291291
{
292292
icon: "expand-arrows",
293-
label: "Expand",
293+
label: jupyter.commands.cells_expand_menu,
294294
name: "cell-expand",
295295
children: [
296296
"show input",
@@ -303,23 +303,23 @@ const JUPYTER_MENUS = {
303303
},
304304
{
305305
icon: "lock",
306-
label: "Protect",
306+
label: jupyter.commands.cells_protect_menu,
307307
name: "cell-protect",
308308
children: ["write protect", "delete protect"],
309309
},
310310
{
311311
icon: "lock-open",
312-
label: "Remove Protection",
313-
button: "Unlock",
312+
label: jupyter.commands.cells_unlock_menu,
313+
button: jupyter.commands.cells_unlock_menu_button,
314314
name: "cell-remove-protect",
315315
children: ["remove write protect", "remove delete protect"],
316316
},
317317
],
318318
"format-cells": [
319319
{
320320
icon: FORMAT_SOURCE_ICON,
321-
label: "Format Cells",
322-
button: "Format",
321+
label: jupyter.commands.format_cells_menu,
322+
button: jupyter.commands.format_cells_menu_button,
323323
name: "cell-format",
324324
children: ["format cells", "format all cells"],
325325
},
@@ -333,8 +333,8 @@ const JUPYTER_MENUS = {
333333
components: [
334334
{
335335
icon: "tool",
336-
button: "Toolbars",
337-
label: "Cell Toolbar",
336+
button: jupyter.commands.view_toolbars_menu_button,
337+
label: jupyter.commands.view_toolbars_menu,
338338
name: "cell-toolbar",
339339
children: [
340340
"cell toolbar none",
@@ -346,7 +346,7 @@ const JUPYTER_MENUS = {
346346
],
347347
},
348348
{
349-
label: "Line Numbers",
349+
label: labels.line_numbers,
350350
name: "line-numbers",
351351
icon: "list-ol",
352352
children: [
@@ -356,7 +356,7 @@ const JUPYTER_MENUS = {
356356
],
357357
},
358358
{
359-
label: "Code Folding",
359+
label: labels.code_folding,
360360
name: "code-folding",
361361
icon: "angle-right",
362362
children: ["show code folding", "hide code folding"],
@@ -372,7 +372,7 @@ const JUPYTER_MENUS = {
372372
"run current cell and select next",
373373
{
374374
label: jupyter.editor.run_selected_cells,
375-
button: "Run",
375+
button: menu.run,
376376
name: "run-selected-cells",
377377
icon: "play-square",
378378
children: [
@@ -383,7 +383,7 @@ const JUPYTER_MENUS = {
383383
},
384384
{
385385
label: jupyter.editor.run_all_cells,
386-
button: "Run",
386+
button: menu.run,
387387
name: "run-all-cells",
388388
icon: "forward",
389389
children: [
@@ -405,8 +405,8 @@ const JUPYTER_MENUS = {
405405
"kernel-control": ["interrupt kernel"],
406406
"restart-kernel": [
407407
{
408-
label: "Restart Kernel",
409-
button: "Kernel",
408+
label: jupyter.commands.restart_kernel_noconf_menu,
409+
button: menu.kernel,
410410
name: "restart",
411411
icon: "reload",
412412
children: [

src/packages/frontend/frame-editors/jupyter-editor/snippets/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { pick, merge } from "lodash";
77
import { basename } from "path";
8+
89
import { unreachable, separate_file_extension } from "@cocalc/util/misc";
910
import { reuseInFlight } from "@cocalc/util/reuse-in-flight";
1011
import { exec } from "@cocalc/frontend/frame-editors/generic/client";

src/packages/frontend/frame-editors/latex-editor/editor.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export const pdfjsCommands = set([
3737

3838
const EDITOR_SPEC = {
3939
cm: {
40-
short: "Source",
41-
name: "LaTeX Source Code",
40+
short: editor.latex_cm_title_short,
41+
name: editor.latex_cm_title,
4242
icon: "code",
4343
component: CodemirrorEditor,
4444
commands: set([
@@ -83,18 +83,17 @@ const EDITOR_SPEC = {
8383
]),
8484
customizeCommands: {
8585
print: {
86-
label: "Print LaTeX Source",
87-
title:
88-
"Print the source code of this document. Use Print from the PDF Preview frame to print the rendered document.",
86+
label: editor.latex_command_print_label,
87+
title: editor.latex_command_print_tooltip,
8988
},
9089
},
9190

9291
gutters: ["Codemirror-latex-errors"],
9392
} as EditorDescription,
9493

9594
pdfjs_canvas: {
96-
short: "PDF (preview)",
97-
name: "PDF - Preview",
95+
short: editor.pdfjs_canvas_title_short,
96+
name: editor.pdfjs_canvas_title,
9897
icon: "file-pdf",
9998
component: PDFJS,
10099
commands: {
@@ -119,16 +118,16 @@ const EDITOR_SPEC = {
119118
} as EditorDescription,
120119

121120
error: {
122-
short: "Errors",
123-
name: "Errors and Warnings",
121+
short: editor.errors_and_warnings_title_short,
122+
name: editor.errors_and_warnings_title,
124123
icon: "bug",
125124
component: ErrorsAndWarnings,
126125
commands: set(["build", "force_build", "clean"]),
127126
} as EditorDescription,
128127

129128
build: {
130-
short: "Build",
131-
name: "Build Control and Log",
129+
short: editor.build_control_and_log_title_short,
130+
name: editor.build_control_and_log_title,
132131
icon: "terminal",
133132
component: Build,
134133
commands: set([
@@ -176,8 +175,8 @@ const EDITOR_SPEC = {
176175
// See https://github.com/sagemathinc/cocalc/issues/5114
177176
if (!IS_IPAD && !IS_IOS) {
178177
(EDITOR_SPEC as any).pdf_embed = {
179-
short: "PDF (native)",
180-
name: "PDF - Native",
178+
short: editor.pdf_embed_title_short,
179+
name: editor.pdf_embed_title,
181180
icon: "file-pdf",
182181
commands: set(["print", "save", "download"]),
183182
component: PDFEmbed,

src/packages/frontend/frame-editors/latex-editor/errors-and-warnings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const SPEC: SpecDesc = {
6161
icon: "exclamation-triangle",
6262
color: "#fdb600",
6363
},
64-
};
64+
} as const;
6565

6666
const ITEM_STYLES: { [name: string]: CSS } = {
6767
warning: {
@@ -79,7 +79,7 @@ const ITEM_STYLES: { [name: string]: CSS } = {
7979
padding: "15px",
8080
margin: "5px 0",
8181
},
82-
};
82+
} as const;
8383

8484
interface item {
8585
line: number;

0 commit comments

Comments
 (0)