misc: get language from default locale if none specified (#7343)
This commit is contained in:
parent
e5f9129194
commit
506e186742
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue