Skip to content

Commit ffea864

Browse files
committed
frontend/i18n: cont. frame editor generic commands
1 parent f825d12 commit ffea864

File tree

20 files changed

+419
-42
lines changed

20 files changed

+419
-42
lines changed

src/packages/frontend/compute/menu.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22
Compute server hamburger menu.
33
*/
44

5-
import { Button, Dropdown, Spin } from "antd";
65
import type { MenuProps } from "antd";
7-
import { A, Icon } from "@cocalc/frontend/components";
6+
import { Button, Dropdown, Spin } from "antd";
87
import { useMemo, useState } from "react";
9-
import getTitle from "./get-title";
8+
109
import { redux, useTypedRedux } from "@cocalc/frontend/app-framework";
11-
import { LogModal } from "./compute-server-log";
12-
import { EditModal } from "./compute-server";
13-
import { SerialLogModal } from "./serial-port-output";
14-
import { AppLauncherModal } from "./launcher";
15-
import { TitleColorModal } from "./title-color";
16-
import { setServerConfiguration } from "@cocalc/frontend/compute/api";
10+
import { A, Icon } from "@cocalc/frontend/components";
1711
import ShowError from "@cocalc/frontend/components/error";
12+
import {
13+
setServerConfiguration,
14+
setTemplate,
15+
} from "@cocalc/frontend/compute/api";
1816
import openSupportTab from "@cocalc/frontend/support/open";
19-
import { setTemplate } from "@cocalc/frontend/compute/api";
2017
import CloneModal from "./clone";
18+
import { EditModal } from "./compute-server";
19+
import { LogModal } from "./compute-server-log";
20+
import getTitle from "./get-title";
21+
import { AppLauncherModal } from "./launcher";
22+
import { SerialLogModal } from "./serial-port-output";
23+
import { TitleColorModal } from "./title-color";
2124

2225
function getServer({ id, project_id }) {
2326
return redux

src/packages/frontend/frame-editors/frame-tree/commands/generic-commands.tsx

Lines changed: 96 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,44 +147,69 @@ addCommands({
147147
show_search: {
148148
group: "find",
149149
pos: 0,
150-
title: "Show panel for searching in this document",
151-
label: "Search",
150+
title: defineMessage({
151+
id: "command.generic.show_search.tooltip",
152+
defaultMessage: "Show panel for searching in this document",
153+
}),
154+
label: labels.search,
152155
icon: "search",
153156
},
154157
show_overview: {
155158
group: "show-frames",
156-
title: "Show overview of all pages",
159+
title: defineMessage({
160+
id: "command.generic.show_overview.tooltip",
161+
defaultMessage: "Show overview of all pages",
162+
description: "All pages in a document",
163+
}),
157164
label: labels.overview,
158165
icon: "overview",
159166
},
160167
show_pages: {
161168
group: "show-frames",
162-
title: "Show all pages of this document",
163-
label: "Pages",
169+
title: defineMessage({
170+
id: "command.generic.show_pages.tooltip",
171+
defaultMessage: "Show all pages of this document",
172+
description: "All pages in a document",
173+
}),
174+
label: labels.pages,
164175
icon: "pic-centered",
165176
},
166177
show_slideshow: {
167178
group: "show-frames",
168-
title: "Display Slideshow Presentation",
179+
title: defineMessage({
180+
id: "command.generic.show_slideshow.tooltip",
181+
defaultMessage: "Display Slideshow Presentation",
182+
}),
169183
label: labels.slideshow,
170184
icon: "play-square",
171185
},
172186
show_speaker_notes: {
173187
group: "show-frames",
174-
title: "Show Speaker Notes",
188+
title: defineMessage({
189+
id: "command.generic.show_speaker_notes.tooltip",
190+
defaultMessage: "Show Speaker Notes",
191+
description: "Speaker Notes for a Slideshow Presentation",
192+
}),
175193
label: "Speaker Notes",
176194
icon: "pencil",
177195
},
178196
shell: {
179197
group: "show-frames",
180-
title: "Open a terminal for running code",
198+
title: defineMessage({
199+
id: "command.generic.shell.tooltip",
200+
defaultMessage: "Open a terminal for running code",
201+
}),
181202
icon: "terminal",
182203
disable: "disableTerminals",
183204
label: "Shell",
184205
},
185206
terminal: {
186207
group: "show-frames",
187-
title: "Open a command line terminal for interacting with the Linux prompt",
208+
title: defineMessage({
209+
id: "command.generic.terminal.tooltip",
210+
defaultMessage:
211+
"Open a command-line terminal for interacting with the Linux prompt",
212+
}),
188213
icon: "terminal",
189214
disable: "disableTerminals",
190215
label: labels.terminal,
@@ -256,7 +281,10 @@ addCommands({
256281
set_zoom: {
257282
pos: 5,
258283
group: "zoom",
259-
title: "Zoom to a preset size",
284+
title: defineMessage({
285+
id: "command.generic.set_zoom.tooltip",
286+
defaultMessage: "Zoom to a preset size",
287+
}),
260288
label: ({ props }) => (
261289
<span>
262290
{props.font_size == null
@@ -316,7 +344,11 @@ addCommands({
316344
group: "copy",
317345
pos: 0,
318346
label: labels.cut,
319-
title: "Cut selection",
347+
title: defineMessage({
348+
id: "command.generic.cut.tooltip",
349+
defaultMessage: "Cut selection",
350+
description: "Cut text in a text editor",
351+
}),
320352
icon: "scissors",
321353
keyboard: `${IS_MACOS ? "⌘" : "control"} + X`,
322354
disabled: ({ readOnly }) => readOnly,
@@ -325,15 +357,23 @@ addCommands({
325357
group: "copy",
326358
pos: 1,
327359
label: labels.copy,
328-
title: "Copy selection",
360+
title: defineMessage({
361+
id: "command.generic.copy.tooltip",
362+
defaultMessage: "Copy selection",
363+
description: "Copy text in a text editor",
364+
}),
329365
icon: "copy",
330366
keyboard: `${IS_MACOS ? "⌘" : "control"} + C`,
331367
},
332368
paste: {
333369
group: "copy",
334370
pos: 2,
335371
label: labels.paste,
336-
title: "Paste buffer",
372+
title: defineMessage({
373+
id: "command.generic.paste.tooltip",
374+
defaultMessage: "Insert cut or copied text at the cursor position",
375+
description: "Paste text in a text editor",
376+
}),
337377
icon: "paste",
338378
keyboard: `${IS_MACOS ? "⌘" : "control"} + V`,
339379
disabled: ({ readOnly }) => readOnly,
@@ -432,8 +472,14 @@ addCommands({
432472
restart: {
433473
group: "action",
434474
icon: "sync",
435-
label: "Restart Server",
436-
title: "Restart the backend service",
475+
label: defineMessage({
476+
id: "command.generic.restart.label",
477+
defaultMessage: "Restart Server",
478+
}),
479+
title: defineMessage({
480+
id: "command.generic.restart.tooltip",
481+
defaultMessage: "Restart the backend service",
482+
}),
437483
},
438484

439485
kick_other_users_out: {
@@ -691,8 +737,11 @@ addCommands({
691737
export_to_markdown: {
692738
group: "export",
693739
label: "Export to Markdown",
694-
title:
695-
"Create and open a markdown version of current view of this document.",
740+
title: defineMessage({
741+
id: "command.generic.export_to_markdown.tooltip",
742+
defaultMessage:
743+
"Create and open a markdown version of current view of this document.",
744+
}),
696745
icon: "markdown",
697746
},
698747

@@ -713,8 +762,16 @@ addCommands({
713762

714763
tour: {
715764
group: "tour",
716-
label: "Take the Tour",
717-
title: "Take a guided tour of the user interface for this editor.",
765+
label: defineMessage({
766+
id: "command.generic.tour.label",
767+
defaultMessage: "Take the Tour",
768+
description: "Interactive tour for explaining a user-interface",
769+
}),
770+
title: defineMessage({
771+
id: "command.generic.tour.tooltip",
772+
defaultMessage:
773+
"Take a guided tour of the user interface for this editor.",
774+
}),
718775
icon: "map",
719776
neverVisibleOnMobile: true,
720777
onClick: ({ props }) => {
@@ -889,7 +946,11 @@ addCommands({
889946
pos: 10,
890947
group: "misc-file-actions",
891948
icon: "upload",
892-
title: "Upload a file or directory from your compute to the server",
949+
title: defineMessage({
950+
id: "command.generic.upload.tooltip",
951+
defaultMessage:
952+
"Upload a file or directory from your compute to the server",
953+
}),
893954
label: labels.upload,
894955
...fileAction("upload"),
895956
},
@@ -921,14 +982,17 @@ addCommands({
921982
defaultMessage:
922983
"Show a printable version of this document in a popup window.",
923984
}),
924-
925985
label: labels.print,
926986
},
927987
new: {
928988
pos: 0,
929989
group: "new-open",
930990
icon: "plus-circle",
931-
title: "Create a new file",
991+
title: defineMessage({
992+
id: "menu.generic.new.tooltip",
993+
defaultMessage: "Create a new file",
994+
description: "A file in a file-system",
995+
}),
932996
label: menu.new_file,
933997
...fileAction("new"),
934998
},
@@ -1018,8 +1082,13 @@ addCommands({
10181082
"Opens a chatroom next to the document to chat with other users (collaborators) or an AI chatbot",
10191083
}),
10201084
button: labels.chat,
1021-
title:
1022-
"Open chat on the side of this file for chatting with project collaborators or AI about this file.",
1085+
title: defineMessage({
1086+
id: "command.generic.chat.tooltip",
1087+
defaultMessage:
1088+
"Open chat on the side of this file for chatting with project collaborators or AI about this file.",
1089+
description:
1090+
"Opens a chatroom next to the document to chat with other users (collaborators) or an AI chatbot",
1091+
}),
10231092
onClick: ({ props }) => {
10241093
redux.getProjectActions(props.project_id).open_chat({ path: props.path });
10251094
},
@@ -1127,9 +1196,9 @@ addCommands({
11271196
pos: 10,
11281197
group: "settings",
11291198
icon: "gear",
1130-
title: "Settings",
1131-
label: "Settings",
1132-
button: "Settings",
1199+
title: labels.settings,
1200+
label: labels.settings,
1201+
button: labels.settings,
11331202
onClick: ({ props }) => {
11341203
props.actions.settings?.();
11351204
},

src/packages/frontend/i18n/common.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,15 @@ export const labels = defineMessages({
172172
defaultMessage: "Create a new file",
173173
description: "A new file in a file-system",
174174
},
175+
pages: {
176+
id: "labels.pages",
177+
defaultMessage: "Pages",
178+
description: "Pages in a document",
179+
},
175180
settings: {
176181
id: "labels.settings",
177182
defaultMessage: "Settings",
178-
description: "On a button to show project settings",
183+
description: "On a button to show the configuration settings",
179184
},
180185
help: {
181186
id: "labels.help",

src/packages/frontend/i18n/trans/ar_EG.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"command.generic.button_bar.reset.popconfirm.message": "إذا قمت بإعادة تعيين شريط أدوات الأزرار، ستعود مجموعة الأوامر في شريط الأدوات لهذا النوع المحدد من المحرر إلى الحالة الافتراضية.",
122122
"command.generic.button_bar.reset.toolbar": "إعادة تعيين شريط الأدوات لهذا المحرر إلى حالته الافتراضية، وإزالة أي أزرار قمت بإضافتها أو إزالتها.",
123123
"command.generic.chat.label": "الدردشة مع المتعاونين أو AI",
124+
"command.generic.chat.tooltip": "افتح الدردشة بجانب هذا الملف للدردشة مع المتعاونين في المشروع أو الذكاء الاصطناعي حول هذا الملف.",
124125
"command.generic.chatgpt.label": "مساعد AI",
125126
"command.generic.chatgpt.title": "اطلب المساعدة من مساعد الذكاء الاصطناعي (مثل ChatGPT) فيما تقوم به.",
126127
"command.generic.clean.label": "حذف الملفات المساعدة",
@@ -132,11 +133,14 @@
132133
"command.generic.close.button": "إغلاق",
133134
"command.generic.close.label": "إغلاق الإطار",
134135
"command.generic.close.title": "أغلق هذا الإطار. لاستعادة التخطيط الافتراضي، اختر إدخال قائمة التطبيق 'التخطيط الافتراضي'.",
136+
"command.generic.copy.tooltip": "نسخ التحديد",
137+
"command.generic.cut.tooltip": "قص التحديد",
135138
"command.generic.decrease_font_size.button": "أصغر",
136139
"command.generic.decrease_font_size.label": "التصغير",
137140
"command.generic.decrease_font_size.title": "تقليل حجم الخط",
138141
"command.generic.edit_init_script.label": "برنامج التهيئة",
139142
"command.generic.edit_init_script.title": "تحرير نص التهيئة الذي يتم تشغيله عند بدء هذا",
143+
"command.generic.export_to_markdown.tooltip": "إنشاء وفتح إصدار Markdown من العرض الحالي لهذا المستند.",
140144
"command.generic.find.label": "اعثر",
141145
"command.generic.force_build.label": "إجبار البناء",
142146
"command.generic.force_build.title": "إعادة بناء المشروع بالكامل بالقوة.",
@@ -161,14 +165,24 @@
161165
"command.generic.open_recent.title": "افتح ملفًا تم فتحه مؤخرًا",
162166
"command.generic.open.label": "افتح الملف",
163167
"command.generic.open.title": "افتح ملف",
168+
"command.generic.paste.tooltip": "إدراج النص المقطوع أو المنسوخ في موضع المؤشر",
164169
"command.generic.pause.tooltip": "إيقاف مؤقت للإخراج في هذا الطرفية.",
165170
"command.generic.replace.label": "استبدل",
166171
"command.generic.rescan_latex_directive.label": "مسح توجيهات البناء",
167172
"command.generic.rescan_latex_directive.title": "إعادة فحص مستند LaTeX للحصول على توجيهات البناء. يبحث هذا عن السطور التي تبدأ بـ {code1} أو {code2}",
168173
"command.generic.reset_local_view_state.button": "افتراضي",
169174
"command.generic.reset_local_view_state.label": "التخطيط الافتراضي",
170175
"command.generic.reset_local_view_state.title": "إعادة تعيين تخطيط جميع الإطارات إلى الوضع الافتراضي",
176+
"command.generic.restart.label": "إعادة تشغيل الخادم",
177+
"command.generic.restart.tooltip": "إعادة تشغيل خدمة الخلفية",
171178
"command.generic.search_commands.tooltip": "ابحث في جميع الأوامر لهذا الإطار الوثائقي",
179+
"command.generic.set_zoom.tooltip": "التكبير إلى حجم محدد مسبقًا",
180+
"command.generic.shell.tooltip": "افتح طرفية لتشغيل الكود",
181+
"command.generic.show_overview.tooltip": "عرض نظرة عامة على جميع الصفحات",
182+
"command.generic.show_pages.tooltip": "عرض جميع صفحات هذا المستند",
183+
"command.generic.show_search.tooltip": "عرض لوحة البحث في هذا المستند",
184+
"command.generic.show_slideshow.tooltip": "عرض عرض الشرائح",
185+
"command.generic.show_speaker_notes.tooltip": "عرض ملاحظات المتحدث",
172186
"command.generic.show_table_of_contents.button": "المحتويات",
173187
"command.generic.show_table_of_contents.title": "عرض جدول المحتويات",
174188
"command.generic.split_col.label": "قسمة إلى اليمين",
@@ -180,6 +194,10 @@
180194
"command.generic.sync.button": "مزامنة",
181195
"command.generic.sync.label": "مزامنة العروض",
182196
"command.generic.sync.title": "مزامنة عرض مصدر LaTeX مع إخراج PDF",
197+
"command.generic.terminal.tooltip": "افتح نافذة سطر الأوامر للتفاعل مع موجه لينكس",
198+
"command.generic.tour.label": "استعرض الجولة",
199+
"command.generic.tour.tooltip": "خذ جولة إرشادية في واجهة المستخدم لهذا المحرر.",
200+
"command.generic.upload.tooltip": "قم بتحميل ملف أو دليل من جهازك إلى الخادم",
183201
"command.generic.videos.tooltip": "تصفح مقاطع الفيديو عن CoCalc",
184202
"command.generic.word_count.label": "عدد الكلمات",
185203
"command.generic.word_count.title": "عرض معلومات حول عدد الكلمات في هذا المستند",
@@ -546,6 +564,7 @@
546564
"labels.notifications": "الإشعارات",
547565
"labels.other": "أخرى",
548566
"labels.overview": "نظرة عامة",
567+
"labels.pages": "الصفحات",
549568
"labels.paste": "لصق",
550569
"labels.preferences": "التفضيلات",
551570
"labels.print": "طباعة",
@@ -638,6 +657,7 @@
638657
"menu.generic.move_file.label": "نقل الملف",
639658
"menu.generic.move_file.tooltip": "انقل هذا الملف إلى دليل آخر",
640659
"menu.generic.new_file.label": "ملف جديد",
660+
"menu.generic.new.tooltip": "إنشاء ملف جديد",
641661
"menu.generic.open_file.label": "افتح...",
642662
"menu.generic.print.tooltip": "عرض نسخة قابلة للطباعة من هذا المستند في نافذة منبثقة.",
643663
"menu.generic.publish_file.button": "انشر",

0 commit comments

Comments
 (0)