Allow locale definition via request header
Important for session less API calls that might return localized content (e.g. the system commands). See #1593
This commit is contained in:
parent
d1cb8ca98a
commit
1a75dcd5ee
2 changed files with 3 additions and 0 deletions
0
src/octoprint/cli/config.py
Normal file
0
src/octoprint/cli/config.py
Normal file
|
|
@ -575,6 +575,9 @@ class Server(object):
|
|||
if "l10n" in request.values:
|
||||
return Locale.negotiate([request.values["l10n"]], LANGUAGES)
|
||||
|
||||
if "X-Locale" in request.headers:
|
||||
return Locale.negotiate([request.headers["X-Locale"]], LANGUAGES)
|
||||
|
||||
if hasattr(g, "identity") and g.identity and userManager.enabled:
|
||||
userid = g.identity.id
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue