Skip to content

Localize user facing strings#380

Merged
brichet merged 2 commits intojupyterlab:mainfrom
jtpio:translator
Mar 12, 2026
Merged

Localize user facing strings#380
brichet merged 2 commits intojupyterlab:mainfrom
jtpio:translator

Conversation

@jtpio
Copy link
Member

@jtpio jtpio commented Mar 5, 2026

Fixes #49

Companion PR: jupyterlab/language-packs#903

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Binder 👈 Launch a Binder on branch jtpio/jupyter-chat/translator

@jtpio jtpio added the enhancement New feature or request label Mar 5, 2026
@jtpio jtpio marked this pull request as ready for review March 5, 2026 06:41
Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Thanks a lot @jtpio for working on this, it looks great!

Some missing translation that we may want to handle (in chat model only):

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Thanks @jtpio.

We'll probably need to update jupyterlab/language-packs#903 with the translation domain.

Copy link
Collaborator

@andrii-i andrii-i left a comment

Choose a reason for hiding this comment

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

Overall looks good. Please see one concern below worth noting and potentially addressing.

export interface IOptions<T extends LabChatPanel>
extends DocumentRegistry.IWidgetFactoryOptions<T>,
Omit<Chat.IOptions, 'model' | 'inputToolbarRegistry'> {
Omit<Chat.IOptions, 'model' | 'inputToolbarRegistry' | 'translator'> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

translator is omitted here so chat widgets opened via the file manager won't be translated - useTranslator() will fall back to nullTranslator for the entire component tree while side-panel mode correctly gets localization via MultiChatPanel. Worth extending ChatWidgetFactory.IOptions to accept and forward translator so document mode has full coverage too. Can be addressed in a follow-up PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This interface already extends DocumentRegistry.IWidgetFactoryOptions which includes a translator.
The property would be duplicated if not omitted, I think.

jtpio and others added 2 commits March 11, 2026 09:10
Co-Authored-By: Nicolas Brichet <brichet@users.noreply.github.com>
@jtpio
Copy link
Member Author

jtpio commented Mar 11, 2026

Ah just realized this picked up a conflict. Just rebased to fix it.

@brichet
Copy link
Collaborator

brichet commented Mar 12, 2026

Thanks @jtpio

@brichet brichet merged commit 5b0ccfc into jupyterlab:main Mar 12, 2026
12 checks passed
@jtpio jtpio deleted the translator branch March 12, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Localize more user facing strings

3 participants