You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "FrancescoCastaldi (via GitHub)" <gi...@apache.org> on 2026/06/25 13:07:45 UTC
[D] How to set Italian month abbreviations (%b) in table chart date format? [superset]
GitHub user FrancescoCastaldi created a discussion: How to set Italian month abbreviations (%b) in table chart date format?
## Question
I'm using Superset 3.x with table charts that display dates using the format `%d - %b` (e.g., "15 - Jan", "20 - Feb"). The abbreviated month names are showing in **English** instead of **Italian**.
### Current Setup
- Superset 3.x with Docker deployment
- Table chart with date column formatted as `%d - %b`
- `BABEL_DEFAULT_LOCALE` is set to `"it"` in config
- UI language is correctly set to Italian
### What I've Found in the Codebase
In `superset/config.py`, there's a `D3_TIME_FORMAT` config that can override the default d3 locale:
```python
# Override the default d3 locale for time format
D3_TIME_FORMAT: D3TimeFormat = {}
```
With a structure that includes `months` and `shortMonths` arrays.
### Questions
1. **How do I set Italian month abbreviations for the `%b` format in table charts?**
2. Is setting `BABEL_DEFAULT_LOCALE = "it"` sufficient, or do I also need to configure `D3_TIME_FORMAT` with Italian `shortMonths`?
3. If `D3_TIME_FORMAT` is needed, what's the correct configuration? For example:
```python
D3_TIME_FORMAT = {
"dateTime": "%x, %X",
"date": "%-m/%-d/%Y",
"time": "%-I:%M:%S %p",
"periods": ["AM", "PM"],
"days": ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"],
"shortDays": ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
"months": ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"],
"shortMonths": ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"]
}
```
4. Does this override apply globally to all charts, or only to new charts?
5. Is there a per-chart or per-column way to set the locale, or is it only a global config?
---
**Environment:**
- Superset version: 3.x
- Database: MSSQL
- Deployment: Docker
- Browser locale: Italian
GitHub link: https://github.com/apache/superset/discussions/41423
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] How to set Italian month abbreviations (%b) in table chart date format? [superset]
Posted by "FrancescoCastaldi (via GitHub)" <gi...@apache.org>.
GitHub user FrancescoCastaldi added a comment to the discussion: How to set Italian month abbreviations (%b) in table chart date format?
Which container should i need to restart to make changes happening?
GitHub link: https://github.com/apache/superset/discussions/41423#discussioncomment-17434452
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] How to set Italian month abbreviations (%b) in table chart date format? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: How to set Italian month abbreviations (%b) in table chart date format?
<!-- Answer -->
For `D3_TIME_FORMAT` specifically, the key container is `superset_app` (the web server), since it serves the bootstrap data containing the D3 locale config to the browser. However, to be safe and ensure consistency, restart all the Python application containers:
- `superset_app` (web server)
- `superset_worker` (Celery worker)
- `superset_worker_beat` (Celery Beat scheduler)
The simplest approach is:
```bash
docker compose down
docker compose up -d
```
You don't need to restart `superset_db` (PostgreSQL) or `superset_cache` (Redis) — those aren't affected by Python config changes [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docker-compose.yml).
After restart, do a hard refresh in your browser (Ctrl+Shift+R) to make sure the new bootstrap data with your Italian locale is loaded.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=d5b3fa6d-4e97-4f71-8f07-36475ad5992c) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/41423#discussioncomment-17434478
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] How to set Italian month abbreviations (%b) in table chart date format? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: How to set Italian month abbreviations (%b) in table chart date format?
<!-- Answer -->
Great questions! Here's what you need to know:
**`BABEL_DEFAULT_LOCALE = "it"` is NOT sufficient for chart date formatting.** It only controls UI translations (menu items, labels, etc.), not how dates are rendered in charts. The `%b` format in table charts is powered by D3.js, which has its own separate locale system [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L443-L454).
**You need to configure `D3_TIME_FORMAT`** in your `superset_config.py`. Your proposed configuration is correct:
```python
D3_TIME_FORMAT = {
"dateTime": "%x, %X",
"date": "%-m/%-d/%Y",
"time": "%-I:%M:%S %p",
"periods": ["AM", "PM"],
"days": ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"],
"shortDays": ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
"months": ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"],
"shortMonths": ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"]
}
```
The `shortMonths` array is specifically what controls the `%b` output [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L427-L441).
**Regarding scope:**
- **Global by default** — `D3_TIME_FORMAT` applies to all charts across the application once set [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/setup/setupFormatters.ts#L96-L112). It's embedded in the bootstrap data served with every page load [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/views/base.py#L362-L378).
- **Per-chart overrides are possible** — Table charts support a `table_timestamp_format` control, and individual columns can have their own `d3TimeFormat` setting [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts#L251-L274). However, these control the *format pattern* (e.g., `%d - %b`), not the *locale strings* (month names). The locale strings (`shortMonths`, `months`, etc.) are always global.
- **Existing charts are affected** — since the locale is resolved at render time, all charts using `%b` will pick up the new Italian abbreviations after you restart Superset with the updated config. No need to recreate charts.
After adding the config, restart your Superset containers and your table charts should display "15 - gen", "20 - feb", etc.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=6f03ecf3-f0e3-4f14-b928-22ed0027bfa2) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/41423#discussioncomment-17434427
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org