Abdulrehman-PIAIC80387 opened a new issue, #40165:
URL: https://github.com/apache/superset/issues/40165

   ### Bug description
   
   When Superset is configured with the Czech locale (`BABEL_DEFAULT_LOCALE = 
"cs"`), every SQL Lab query — including `SELECT 1` — fails with:
   
   ```
   SupersetErrorsException: [SupersetError(message="'statement_num'", ...)]
   ```
   
   This is the same bug pattern as #39566 (French), which was fixed by #38494. 
The original fix corrected French (and several other languages) but the Czech 
translation was missed.
   
   ### Root cause
   
   `superset/sql_lab.py:494` calls:
   
   ```python
   msg = __(
       "Running block %(block_num)s out of %(block_count)s",
       block_num=i + 1,
       block_count=block_count,
   )
   ```
   
   In `superset/translations/cs/LC_MESSAGES/messages.po` (line 10406), the 
Czech translation uses the wrong placeholder names:
   
   ```
   msgid "Running block %(block_num)s out of %(block_count)s"
   msgstr "Spouští se příkaz %(statement_num)s z %(statement_count)s"
   ```
   
   `%(statement_num)s` / `%(statement_count)s` are not passed to `__()`, so 
Python's `%`-formatting raises `KeyError('statement_num')`, which propagates as 
`SupersetErrorsException` and breaks every SQL Lab query.
   
   ### Steps to reproduce
   
   1. Set `BABEL_DEFAULT_LOCALE = "cs"` in `superset_config.py`
   2. Restart Superset
   3. Open SQL Lab and run any query (e.g. `SELECT 1`)
   4. Query fails with `'statement_num'`
   
   ### Expected behavior
   
   Queries execute normally regardless of locale.
   
   ### Fix
   
   Correct the Czech translation in 
`superset/translations/cs/LC_MESSAGES/messages.po`:
   
   ```
   msgstr "Spouští se příkaz %(block_num)s z %(block_count)s"
   ```
   
   ### Superset version
   
   master / latest-dev (bug present since at least 6.0.0)


-- 
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]

Reply via email to