diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index 7973022fe..a0fb073be 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -25,6 +25,7 @@ import imp import os import fcntl import json +import locale import random import socket import sys @@ -600,6 +601,10 @@ class QommonPublisher(Publisher): for l in accepted_languages: if l in self.translations.keys(): return l + elif lang is None: + default_locale = locale.getdefaultlocale() + if default_locale and default_locale[0]: + lang = default_locale[0].split('_')[0] return lang def get_admin_module(cls):