Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/application-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ const title: JupyterFrontEndPlugin<void> = {
};

commands.addCommand(CommandIDs.duplicate, {
label: () => trans.__('Duplicate'),
label: () => trans.__('Make a Copy…'),
isEnabled,
execute: async () => {
if (!isEnabled()) {
Expand Down
12 changes: 8 additions & 4 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import { Poll } from '@lumino/polling';

import { Widget } from '@lumino/widgets';

import { renameLabFileMenuItems } from './lab-menu-rename';

import { TrustedComponent } from './trusted';

/**
Expand Down Expand Up @@ -231,12 +233,12 @@ const checkpoints: JupyterFrontEndPlugin<void> = {
};

/**
* Add a command to close the browser tab when clicking on "Close and Shut Down"
* Add a command to close the browser tab when clicking on "Close and Halt"
*/
const closeTab: JupyterFrontEndPlugin<void> = {
id: '@jupyter-notebook/notebook-extension:close-tab',
description:
'Add a command to close the browser tab when clicking on "Close and Shut Down".',
'Add a command to close the browser tab when clicking on "Close and Halt".',
autoStart: true,
requires: [IMainMenu],
optional: [INotebookTracker, ISettingRegistry, ITranslator],
Expand Down Expand Up @@ -277,8 +279,8 @@ const closeTab: JupyterFrontEndPlugin<void> = {
commands.addCommand(id, {
label: () =>
promptForConfirmation
? trans.__('Close and Shut Down Notebook…')
: trans.__('Close and Shut Down Notebook'),
? trans.__('Close and Halt…')
: trans.__('Close and Halt'),
execute: async () => {
if (promptForConfirmation) {
const fileName =
Expand Down Expand Up @@ -935,6 +937,8 @@ const overrideMenuItems: JupyterFrontEndPlugin<void> = {
},
});
}

void app.restored.then(() => renameLabFileMenuItems(mainMenu, trans));
},
};

Expand Down
32 changes: 32 additions & 0 deletions packages/notebook-extension/src/lab-menu-rename.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { IMainMenu } from '@jupyterlab/mainmenu';

import { TranslationBundle } from '@jupyterlab/translation';

/**
* Rename JupyterLab-defined File menu submenus to match Classic Notebook v6
* wording (jupyter/notebook#6398).
*/
export const renameLabFileMenuItems = (
mainMenu: IMainMenu,
trans: TranslationBundle
): void => {
const renames: Array<{ submenuId: string; label: string }> = [
{
submenuId: 'jp-mainmenu-file-notebookexport',
label: trans.__('Download as'),
},
];

const items = mainMenu.fileMenu.items;
for (const rename of renames) {
for (const item of items) {
if (item.type === 'submenu' && item.submenu?.id === rename.submenuId) {
item.submenu.title.label = rename.label;
break;
}
}
}
};
2 changes: 1 addition & 1 deletion ui-tests/test/menus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const NOTEBOOK = 'empty.ipynb';
const MENU_PATHS = [
'File',
'File>New',
'File>Save and Export Notebook As',
'File>Download as',
'Edit',
'View',
'Run',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion ui-tests/test/notebook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test.describe('Notebook', () => {
expect(await panel.screenshot()).toMatchSnapshot(imageName);
});

test('Clicking on "Close and Shut Down Notebook" should close the browser tab', async ({
test('Clicking on "Close and Halt" should close the browser tab', async ({
page,
tmpPath,
}) => {
Expand Down
Loading