Skip to content

Commit a226eaa

Browse files
fcollonvalpre-commit-ci[bot]blink1073
authored
Don't change language environment variable (#366)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <[email protected]>
1 parent 94823fe commit a226eaa

File tree

4 files changed

+94
-128
lines changed

4 files changed

+94
-128
lines changed

jupyterlab_server/settings_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from tornado import web
1414

1515
from .server import APIHandler, tz
16-
from .translation_utils import DEFAULT_LOCALE, L10N_SCHEMA_NAME, is_valid_locale
16+
from .translation_utils import DEFAULT_LOCALE, L10N_SCHEMA_NAME, SYS_LOCALE, is_valid_locale
1717

1818
# The JupyterLab settings file extension.
1919
SETTINGS_EXTENSION = ".jupyterlab-settings"
@@ -454,12 +454,14 @@ def get_current_locale(self):
454454
labextensions_path=self.labextensions_path,
455455
)
456456
except web.HTTPError as e:
457-
schema_warning = "Missing or misshappen translation settings schema:\n%s"
457+
schema_warning = "Missing or misshapen translation settings schema:\n%s"
458458
self.log.warning(schema_warning % str(e))
459459

460460
settings = {}
461461

462-
current_locale = settings.get("settings", {}).get("locale", DEFAULT_LOCALE)
462+
current_locale = settings.get("settings", {}).get("locale") or SYS_LOCALE
463+
if current_locale == "default":
464+
current_locale = SYS_LOCALE
463465
if not is_valid_locale(current_locale):
464466
current_locale = DEFAULT_LOCALE
465467

0 commit comments

Comments
 (0)