Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the application name instead of hard-coded "JupyterLab" in dialogs/commands #16230

Merged
merged 7 commits into from
Apr 26, 2024

Conversation

sawickid
Copy link
Contributor

References

jupyter/notebook#7188
"File > Shutdown in classic notebook ask if I want to shutdow JupyterLab"

Code changes

Edits shutdown dialogue body to ask if the user wants to shutdown <app.name>, instead of exclusively 'JupyterLab'

User will be prompted to confirm shutdown of Jupyter Notebook, instead of JupyterLab, when using Jupyter Notebook

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link
Contributor

@Carreau Carreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to look at the rest of the file, I think 2 other places in this file would need translation.

body: trans.__('Please confirm you want to shut down JupyterLab.'),
body: trans.__(
'Please confirm you want to shut down ' + app.name + '.'
),
Copy link
Contributor

@Carreau Carreau Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to look into the rest of the codebase how translation is done. Typically you do not want to concatenate strings. For example in japanese, that would be: JupyterLab をシャットダウンすることを確認してください。 or something like that, where JupyterLab is not at the end, and the ends dot is not . but .

For example :

packages/notebook-extension/src/index.ts:        body: trans.__('Are you sure you want to close "%1"?', fileName),

This let the translater chose where the variable goes in the translation.

If you look line 372, just above there is also a caption: trans.__('Shut down JupyterLab'),, this could also be updated.

Copy link
Member

@krassowski krassowski Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback! Making the changes now.

@krassowski krassowski added the bug label Apr 24, 2024
@krassowski krassowski added this to the 4.2.0 milestone Apr 24, 2024
packages/mainmenu-extension/src/index.ts Outdated Show resolved Hide resolved
packages/mainmenu-extension/src/index.ts Outdated Show resolved Hide resolved
packages/mainmenu-extension/src/index.ts Outdated Show resolved Hide resolved
packages/mainmenu-extension/src/index.ts Outdated Show resolved Hide resolved
@krassowski krassowski marked this pull request as ready for review April 26, 2024 14:13
@krassowski krassowski changed the title Fix File > Shutdown in classic notebook asks if user want to shutdown JupyterLab Use the application name instead of hard-coded "JupyterLab" in dialogs Apr 26, 2024
@krassowski krassowski changed the title Use the application name instead of hard-coded "JupyterLab" in dialogs Use the application name instead of hard-coded "JupyterLab" in dialogs/commands Apr 26, 2024
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sawickid, kooks good to me.

@krassowski krassowski merged commit 28e8b3e into jupyterlab:main Apr 26, 2024
81 of 83 checks passed
Copy link

welcome bot commented Apr 26, 2024

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

gderocher pushed a commit to gderocher/jupyterlab that referenced this pull request Apr 26, 2024
…s/commands (jupyterlab#16230)

* updated shutdown dialogue to display app.name

* fixed style

* updated strings to conform with translation standards

* style fix

* Remove extra quotes

---------

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants