dash-bootstrap-components icon indicating copy to clipboard operation
dash-bootstrap-components copied to clipboard

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

Open embar- opened this issue 2 months ago • 1 comments

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

embar- avatar Nov 14 '25 20:11 embar-

Hi @embar-

I’m working on a Dash PR that may address this issue. If you can provide a minimal example that reproduces the error, I can test it using the changes in the PR and see whether it resolves the problem.

AnnMarieW avatar Nov 14 '25 20:11 AnnMarieW