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

default locale will use OS default locale #13721

Conversation

fcollonval
Copy link
Member

References

Fix #9672

Code changes

New default value for language settings to use the default locale (if the associated language pack is installed).

Requires jupyterlab/jupyterlab_server#366

User-facing changes

JupyterLab loads with the OS language by default (if the associated language pack is installed)

Backwards-incompatible changes

None

@jupyterlab-probot
Copy link

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

@fcollonval
Copy link
Member Author

@krassowski would you mind testing this one?

I tested locally on a laptop with French as default Windows language. But I would appreciate if some non-english user can test it too.

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.

Tested locally, works well - thanks!

I left a minor suggestion to add a comment in one place.

try {
for (const lang of Object.values(this._languageData.data ?? {})) {
this._currentLocale = (
(lang as any)['']['language'] as string
Copy link
Member

Choose a reason for hiding this comment

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

The use of empty string looks odd. Might benefit from a commit explaining it.

@fcollonval
Copy link
Member Author

Thanks for the review and test @krassowski

@fcollonval fcollonval force-pushed the fix/9672-add-locale-default-fallback-os-locale branch from bdb5e08 to 44cb76c Compare January 20, 2023 11:40
@krassowski
Copy link
Member

I wonder if we should use Navigator.languages instead. I can imagine a classroom where instructor's native language is very different from language the students use. In RTC mode, this would lead to everyone being served an interface they cannot navigate. Maybe the order of preference should be:

Feel free to move the discussion to a new issue if you want to go ahead merging it as-is.

@fcollonval fcollonval merged commit 5caeba5 into jupyterlab:master Jan 23, 2023
@fcollonval fcollonval deleted the fix/9672-add-locale-default-fallback-os-locale branch January 23, 2023 10:24
@fcollonval
Copy link
Member Author

I'm gonna backport it as jupyterlab_server has been released (and it does not break API).

@fcollonval
Copy link
Member Author

@meeseeksdev please backport to 3.6.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jan 23, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 3.6.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 5caeba5fb5dae5b46c19fdb7def17cc8979abef1
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #13721: `default` locale will use OS default locale'
  1. Push to a named branch:
git push YOURFORK 3.6.x:auto-backport-of-pr-13721-on-3.6.x
  1. Create a PR against branch 3.6.x, I would have named this PR:

"Backport PR #13721 on branch 3.6.x (default locale will use OS default locale)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jupyter lab modifies the locale env variables like LANG
2 participants