Closed Bug 632017 Opened 14 years ago Closed 14 years ago

[traceback] ValueError from gettext, may break JS

Categories

(support.mozilla.org :: Localization, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jsocol, Unassigned)

Details

Attachments

(1 file)

There's an error coming from gettext on the SL JS localizations script: The error is: ValueError: plural forms expression error, maybe unbalanced parenthesis Traceback (most recent call last): File "/data/www/support.allizom.org/kitsune/vendor/src/django/django/core/handlers/base.py", line 100, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/data/www/support.allizom.org/kitsune/vendor/src/django/django/utils/decorators.py", line 76, in _wrapped_view response = view_func(request, *args, **kwargs) File "/data/www/support.allizom.org/kitsune/vendor/src/django/django/views/i18n.py", line 219, in javascript_catalog catalog = gettext_module.translation(domain, path, [locale]) File "/usr/lib64/python2.6/gettext.py", line 480, in translation t = _translations.setdefault(key, class_(open(mofile, 'rb'))) File "/usr/lib64/python2.6/gettext.py", line 180, in __init__ self._parse(fp) File "/usr/lib64/python2.6/gettext.py", line 317, in _parse self.plural = c2py(plural) File "/usr/lib64/python2.6/gettext.py", line 90, in c2py 'plural forms expression error, maybe unbalanced parenthesis' ValueError: plural forms expression error, maybe unbalanced parenthesis <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{ 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_HOST': 'support-stage-new.mozilla.com', 'HTTP_REFERER': 'http://support-stage-new.mozilla.com/sl/search', 'PATH_INFO': u'/sl/jsi18n/build:a4da733', 'PATH_TRANSLATED': 'redirect:/k/sl/jsi18n/build:a4da733/jsi18n/build:a4da733', 'REDIRECT_SCRIPT_URI': 'http://support-stage-new.mozilla.com/sl/jsi18n/build:a4da733', 'REDIRECT_SCRIPT_URL': '/sl/jsi18n/build:a4da733', 'REDIRECT_URL': '/sl/jsi18n/build:a4da733', 'REQUEST_URI': '/sl/jsi18n/build:a4da733', 'SCRIPT_FILENAME': '/data/www/support-stage-new.mozilla.com/kitsune/wsgi/kitsune.wsgi', 'SCRIPT_NAME': u'', 'SCRIPT_URI': 'http://support-stage-new.mozilla.com/sl/jsi18n/build:a4da733', 'SCRIPT_URL': '/sl/jsi18n/build:a4da733',
The plurals rule is broken in javascript.po: "Plural-Forms: nplurals=4; plural=(n%100==1.\n" http://viewvc.svn.mozilla.org/vc/projects/sumo/locales/sl/LC_MESSAGES/javascript.po?r1=82084&r2=82085& Looks like this is a commit from Verbatim, so I wonder what went wrong. CC/'ing Dwayne. Have you seen anything like this in Pootle before? I can file a bug upstream if you want me to.
Vito -- can you fix this in SVN or would you rather have me do it?
it was my original file that was busted. I uploaded it in the overrwrite mode, so Verbatim had no chance to compain. I check everything locally first in PoEdit and then again in Verbatim. Neither PoEdit nor Verbatim during the checkout caught it. I will watch for it in the future. As regards SVN, Stašm its backfiring on me again and I do not want to experiment. I am sending the corrected file and I have uploaded it to Verbatim as well. Sorry for the trouble!
No problem Vito. I uploaded the file in Verbatim, and committed. Here's the commit's diff: http://viewvc.svn.mozilla.org/vc/projects/sumo/locales/sl/LC_MESSAGES/javascript.po?r1=82090&r2=82212 Marking fixed. Thanks for the report James.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
(In reply to comment #1) > The plurals rule is broken in javascript.po: > > "Plural-Forms: nplurals=4; plural=(n%100==1.\n" > > http://viewvc.svn.mozilla.org/vc/projects/sumo/locales/sl/LC_MESSAGES/javascript.po?r1=82084&r2=82085& > > Looks like this is a commit from Verbatim, so I wonder what went wrong. > > CC/'ing Dwayne. Have you seen anything like this in Pootle before? I can file > a bug upstream if you want me to. Hi Stas, no haven't seen this before. But perfectly understandable why it would occured as neither Pootle nore Poedit does any checking of these equations. I've created this upstream bug: http://bugs.locamotion.org/show_bug.cgi?id=1862 I don't think its that high priority unless someone sees a security related issue with us just accepting anything. SUMO Solution ------------- I assume that SUMO uses .mo files when running. So I think the real issue if probably that SUMO should compile PO files using msgfmt -c which would catch the Plural equation error.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: