Skip to content

[6.0.0rc4] i18n Fails in Embedded Dashboards Due to /language_pack/<lang>/ Auth Error #36459

@gerbermichi

Description

@gerbermichi

Bug description

I use the following code to set the correct locale:

def set_locale_from_url_param():
    from flask import session, request
    locale_param = request.args.get('lang')
    if locale_param:
        supported_locales = ['de', 'fr']
        if locale_param in supported_locales:
            session["locale"] = locale_param

FLASK_APP_MUTATOR = lambda app: app.before_request(set_locale_from_url_param)

That works fine, however, the call to language_pack/<lang>/ is unauthorized because the guest token is not set yet.

Screenshots/recordings

No response

Superset version

6.0.0rc4

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    embeddedi18nNamespace | Anything related to localization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions