ivarec opened a new issue #4837: Changing language to Brazillian Portuguese 
crashes superset
URL: https://github.com/apache/incubator-superset/issues/4837
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if any
   - [x] I have reproduced the issue with at least the latest released version 
of superset
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar
   
   ### Superset version
   0.24.0
   
   ### Expected results
   The UI will present itself in Brazillian Portuguese.
   
   ### Actual results
   Superset's frontend crashes and doesn't recover until I delete my cookies.
   
   ### Steps to reproduce
   Just change to Brazillian Portuguese via the UI button in the topbar.
   
   ### Stacktrace
   
   ```
           Traceback (most recent call last):
     File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1982, in 
wsgi_app
       response = self.full_dispatch_request()
     File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1614, in 
full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1517, in 
handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, 
in reraise
       raise value
     File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1612, in 
full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1598, in 
dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File 
"/usr/local/lib/python3.5/dist-packages/flask_appbuilder/security/decorators.py",
 line 26, in wraps
       return f(self, *args, **kwargs)
     File "/usr/local/lib/python3.5/dist-packages/flask_appbuilder/views.py", 
line 478, in list
       widgets=widgets)
     File 
"/usr/local/lib/python3.5/dist-packages/flask_appbuilder/baseviews.py", line 
160, in render_template
       return render_template(template, **dict(list(kwargs.items()) + 
list(self.extra_args.items())))
     File "/usr/local/lib/python3.5/dist-packages/flask/templating.py", line 
134, in render_template
       context, ctx.app)
     File "/usr/local/lib/python3.5/dist-packages/flask/templating.py", line 
116, in _render
       rv = template.render(context)
     File "/usr/local/lib/python3.5/dist-packages/jinja2/environment.py", line 
1008, in render
       return self.environment.handle_exception(exc_info, True)
     File "/usr/local/lib/python3.5/dist-packages/jinja2/environment.py", line 
780, in handle_exception
       reraise(exc_type, exc_value, tb)
     File "/usr/local/lib/python3.5/dist-packages/jinja2/_compat.py", line 37, 
in reraise
       raise value.with_traceback(tb)
     File 
"/usr/local/lib/python3.5/dist-packages/superset/templates/appbuilder/general/model/list.html",
 line 2, in top-level template code
       {% import 'appbuilder/general/lib.html' as lib %}
     File 
"/usr/local/lib/python3.5/dist-packages/flask_appbuilder/templates/appbuilder/base.html",
 line 1, in top-level template code
       {% extends base_template %}
     File 
"/usr/local/lib/python3.5/dist-packages/superset/templates/superset/base.html", 
line 1, in top-level template code
       {% extends "appbuilder/baselayout.html" %}
     File 
"/usr/local/lib/python3.5/dist-packages/superset/templates/appbuilder/baselayout.html",
 line 2, in top-level template code
       {% import 'appbuilder/baselib.html' as baselib %}
     File 
"/usr/local/lib/python3.5/dist-packages/flask_appbuilder/templates/appbuilder/init.html",
 line 46, in top-level template code
       {% block body %}
     File 
"/usr/local/lib/python3.5/dist-packages/superset/templates/appbuilder/baselayout.html",
 line 5, in block "body"
       {% include 'appbuilder/general/confirm.html' %}
     File 
"/usr/local/lib/python3.5/dist-packages/flask_appbuilder/templates/appbuilder/general/confirm.html",
 line 6, in top-level template code
       {{_('User confirmation needed')}}
     File "/usr/local/lib/python3.5/dist-packages/jinja2/ext.py", line 134, in 
_gettext_alias
       return __context.call(__context.resolve('gettext'), *args, **kwargs)
     File "/usr/local/lib/python3.5/dist-packages/jinja2/ext.py", line 140, in 
gettext
       rv = __context.call(func, __string)
     File "/usr/local/lib/python3.5/dist-packages/flask_babel/__init__.py", 
line 113, in <lambda>
       lambda x: get_translations().ugettext(x),
     File "/usr/local/lib/python3.5/dist-packages/flask_babel/__init__.py", 
line 216, in get_translations
       catalog = support.Translations.load(dirname, [get_locale()])
     File "/usr/local/lib/python3.5/dist-packages/flask_babel/__init__.py", 
line 248, in get_locale
       locale = Locale.parse(rv)
     File "/usr/local/lib/python3.5/dist-packages/babel/core.py", line 268, in 
parse
       parts = parse_locale(identifier, sep=sep)
     File "/usr/local/lib/python3.5/dist-packages/babel/core.py", line 1094, in 
parse_locale
       raise ValueError('expected only letters, got %r' % lang)
   ValueError: expected only letters, got 'pt-br'
   ```
   
   ### Notes
   I suspect that the correct value for Brazillian Portuguese would be pt_BR, 
and not pt-br.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to