[FIX] web: remove lazy load of datejs locale
This commit is contained in:
committed by
Fabien Meghazi
parent
a878de477f
commit
347c0e1540
@@ -558,14 +558,6 @@ class WebClient(http.Controller):
|
||||
def load_locale(self, lang):
|
||||
magic_file_finding = [lang.replace("_",'-').lower(), lang.split('_')[0]]
|
||||
addons_path = http.addons_manifest['web']['addons_path']
|
||||
#load datejs locale
|
||||
datejs_locale = ""
|
||||
try:
|
||||
with open(os.path.join(addons_path, 'web', 'static', 'lib', 'datejs', 'globalization', lang.replace('_', '-') + '.js'), 'r') as f:
|
||||
datejs_locale = f.read()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
#load momentjs locale
|
||||
momentjs_locale_file = False
|
||||
momentjs_locale = ""
|
||||
@@ -580,7 +572,7 @@ class WebClient(http.Controller):
|
||||
|
||||
#return the content of the locale
|
||||
headers = [('Content-Type', 'application/javascript'), ('Cache-Control', 'max-age=%s' % (36000))]
|
||||
return request.make_response(datejs_locale + "\n"+ momentjs_locale, headers)
|
||||
return request.make_response(momentjs_locale, headers)
|
||||
|
||||
@http.route('/web/webclient/qweb', type='http', auth="none")
|
||||
def qweb(self, mods=None, db=None):
|
||||
|
||||
Reference in New Issue
Block a user