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 [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to