[FIX] base, tools: use getlocale vs deprecated getdefaultlocale
As getdefaultlocale is deprecated in 3.11 in favor of getlocale which is available since at least 3.0. Part-of: odoo/odoo#112450
This commit is contained in:
@@ -139,7 +139,7 @@ class Lang(models.Model):
|
||||
except locale.Error:
|
||||
continue
|
||||
if fail:
|
||||
lc = locale.getdefaultlocale()[0]
|
||||
lc = locale.getlocale()[0]
|
||||
msg = 'Unable to get information for locale %s. Information from the default locale (%s) have been used.'
|
||||
_logger.warning(msg, lang, lc)
|
||||
|
||||
|
||||
@@ -1412,7 +1412,7 @@ def trans_load_data(cr, fileobj, fileformat, lang, verbose=True, overwrite=False
|
||||
|
||||
def get_locales(lang=None):
|
||||
if lang is None:
|
||||
lang = locale.getdefaultlocale()[0]
|
||||
lang = locale.getlocale()[0]
|
||||
|
||||
if os.name == 'nt':
|
||||
lang = _LOCALE2WIN32.get(lang, lang)
|
||||
|
||||
Reference in New Issue
Block a user