add userdefined value to get the language value from PR_LANGAUGE with en_GB as fallback
This commit is contained in:
parent
2c564426b5
commit
e76ae88edc
@ -173,10 +173,18 @@ Change the language
|
||||
"""
|
||||
def language(user, language):
|
||||
settings = read_settings(user)
|
||||
# Get language from PR_LANGUAGE
|
||||
if language == 'userdefined':
|
||||
try:
|
||||
language = user.prop(PR_LANGUAGE).value
|
||||
except:
|
||||
print('User language is not defined using en_GB as fallback'
|
||||
language = 'en_GB'
|
||||
|
||||
if not settings['settings']['zarafa']['v1'].get('main'):
|
||||
settings['settings']['zarafa']['v1']['main'] = {}
|
||||
settings['settings']['zarafa']['v1']['main']['language'] = locale
|
||||
print('Setting locale to: {}'.format(locale))
|
||||
settings['settings']['zarafa']['v1']['main']['language'] = language
|
||||
print('Setting locale to: {}'.format(language))
|
||||
write_settings(user, json.dumps(settings))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user