Skip to content

Commit 2240993

Browse files
authored
Check locale validity
1 parent 378da09 commit 2240993

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyterlab_server/translations_handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def get(self, locale=""):
8282
message = "Language pack '{}' not valid!".format(locale)
8383
else:
8484
# only change locale if the language pack is installed and valid
85-
translator.set_locale(locale)
85+
if is_valid_locale(locale):
86+
translator.set_locale(locale)
8687
except Exception:
8788
message = traceback.format_exc()
8889

0 commit comments

Comments
 (0)