Error message in sign in when language has custom locale code

Bug #1212118 reported by Laura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
A SYLEAM Component - OpenObject Library
New
Undecided
Unassigned

Bug Description

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 ZH_EN 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/ZH-EN.js:1

Reason for this error is obvious when you look at the file ZH-EN.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 ZH-EN.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 code ZH-EN 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).

In my opinion if custom locale codes are not supported OpenERP shouldn't accept them at all (which is not a good solution because based on help.openerp.com/questions there seems to be need for use of custom locale codes) or at least give better error message or just ignore the problem because this error message doesn't affect on OE functionality and language is shown as it should (combined Chinese-English interface) so in my opinion OE could just ignore it and not show it to the user.

I tried to test this in runbot to see if newer versions still give the error but if I try to import language file runbot gives me Xmlhttprequest error so it is maybe not allowed in runbot.

Versions
web:
revno: 3741 [merge]
branch nick: saas-1
timestamp: Wed 2013-07-31 09:29:14 +0200

server:
revno: 4896 [merge]
branch nick: saas-1
timestamp: Thu 2013-08-01 15:07:23 +0200

addons:
revno: 8758 [merge]
committer: Denis Ledoux <email address hidden>
branch nick: saas-1
timestamp: Thu 2013-08-01 17:53:34 +0200

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.