innovark37 opened a new issue, #35524:
URL: https://github.com/apache/superset/issues/35524
### Bug description
Custom D3_FORMAT defined in config.py is ignored when any language other
than English is selected.
**Steps to reproduce**
1. Deploy the Docker version of Superset based on 6.0.0rc2 (same on the
master-branch build version).
2. In config.py set the LANGUAGES and D3_FORMAT variables, for example:
```
LANGUAGES = {
"en": {"flag": "us", "name": "English"},
"es": {"flag": "es", "name": "Spanish"},
"it": {"flag": "it", "name": "Italian"},
"fr": {"flag": "fr", "name": "French"},
"zh": {"flag": "cn", "name": "Chinese"},
"zh_TW": {"flag": "tw", "name": "Traditional Chinese"},
"ja": {"flag": "jp", "name": "Japanese"},
"de": {"flag": "de", "name": "German"},/
"pl": {"flag": "pl", "name": "Polish"},
"pt": {"flag": "pt", "name": "Portuguese"},
"pt_BR": {"flag": "br", "name": "Brazilian Portuguese"},
"ru": {"flag": "ru", "name": "Russian"},
"ko": {"flag": "kr", "name": "Korean"},
"sk": {"flag": "sk", "name": "Slovak"},
"sl": {"flag": "si", "name": "Slovenian"},
"nl": {"flag": "nl", "name": "Dutch"},
"uk": {"flag": "uk", "name": "Ukranian"},
}
class D3Format(TypedDict, total=False):
decimal: str
thousands: str
grouping: list[int]
currency: list[str]
D3_FORMAT: D3Format = {
"decimal": ",",
"thousands": "\u00a0",
"grouping": [3],
"currency": ["", "\u00a0\u20bd"]
}
```
3. Open Superset, switch the UI language to any language other than English
(e.g., Spanish, French, etc.).
4. Observe the number formatting on charts and tables.
**Expected behavior**
The custom D3_FORMAT defined in config.py should be used regardless of which
language is selected, as it was in Superset 5.0.0.
**Actual behavior**
The custom D3_FORMAT is applied only when English is selected. For any other
language Superset reverts to the default D3 format.
**Reason for the bug**
The regression appears to be introduced in PR #34119, where
`setupFormatters` was changed to be called asynchronously.
**Suggested solution**
Call `setupFormatters` synchronously, immediately after `getBootstrapData`.
### Screenshots/recordings

### Superset version
master / latest-dev
### Python version
3.11
### Node version
18 or greater
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]