This question has been flagged
4058 Views

We have created a language file which provides dual language interface for this language file which is combination of Chinese and English we gave a locale code CH_US which doesn't exists. OpenERP doesn't complain for this custom locale code when file is imported and everything works fine until you log out and then log in.

After log in following error message is give: Client Error Syntax Error http://[ip removed]:8069/web/static/lib/datejs/globalization/CH-US.js:1

Reason for this error is obvious when you look at the file CH-US.js because it's html file not js file but as it's extension is js it's tried to be handled as js file which gives this syntax error. There is no file CH-US.js in folder /web/static/lib/datejs/globalization/ so I assume it is autogenerated. This error may be because when openERP uses GET to get this http://[ip removed]:8069/web/webclient/translations it succeeds but when I looked what i get if I paste http://[ip removed]:8069/web/webclient/translations in my browser I got this JSON string

{"jsonrpc": "2.0", "error": {"message": "OpenERP Server Error", "code": 200, "data": {"debug": "Traceback (most recent call last):\n File \"/opt/openerp/v7/web/addons/web/http.py\", line 203, in dispatch\n self.jsonrequest = simplejson.load(requestf, object_hook=reject_nonliteral)\n File \"/usr/lib/python2.7/dist-packages/simplejson/__init__.py\", line 395, in load\n use_decimal=use_decimal, *kw)\n File \"/usr/lib/python2.7/dist-packages/simplejson/__init__.py\", line 468, in loads\n return cls(encoding=encoding, *kw).decode(s)\n File \"/usr/lib/python2.7/dist-packages/simplejson/decoder.py\", line 402, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File \"/usr/lib/python2.7/dist-packages/simplejson/decoder.py\", line 420, in raw_decode\n raise JSONDecodeError(\"No JSON object could be decoded\", s, idx)\nJSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)\n", "message": "No JSON object could be decoded: line 1 column 0 (char 0)", "name": "simplejson.decoder.JSONDecodeError", "arguments": ["No JSON object could be decoded: line 1 column 0 (char 0)"]}}}

which is obviously saying that there happened an error during downloading of this translation thing which is maybe because locale CH-US doesn't exist.

Based on googling in openERP manual it is said that non-existing locales are not supported (or actually that locales have to be in standardized format which is same as custom locale codes were not supported).

Is there any way to get rid of this error message except changing the locale code into existing one?

Avatar
Discard