Skip to content

Regression since dbc 2.0.2: gettext locale update only part of texts #1149

@embar-

Description

@embar-

Please fill out the below information as much as possible.

  • dash version: 3.3.0
  • dash-bootstrap-components version: 2.0.2-2.0.4
  • components affected by bug: dbc.Label(), dbc.Button()

What is happening?

Till dbc 2.0.1, language changing functionality in Dash application worked fine: after setting new gettext locale, re-creating elements have have text in new language. But from dbc 2.0.2rc1, only part of elements change its locale via callback.

Image

All elements are inside dbc.Tab() (title of tabs and dcc.Dropdown() changed locale successfully, though dbc.Label(), dbc.Button() and even dash.html.H6() locale did not changed).
Remaining changes seems to be only after web page reload.

What should be happening?

All items should change its locale, like it was in dbc 2.0.1 and before:

Image

Code

Please find application here: https://github.com/embar-/pdsa-grapher
Especially look into files main.py, grapher_lib/gui_layout_file_upload.py, locale_utils/translations.py.
I change locale using:

from gettext import translation

lang_trans = translation("pdsa-grapher", "locale", languages=["en"])  # for English
# lang_trans = translation("pdsa-grapher", "locale", languages=["lt"])  # for Lithuanian
lang_trans.install()

Error messages

No error messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions